mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Issue #111 New notification sounds
This commit is contained in:
@@ -62,19 +62,19 @@ namespace BlackGui
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioPTTBlocked, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNotificationTextMessageFrequency, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNotificationTextMessagePrivate, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNotificationTextMessageSupervisor, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNotificationTextMessageUnicom, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNotificationTextCallsignMentioned, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNotificationTextMessageSupervisor, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
c = connect(ui->cb_SetupAudioNotificationAtcTunedOut, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNotificationTextMessageSupervisor, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNotificationAtcTunedOut, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNotificationAtcTunedIn, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
c = connect(ui->cb_SetupAudioNotificationAtcTunedIn, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNoTransmission, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
@@ -82,9 +82,9 @@ namespace BlackGui
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAfvClicked, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->pb_SoundReset, &QPushButton::released, this, &CAudioNotificationComponent::resetNotificationSoundsDir, Qt::QueuedConnection);
|
||||
c = connect(ui->pb_SoundReset, &QPushButton::released, this, &CAudioNotificationComponent::resetNotificationSoundsDir, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->pb_SoundDir, &QPushButton::released, this, &CAudioNotificationComponent::selectNotificationSoundsDir, Qt::QueuedConnection);
|
||||
c = connect(ui->pb_SoundDir, &QPushButton::released, this, &CAudioNotificationComponent::selectNotificationSoundsDir, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
|
||||
// volumes
|
||||
@@ -99,6 +99,7 @@ namespace BlackGui
|
||||
{
|
||||
return ui->cb_SetupAudioPTTClickDown->isChecked() || ui->cb_SetupAudioPTTClickUp->isChecked() ||
|
||||
ui->cb_SetupAudioPTTBlocked->isChecked() ||
|
||||
ui->cb_SetupAudioNotificationTextMessageFrequency->isChecked() || ui->cb_SetupAudioNotificationTextMessageUnicom->isChecked() ||
|
||||
ui->cb_SetupAudioNotificationTextMessagePrivate->isChecked() || ui->cb_SetupAudioNotificationTextMessageSupervisor->isChecked() ||
|
||||
ui->cb_SetupAudioNotificationTextCallsignMentioned->isChecked() || ui->cb_SetupAudioNoTransmission->isChecked() ||
|
||||
ui->cb_SetupAfvBlocked->isChecked() || ui->cb_SetupAfvClicked->isChecked() ||
|
||||
@@ -113,8 +114,10 @@ namespace BlackGui
|
||||
ui->cb_SetupAudioPTTClickUp->setChecked(as.isNotificationFlagSet(CNotificationSounds::PTTClickKeyUp));
|
||||
ui->cb_SetupAudioPTTBlocked->setChecked(as.isNotificationFlagSet(CNotificationSounds::PTTBlocked));
|
||||
|
||||
ui->cb_SetupAudioNotificationTextMessageFrequency->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationTextMessageFrequency));
|
||||
ui->cb_SetupAudioNotificationTextMessagePrivate->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationTextMessagePrivate));
|
||||
ui->cb_SetupAudioNotificationTextMessageSupervisor->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationTextMessageSupervisor));
|
||||
ui->cb_SetupAudioNotificationTextMessageUnicom->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationTextMessageUnicom));
|
||||
ui->cb_SetupAudioNotificationTextCallsignMentioned->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationTextCallsignMentioned));
|
||||
ui->cb_SetupAudioNotificationAtcTunedIn->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationAtcTunedIn));
|
||||
ui->cb_SetupAudioNotificationAtcTunedOut->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationAtcTunedOut));
|
||||
@@ -145,8 +148,10 @@ namespace BlackGui
|
||||
if (cb == ui->cb_SetupAudioPTTBlocked) { return CNotificationSounds::PTTBlocked; }
|
||||
|
||||
if (cb == ui->cb_SetupAudioNotificationTextCallsignMentioned) { return CNotificationSounds::NotificationTextCallsignMentioned; }
|
||||
if (cb == ui->cb_SetupAudioNotificationTextMessageFrequency) { return CNotificationSounds::NotificationTextMessageFrequency; }
|
||||
if (cb == ui->cb_SetupAudioNotificationTextMessagePrivate) { return CNotificationSounds::NotificationTextMessagePrivate; }
|
||||
if (cb == ui->cb_SetupAudioNotificationTextMessageSupervisor) { return CNotificationSounds::NotificationTextMessageSupervisor; }
|
||||
if (cb == ui->cb_SetupAudioNotificationTextMessageUnicom) { return CNotificationSounds::NotificationTextMessageUnicom; }
|
||||
if (cb == ui->cb_SetupAudioNotificationAtcTunedIn) { return CNotificationSounds::NotificationAtcTunedIn; }
|
||||
if (cb == ui->cb_SetupAudioNotificationAtcTunedOut) { return CNotificationSounds::NotificationAtcTunedOut; }
|
||||
|
||||
@@ -167,8 +172,10 @@ namespace BlackGui
|
||||
as.setNotificationFlag(CNotificationSounds::PTTClickKeyUp, ui->cb_SetupAudioPTTClickUp->isChecked());
|
||||
as.setNotificationFlag(CNotificationSounds::PTTBlocked, ui->cb_SetupAudioPTTBlocked->isChecked());
|
||||
|
||||
as.setNotificationFlag(CNotificationSounds::NotificationTextMessageFrequency, ui->cb_SetupAudioNotificationTextMessageFrequency->isChecked());
|
||||
as.setNotificationFlag(CNotificationSounds::NotificationTextMessagePrivate, ui->cb_SetupAudioNotificationTextMessagePrivate->isChecked());
|
||||
as.setNotificationFlag(CNotificationSounds::NotificationTextMessageSupervisor, ui->cb_SetupAudioNotificationTextMessageSupervisor->isChecked());
|
||||
as.setNotificationFlag(CNotificationSounds::NotificationTextMessageUnicom, ui->cb_SetupAudioNotificationTextMessageUnicom->isChecked());
|
||||
as.setNotificationFlag(CNotificationSounds::NotificationTextCallsignMentioned, ui->cb_SetupAudioNotificationTextCallsignMentioned->isChecked());
|
||||
as.setNotificationFlag(CNotificationSounds::NotificationNoAudioTransmission, ui->cb_SetupAudioNoTransmission->isChecked());
|
||||
|
||||
|
||||
@@ -50,14 +50,14 @@
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="11" column="1">
|
||||
<item row="13" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioPTTBlocked">
|
||||
<property name="text">
|
||||
<string>PTT blocking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<item row="14" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAfvClicked">
|
||||
<property name="text">
|
||||
<string>AFV click</string>
|
||||
@@ -129,24 +129,38 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextCallsignMentioned">
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextMessageFrequency">
|
||||
<property name="text">
|
||||
<string>notfication for text msg. with my callsign</string>
|
||||
<string>Text message on ATC frequency</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextMessageUnicom">
|
||||
<property name="text">
|
||||
<string>Text message on UNICOM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextCallsignMentioned">
|
||||
<property name="text">
|
||||
<string>Text message mentions my callsign</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAfvBlocked">
|
||||
<property name="text">
|
||||
<string>AFV blocking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="7" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextMessagePrivate">
|
||||
<property name="text">
|
||||
<string>notification for private text messages</string>
|
||||
<string>Private text message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -157,42 +171,42 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<item row="15" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationAtcTunedIn">
|
||||
<property name="text">
|
||||
<string>ATC frequency selected</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioPTTClickDown">
|
||||
<property name="text">
|
||||
<string>PTT click (key down)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextMessageSupervisor">
|
||||
<property name="text">
|
||||
<string>supervisor messages</string>
|
||||
<string>Supervisor text message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNoTransmission">
|
||||
<property name="text">
|
||||
<string>No audio transmission warning</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<item row="11" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioPTTClickUp">
|
||||
<property name="text">
|
||||
<string>PTT click (key up)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1">
|
||||
<item row="16" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationAtcTunedOut">
|
||||
<property name="text">
|
||||
<string>ATC frequency deselected</string>
|
||||
@@ -211,13 +225,19 @@
|
||||
<tabstop>pb_SoundReset</tabstop>
|
||||
<tabstop>pb_SoundDir</tabstop>
|
||||
<tabstop>sb_NotificationValueVolume</tabstop>
|
||||
<tabstop>cb_SetupAudioNotificationTextMessageFrequency</tabstop>
|
||||
<tabstop>cb_SetupAudioNotificationTextMessageUnicom</tabstop>
|
||||
<tabstop>cb_SetupAudioNotificationTextCallsignMentioned</tabstop>
|
||||
<tabstop>cb_SetupAudioNotificationTextMessagePrivate</tabstop>
|
||||
<tabstop>cb_SetupAudioNotificationTextMessageSupervisor</tabstop>
|
||||
<tabstop>cb_SetupAudioNotificationTextCallsignMentioned</tabstop>
|
||||
<tabstop>cb_SetupAudioNoTransmission</tabstop>
|
||||
<tabstop>cb_SetupAudioPTTClickDown</tabstop>
|
||||
<tabstop>cb_SetupAudioPTTClickUp</tabstop>
|
||||
<tabstop>cb_SetupAudioPTTBlocked</tabstop>
|
||||
<tabstop>cb_SetupAfvClicked</tabstop>
|
||||
<tabstop>cb_SetupAfvBlocked</tabstop>
|
||||
<tabstop>cb_SetupAudioNotificationAtcTunedIn</tabstop>
|
||||
<tabstop>cb_SetupAudioNotificationAtcTunedOut</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -23,8 +23,10 @@ namespace BlackMisc
|
||||
static const QString error("error");
|
||||
static const QString login("login");
|
||||
static const QString logoff("logoff");
|
||||
static const QString freqMsg("frequency msg.");
|
||||
static const QString privateMsg("private msg.");
|
||||
static const QString supMsg("supervisor msg.");
|
||||
static const QString unicomMsg("unicom msg.");
|
||||
static const QString mentioned("cs mentioned");
|
||||
static const QString joined("room joined");
|
||||
static const QString left("room left");
|
||||
@@ -43,8 +45,10 @@ namespace BlackMisc
|
||||
case NotificationError: return error;
|
||||
case NotificationLogin: return login;
|
||||
case NotificationLogoff: return logoff;
|
||||
case NotificationTextMessageFrequency: return freqMsg;
|
||||
case NotificationTextMessagePrivate: return privateMsg;
|
||||
case NotificationTextMessageSupervisor: return supMsg;
|
||||
case NotificationTextMessageUnicom: return unicomMsg;
|
||||
case NotificationTextCallsignMentioned: return mentioned;
|
||||
case NotificationNoAudioTransmission: return noaudiotx;
|
||||
case NotificationAtcTunedIn: return tunein;
|
||||
@@ -66,8 +70,10 @@ namespace BlackMisc
|
||||
if (notification.testFlag(NotificationError)) n << flagToString(NotificationError);
|
||||
if (notification.testFlag(NotificationLogin)) n << flagToString(NotificationLogin);
|
||||
if (notification.testFlag(NotificationLogoff)) n << flagToString(NotificationLogoff);
|
||||
if (notification.testFlag(NotificationTextMessageFrequency)) n << flagToString(NotificationTextMessageFrequency);
|
||||
if (notification.testFlag(NotificationTextMessagePrivate)) n << flagToString(NotificationTextMessagePrivate);
|
||||
if (notification.testFlag(NotificationTextMessageSupervisor)) n << flagToString(NotificationTextMessageSupervisor);
|
||||
if (notification.testFlag(NotificationTextMessageUnicom)) n << flagToString(NotificationTextMessageUnicom);
|
||||
if (notification.testFlag(NotificationTextCallsignMentioned)) n << flagToString(NotificationTextCallsignMentioned);
|
||||
if (notification.testFlag(NotificationNoAudioTransmission)) n << flagToString(NotificationNoAudioTransmission);
|
||||
|
||||
|
||||
@@ -40,8 +40,10 @@ namespace BlackMisc
|
||||
NotificationError = 1 << 0,
|
||||
NotificationLogin = 1 << 1,
|
||||
NotificationLogoff = 1 << 2,
|
||||
NotificationTextMessageFrequency = 1 << 12,
|
||||
NotificationTextMessagePrivate = 1 << 3,
|
||||
NotificationTextMessageSupervisor = 1 << 4,
|
||||
NotificationTextMessageUnicom = 1 << 13,
|
||||
NotificationTextCallsignMentioned = 1 << 5,
|
||||
NotificationNoAudioTransmission = 1 << 6,
|
||||
NotificationAtcTunedIn = 1 << 10,
|
||||
@@ -55,7 +57,8 @@ namespace BlackMisc
|
||||
Q_DECLARE_FLAGS(Notification, NotificationFlag)
|
||||
|
||||
//! All text notification flags
|
||||
constexpr static Notification AllTextNotifications = Notification(NotificationTextMessagePrivate | NotificationTextCallsignMentioned | NotificationTextMessageSupervisor);
|
||||
constexpr static Notification AllTextNotifications = Notification(
|
||||
NotificationTextMessageFrequency | NotificationTextMessagePrivate | NotificationTextCallsignMentioned | NotificationTextMessageSupervisor | NotificationTextMessageUnicom);
|
||||
|
||||
//! All login notification flags
|
||||
constexpr static Notification AllLoginNotifications = Notification(NotificationLogin | NotificationLogoff);
|
||||
@@ -70,7 +73,7 @@ namespace BlackMisc
|
||||
constexpr static Notification AllNotifications = Notification(NotificationError | AllTextNotifications | AllLoginNotifications | AllPTTNotifications | AllAfv);
|
||||
|
||||
//! Default notification flags
|
||||
constexpr static Notification DefaultNotifications = Notification(AllNotifications);
|
||||
constexpr static Notification DefaultNotifications = Notification(AllNotifications & ~(NotificationTextMessageFrequency | NotificationTextMessageUnicom));
|
||||
|
||||
//! As string
|
||||
static const QString &flagToString(NotificationFlag notification);
|
||||
|
||||
@@ -67,8 +67,10 @@ namespace BlackSound
|
||||
this->updateEffect(CNotificationSounds::NotificationError, directory, "error.wav");
|
||||
this->updateEffect(CNotificationSounds::NotificationLogin, directory, "login.wav");
|
||||
this->updateEffect(CNotificationSounds::NotificationLogoff, directory, "logoff.wav");
|
||||
this->updateEffect(CNotificationSounds::NotificationTextMessageFrequency, directory, "frequencymessage.wav");
|
||||
this->updateEffect(CNotificationSounds::NotificationTextMessagePrivate, directory, "privatemessage.wav");
|
||||
this->updateEffect(CNotificationSounds::NotificationTextMessageSupervisor, directory, "supervisormessage.wav");
|
||||
this->updateEffect(CNotificationSounds::NotificationTextMessageUnicom, directory, "unicommessage.wav");
|
||||
this->updateEffect(CNotificationSounds::NotificationTextCallsignMentioned, directory, "callsignmentioned.wav");
|
||||
this->updateEffect(CNotificationSounds::NotificationNoAudioTransmission, directory, "noaudiotransmission.wav");
|
||||
this->updateEffect(CNotificationSounds::NotificationAtcTunedIn, directory, "atctunedin.wav");
|
||||
|
||||
Reference in New Issue
Block a user