Ref T565, setup and support for "no audio transmission" sound

* UI, added checkbox for "no audio tx"
* added in audio settings
* added in sound generator
This commit is contained in:
Klaus Basan
2019-03-13 17:26:09 +01:00
committed by Mat Sutcliffe
parent 5ac1f65756
commit 244c7e638a
7 changed files with 30 additions and 11 deletions

View File

@@ -96,6 +96,8 @@ namespace BlackGui
Q_ASSERT(c);
c = connect(ui->cb_SetupAudioNotificationTextCallsignMentioned, &QCheckBox::toggled, this, &CAudioSetupComponent::onNotificationsToggled);
Q_ASSERT(c);
c = connect(ui->cb_SetupAudioNoTransmission, &QCheckBox::toggled, this, &CAudioSetupComponent::onNotificationsToggled);
Q_ASSERT(c);
}
Q_UNUSED(c);
}
@@ -109,7 +111,7 @@ namespace BlackGui
return ui->cb_SetupAudioPTTClick->isChecked() ||
ui->cb_SetupAudioNotificationTextMessagePrivate->isChecked() || ui->cb_SetupAudioNotificationTextMessageSupervisor->isChecked() ||
ui->cb_SetupAudioNotificationVoiceRoomLeft->isChecked() || ui->cb_SetupAudioNotificationVoiceRoomJoined->isChecked() ||
ui->cb_SetupAudioNotificationTextCallsignMentioned->isChecked();
ui->cb_SetupAudioNotificationTextCallsignMentioned->isChecked() || ui->cb_SetupAudioNoTransmission->isChecked();
}
void CAudioSetupComponent::reloadSettings()
@@ -121,6 +123,7 @@ namespace BlackGui
ui->cb_SetupAudioNotificationTextMessagePrivate->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationTextMessagePrivate));
ui->cb_SetupAudioNotificationTextMessageSupervisor->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationTextMessageSupervisor));
ui->cb_SetupAudioNotificationTextCallsignMentioned->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationTextCallsignMentioned));
ui->cb_SetupAudioNoTransmission->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationNoAudioTransmission));
}
void CAudioSetupComponent::initAudioDeviceLists()
@@ -145,6 +148,7 @@ namespace BlackGui
if (cb == ui->cb_SetupAudioNotificationTextCallsignMentioned) { return CNotificationSounds::NotificationTextCallsignMentioned; }
if (cb == ui->cb_SetupAudioNotificationTextMessagePrivate) { return CNotificationSounds::NotificationTextMessagePrivate; }
if (cb == ui->cb_SetupAudioNotificationTextMessageSupervisor) { return CNotificationSounds::NotificationTextMessageSupervisor; }
if (cb == ui->cb_SetupAudioNoTransmission) { return CNotificationSounds::NotificationNoAudioTransmission; }
return CNotificationSounds::NoNotifications;
}
@@ -223,6 +227,7 @@ namespace BlackGui
as.setNotificationFlag(CNotificationSounds::NotificationTextMessagePrivate, ui->cb_SetupAudioNotificationTextMessagePrivate->isChecked());
as.setNotificationFlag(CNotificationSounds::NotificationTextMessageSupervisor, ui->cb_SetupAudioNotificationTextMessageSupervisor->isChecked());
as.setNotificationFlag(CNotificationSounds::NotificationTextCallsignMentioned, ui->cb_SetupAudioNotificationTextCallsignMentioned->isChecked());
as.setNotificationFlag(CNotificationSounds::NotificationNoAudioTransmission, ui->cb_SetupAudioNoTransmission->isChecked());
const CStatusMessage msg = m_audioSettings.set(as);
CLogMessage(this).preformatted(msg);

View File

@@ -148,7 +148,7 @@
</property>
</widget>
</item>
<item row="10" column="1">
<item row="11" column="1">
<widget class="QCheckBox" name="cb_SetupAudioPTTClick">
<property name="text">
<string>PTT click</string>
@@ -169,6 +169,13 @@
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="cb_SetupAudioNoTransmission">
<property name="text">
<string>No audio transmission warning</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@@ -196,6 +203,7 @@
<tabstop>cb_SetupAudioNotificationTextCallsignMentioned</tabstop>
<tabstop>cb_SetupAudioNotificationVoiceRoomJoined</tabstop>
<tabstop>cb_SetupAudioNotificationVoiceRoomLeft</tabstop>
<tabstop>cb_SetupAudioNoTransmission</tabstop>
<tabstop>cb_SetupAudioPTTClick</tabstop>
</tabstops>
<resources/>

View File

@@ -49,6 +49,7 @@ namespace BlackMisc
bool textMessagePrivate() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextMessagePrivate); }
bool textMessageSupervisor() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextMessageSupervisor); }
bool textCallsignMentioned() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextCallsignMentioned); }
bool noAudioTransmission() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationNoAudioTransmission); }
bool pttClick() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClick); }
//! @}

View File

@@ -27,18 +27,20 @@ namespace BlackMisc
static const QString left("room left");
static const QString ptt("PTT click");
static const QString load("load sounds");
static const QString noaudiotx("No audio tx");
switch (notification)
{
case NotificationError: return error;
case NotificationLogin: return login;
case NotificationError: return error;
case NotificationLogin: return login;
case NotificationLogoff: return logoff;
case NotificationTextMessagePrivate: return privateMsg;
case NotificationTextMessagePrivate: return privateMsg;
case NotificationTextMessageSupervisor: return supMsg;
case NotificationTextCallsignMentioned: return mentioned;
case NotificationVoiceRoomJoined: return joined;
case NotificationVoiceRoomLeft: return left;
case PTTClick: return ptt;
case NotificationVoiceRoomLeft: return left;
case NotificationNoAudioTransmission: return noaudiotx;
case PTTClick: return ptt;
case LoadSounds: return load;
default: break;
}
@@ -52,8 +54,9 @@ namespace BlackMisc
if (notification.testFlag(NotificationLogin)) n << flagToString(NotificationLogin);
if (notification.testFlag(NotificationLogoff)) n << flagToString(NotificationLogoff);
if (notification.testFlag(NotificationTextMessagePrivate)) n << flagToString(NotificationTextMessagePrivate);
if (notification.testFlag(NotificationTextMessageSupervisor)) n << flagToString(NotificationTextMessageSupervisor);
if (notification.testFlag(NotificationTextMessageSupervisor)) n << flagToString(NotificationTextMessageSupervisor);
if (notification.testFlag(NotificationTextCallsignMentioned)) n << flagToString(NotificationTextCallsignMentioned);
if (notification.testFlag(NotificationNoAudioTransmission)) n << flagToString(NotificationNoAudioTransmission);
if (notification.testFlag(NotificationVoiceRoomJoined)) n << flagToString(NotificationVoiceRoomJoined);
if (notification.testFlag(NotificationVoiceRoomLeft)) n << flagToString(NotificationVoiceRoomLeft);
if (notification.testFlag(LoadSounds)) n << flagToString(LoadSounds);

View File

@@ -45,11 +45,12 @@ namespace BlackMisc
NotificationTextCallsignMentioned = 1 << 5,
NotificationVoiceRoomJoined = 1 << 6,
NotificationVoiceRoomLeft = 1 << 7,
PTTClick = 1 << 8,
LoadSounds = 1 << 9, //!< end marker and force loading of sounds, keep as last element
NotificationNoAudioTransmission = 1 << 8,
PTTClick = 1 << 9,
LoadSounds = 1 << 10, //!< end marker and force loading of sounds, keep as last element
AllTextNotifications = NotificationTextMessagePrivate | NotificationTextCallsignMentioned | NotificationTextMessageSupervisor,
AllLoginNotifications = NotificationLogin | NotificationLogoff,
AllVoiceRoomNotifications = NotificationVoiceRoomJoined | NotificationVoiceRoomLeft,
AllVoiceRoomNotifications = NotificationVoiceRoomJoined | NotificationVoiceRoomLeft | NotificationNoAudioTransmission,
AllNotifications = NotificationError | AllTextNotifications | AllLoginNotifications | AllVoiceRoomNotifications,
DefaultNotifications = NotificationError | AllTextNotifications | AllLoginNotifications | AllVoiceRoomNotifications,
All = AllNotifications | PTTClick

Binary file not shown.

View File

@@ -503,6 +503,7 @@ namespace BlackSound
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/callsignmentioned.wav")) && success;
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/voiceroomjoined.wav")) && success;
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/voiceroomleft.wav")) && success;
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/noaudiotransmission.wav")) && success;
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/pttclick.wav")) && success;
Q_ASSERT(success);