mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Ref T494, moved audio settings Trait directly info BlackMisc settings file
This commit is contained in:
committed by
Mat Sutcliffe
parent
13647329f9
commit
90b893c62a
@@ -13,6 +13,7 @@
|
||||
#define BLACKMISC_AUDIO_SETTINGS_H
|
||||
|
||||
#include "blackmisc/audio/notificationsounds.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/metaclass.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
@@ -45,6 +46,12 @@ namespace BlackMisc
|
||||
//! Set notification
|
||||
void setNotification(CNotificationSounds::Notification notification) { m_notification = static_cast<int>(notification); }
|
||||
|
||||
//! Simplified functions @{
|
||||
bool textMessagePrivate() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextMessagePrivate); }
|
||||
bool textCallsignMentioned() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextCallsignMentioned); }
|
||||
bool pttClick() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClick); }
|
||||
//! @}
|
||||
|
||||
//! Settings value
|
||||
CStatusMessage value(const QString &path, const QString &command, const CVariant &value, bool &changedFlag);
|
||||
|
||||
@@ -63,6 +70,19 @@ namespace BlackMisc
|
||||
BLACK_METAMEMBER(notification)
|
||||
);
|
||||
};
|
||||
|
||||
//! Audio related settings
|
||||
struct TSettings : public TSettingTrait<CSettings>
|
||||
{
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "audio/setup"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Audio"); return name; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::isValid
|
||||
static bool isValid(const BlackMisc::Audio::CSettings &value) { Q_UNUSED(value); return true; }
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user