12 using namespace swift::misc::audio;
16 namespace swift::misc::audio
39 if (value) { m_notification |= notification; }
40 else { m_notification &= ~notification; }
45 QString d = dir.trimmed();
49 m_notificationSoundDir.clear();
53 m_notificationSoundDir = d;
58 if (!m_notificationSoundDir.isEmpty())
60 const QDir d(m_notificationSoundDir);
61 if (d.exists()) {
return m_notificationSoundDir; }
68 if (fileName.isEmpty()) {
return {}; }
86 QString::number(m_notificationVolume);
static QString fixWindowsUncPath(const QString &filePath)
UNC file paths on Qt start with "/", but UNC file paths only work when they start with "//".
static const QString & soundFilesDirectory()
Where sound files are located.
static QString soundFilePathOrDefaultPath(const QString &directory, const QString &fileName)
File path (with file name) of file name and.
Value object encapsulating information of audio related settings.
static constexpr int OutMin
Ranges for audio.
const QString & getNotificationSoundDirectoryOrDefault() const
get existing notifcation settings directory or default swift directory
static constexpr int OutMax
Ranges for audio.
CNotificationSounds::Notification getNotification() const
Get notification.
QString getNotificationFilePath(const QString &fileName) const
Get existing file path for the given file path, either in the settings specific or default dir.
static constexpr int InMin
Ranges for audio.
void setNotificationFlag(CNotificationSounds::NotificationFlag notification, bool value)
Notification flag (play notification?)
void setNotificationSoundDirectory(const QString &dir)
Directory.
static int fixInVolume(int v)
Make sure the volume is within the range.
void setOutVolume(int volume)
Set volume (audio) 0..100.
bool isNotificationFlagSet(CNotificationSounds::NotificationFlag notification) const
Notification flag (play notification?)
QString convertToQString(bool i18n=false) const
Cast as QString.
void setInVolume(int volume)
Set mic.volume 0..100.
void setOutVolumeCom2(int volume)
Set volume for com2 (audio) 0..100.
static constexpr int InMax
Ranges for audio.
void setNotificationVolume(int volume)
Set volume (notifications)
void setOutVolumeCom1(int volume)
Set volume for com1 (audio) 0..100.
static int fixOutVolume(int v)
Make sure the volume is within the range.
static QString toString(Notification notification)
As string.
NotificationFlag
Play notification.
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.