Remove ATC tune in/out notification sound

Related to #156
This commit is contained in:
Lars Toenning
2023-11-07 21:13:58 +01:00
parent e2b5cfb4d6
commit e1cf40463f
8 changed files with 3 additions and 57 deletions

View File

@@ -267,23 +267,6 @@ namespace BlackCore::Context
const bool atcCom1 = atcs.hasComUnitTunedInChannelSpacing(com1);
const bool atcCom2 = atcs.hasComUnitTunedInChannelSpacing(com2);
const bool tunedIn1 = atcCom1 && !lastCom1.isReceiveEnabled();
const bool tunedIn2 = atcCom2 && !lastCom2.isReceiveEnabled();
const bool tunedOut1 = !atcCom1 && lastCom1.isReceiveEnabled();
const bool tunedOut2 = !atcCom2 && lastCom2.isReceiveEnabled();
if (sApp && sApp->getCContextAudioBase() && sApp->getIContextNetwork()->isConnected())
{
if (tunedIn1 || tunedIn2)
{
sApp->getCContextAudioBase()->playNotification(CNotificationSounds::NotificationAtcTunedIn, true);
}
else if (tunedOut1 || tunedOut2)
{
sApp->getCContextAudioBase()->playNotification(CNotificationSounds::NotificationAtcTunedOut, true);
}
}
// remember if I was tuned in, abusing the flag
com1.setReceiveEnabled(atcCom1);
com2.setReceiveEnabled(atcCom2);

View File

@@ -63,10 +63,6 @@ namespace BlackGui::Components
Q_ASSERT(c);
c = connect(ui->cb_SetupAudioNotificationTextCallsignMentioned, &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);
Q_ASSERT(c);
c = connect(ui->cb_SetupAfvBlocked, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
Q_ASSERT(c);
c = connect(ui->cb_SetupAfvClicked, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
@@ -91,8 +87,7 @@ namespace BlackGui::Components
ui->cb_SetupAudioNotificationTextMessageFrequency->isChecked() || ui->cb_SetupAudioNotificationTextMessageUnicom->isChecked() ||
ui->cb_SetupAudioNotificationTextMessagePrivate->isChecked() || ui->cb_SetupAudioNotificationTextMessageSupervisor->isChecked() ||
ui->cb_SetupAudioNotificationTextCallsignMentioned->isChecked() ||
ui->cb_SetupAfvBlocked->isChecked() || ui->cb_SetupAfvClicked->isChecked() ||
ui->cb_SetupAudioNotificationAtcTunedIn->isChecked() || ui->cb_SetupAudioNotificationAtcTunedOut->isChecked();
ui->cb_SetupAfvBlocked->isChecked() || ui->cb_SetupAfvClicked->isChecked();
}
void CAudioNotificationComponent::reloadSettings()
@@ -108,8 +103,6 @@ namespace BlackGui::Components
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));
ui->cb_SetupAfvBlocked->setChecked(as.isNotificationFlagSet(CNotificationSounds::AFVBlocked));
ui->cb_SetupAfvClicked->setChecked(as.isNotificationFlagSet(CNotificationSounds::AFVClicked));
@@ -140,8 +133,6 @@ namespace BlackGui::Components
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; }
if (cb == ui->cb_SetupAfvBlocked) { return CNotificationSounds::AFVBlocked; }
if (cb == ui->cb_SetupAfvClicked) { return CNotificationSounds::AFVClicked; }
@@ -167,9 +158,6 @@ namespace BlackGui::Components
as.setNotificationFlag(CNotificationSounds::AFVBlocked, ui->cb_SetupAfvBlocked->isChecked());
as.setNotificationFlag(CNotificationSounds::AFVClicked, ui->cb_SetupAfvClicked->isChecked());
as.setNotificationFlag(CNotificationSounds::NotificationAtcTunedOut, ui->cb_SetupAudioNotificationAtcTunedOut->isChecked());
as.setNotificationFlag(CNotificationSounds::NotificationAtcTunedIn, ui->cb_SetupAudioNotificationAtcTunedIn->isChecked());
const CStatusMessage msg = m_audioSettings.set(as);
CLogMessage(this).preformatted(msg);

View File

@@ -171,13 +171,6 @@
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="QCheckBox" name="cb_SetupAudioNotificationAtcTunedIn">
<property name="text">
<string>ATC frequency selected</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="cb_SetupAudioPTTClickDown">
<property name="text">
@@ -199,13 +192,6 @@
</property>
</widget>
</item>
<item row="15" column="1">
<widget class="QCheckBox" name="cb_SetupAudioNotificationAtcTunedOut">
<property name="text">
<string>ATC frequency deselected</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
@@ -228,8 +214,6 @@
<tabstop>cb_SetupAudioPTTBlocked</tabstop>
<tabstop>cb_SetupAfvClicked</tabstop>
<tabstop>cb_SetupAfvBlocked</tabstop>
<tabstop>cb_SetupAudioNotificationAtcTunedIn</tabstop>
<tabstop>cb_SetupAudioNotificationAtcTunedOut</tabstop>
</tabstops>
<resources/>
<connections/>

View File

@@ -24,8 +24,6 @@ namespace BlackMisc::Audio
static const QString pttBlocked("PTT blocked");
static const QString afvclick("AFC click");
static const QString afvblock("AFV blocked");
static const QString tunein("ATC tuned in");
static const QString tuneout("ATC tuned off");
switch (notification)
{
@@ -37,8 +35,6 @@ namespace BlackMisc::Audio
case NotificationTextMessageSupervisor: return supMsg;
case NotificationTextMessageUnicom: return unicomMsg;
case NotificationTextCallsignMentioned: return mentioned;
case NotificationAtcTunedIn: return tunein;
case NotificationAtcTunedOut: return tuneout;
case PTTClickKeyDown: return pttDown;
case PTTClickKeyUp: return pttUp;
case PTTBlocked: return pttBlocked;
@@ -62,9 +58,6 @@ namespace BlackMisc::Audio
if (notification.testFlag(NotificationTextMessageUnicom)) n << flagToString(NotificationTextMessageUnicom);
if (notification.testFlag(NotificationTextCallsignMentioned)) n << flagToString(NotificationTextCallsignMentioned);
if (notification.testFlag(NotificationAtcTunedIn)) n << flagToString(NotificationAtcTunedIn);
if (notification.testFlag(NotificationAtcTunedOut)) n << flagToString(NotificationAtcTunedOut);
if (notification.testFlag(PTTClickKeyUp)) n << flagToString(PTTClickKeyUp);
if (notification.testFlag(PTTClickKeyDown)) n << flagToString(PTTClickKeyDown);
if (notification.testFlag(PTTBlocked)) n << flagToString(PTTBlocked);

View File

@@ -31,8 +31,8 @@ namespace BlackMisc::Audio
NotificationTextMessageUnicom = 1 << 13,
NotificationTextCallsignMentioned = 1 << 5,
// 1 << 6 previously used for NoAudioTransmission
NotificationAtcTunedIn = 1 << 10,
NotificationAtcTunedOut = 1 << 11,
// 1 << 10 previously used for NotificationAtcTunedIn
// 1 << 11 previously used for NotificationAtcTunedOut
PTTClickKeyDown = 1 << 7,
PTTClickKeyUp = 1 << 8,
PTTBlocked = 1 << 9,

View File

@@ -65,8 +65,6 @@ namespace BlackSound
this->updateEffect(CNotificationSounds::NotificationTextMessageSupervisor, directory, "supervisormessage.wav");
this->updateEffect(CNotificationSounds::NotificationTextMessageUnicom, directory, "unicommessage.wav");
this->updateEffect(CNotificationSounds::NotificationTextCallsignMentioned, directory, "callsignmentioned.wav");
this->updateEffect(CNotificationSounds::NotificationAtcTunedIn, directory, "atctunedin.wav");
this->updateEffect(CNotificationSounds::NotificationAtcTunedOut, directory, "atctunedout.wav");
this->updateEffect(CNotificationSounds::PTTBlocked, directory, "pttblocked.wav");
this->updateEffect(CNotificationSounds::PTTClickKeyDown, directory, "pttclick.wav");
this->updateEffect(CNotificationSounds::PTTClickKeyUp, directory, "pttclick.wav");