6 #ifndef SWIFT_MISC_AUDIO_SETTINGS_H
7 #define SWIFT_MISC_AUDIO_SETTINGS_H
21 namespace swift::misc::audio
29 static constexpr
int InMax = 100;
30 static constexpr
int InMin = 0;
31 static constexpr
int OutMax = 100;
32 static constexpr
int OutMin = 0;
37 static int fixOutVolume(
int v);
38 static int fixInVolume(
int v);
53 return static_cast<CNotificationSounds::Notification
>(m_notification);
59 m_notification =
static_cast<int>(notification);
66 return this->isNotificationFlagSet(CNotificationSounds::NotificationTextMessagePrivate);
70 return this->isNotificationFlagSet(CNotificationSounds::NotificationTextMessageSupervisor);
74 return this->isNotificationFlagSet(CNotificationSounds::NotificationTextCallsignMentioned);
76 bool pttClickDown()
const {
return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyDown); }
77 bool pttClickUp()
const {
return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyUp); }
79 bool afvClicked()
const {
return this->isNotificationFlagSet(CNotificationSounds::AFVClicked); }
80 bool afvBlocked()
const {
return this->isNotificationFlagSet(CNotificationSounds::AFVBlocked); }
84 void setNotificationSoundDirectory(
const QString &dir);
90 const QString &getNotificationSoundDirectoryOrDefault()
const;
95 QString getNotificationFilePath(
const QString &fileName)
const;
98 void setNotificationVolume(
int volume);
104 void setOutVolume(
int volume);
110 void setOutVolumeCom1(
int volume);
116 void setOutVolumeCom2(
int volume);
122 void setInVolume(
int volume);
134 QString convertToQString(
bool i18n =
false)
const;
137 QString m_notificationSoundDir;
138 int m_notification =
static_cast<int>(
141 int m_notificationVolume = 90;
142 int m_outVolume = 40;
143 int m_outVolumeCom1 = 100;
144 int m_outVolumeCom2 = 100;
146 bool m_audioEffects =
true;
164 static const char *
key() {
return "audio/%Application%/setup"; }
169 static const QString name(
"Audio");
Mix of the most commonly used mixin classes.
Value object encapsulating information of audio related settings.
void setAudioEffectsEnabled(bool enabled)
Audio effects.
CNotificationSounds::Notification getNotification() const
Get notification.
bool afvClicked() const
Simplified functions.
bool textMessageSupervisor() const
Simplified functions.
int getNotificationVolume() const
Get volume (notifications)
bool textMessagePrivate() const
Simplified functions.
void setNotification(CNotificationSounds::Notification notification)
Set notification.
CSettings()=default
Default constructor.
int getOutVolumeCom2() const
Get volume for com2 (audio) 0..100.
bool afvBlocked() const
Simplified functions.
int getOutVolume() const
Get volume (audio) 0..100.
bool pttClickUp() const
Simplified functions.
bool isAudioEffectsEnabled() const
Audio effects enabled?
int getInVolume() const
Get mic.volume (audio 0..100)
bool pttClickDown() const
Simplified functions.
bool textCallsignMentioned() const
Simplified functions.
int getOutVolumeCom1() const
Get volume for com1 (audio) 0..100.
const QString & getNotificationSoundDirectory() const
Notification directory.
Base class for traits to be used as template argument to swift::misc::CSetting.
constexpr static Notification DefaultNotifications
Default notification flags.
NotificationFlag
Play notification.
static bool isValid(const swift::misc::audio::CSettings &value, QString &)
Validator function. Return true if the argument is valid, false otherwise. Default implementation jus...
static const char * key()
Key string of the value. Reimplemented in derived class.
static const QString & humanReadable()
Optional human readable name.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...