diff --git a/src/blackgui/components/audiosetupcomponent.cpp b/src/blackgui/components/audiosetupcomponent.cpp index 029e4b9ef..707a58990 100644 --- a/src/blackgui/components/audiosetupcomponent.cpp +++ b/src/blackgui/components/audiosetupcomponent.cpp @@ -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); diff --git a/src/blackgui/components/audiosetupcomponent.ui b/src/blackgui/components/audiosetupcomponent.ui index 152d3f317..90854b87b 100644 --- a/src/blackgui/components/audiosetupcomponent.ui +++ b/src/blackgui/components/audiosetupcomponent.ui @@ -148,7 +148,7 @@ - + PTT click @@ -169,6 +169,13 @@ + + + + No audio transmission warning + + + @@ -196,6 +203,7 @@ cb_SetupAudioNotificationTextCallsignMentioned cb_SetupAudioNotificationVoiceRoomJoined cb_SetupAudioNotificationVoiceRoomLeft + cb_SetupAudioNoTransmission cb_SetupAudioPTTClick diff --git a/src/blackmisc/audio/audiosettings.h b/src/blackmisc/audio/audiosettings.h index 833dfffe0..dfddd4d7f 100644 --- a/src/blackmisc/audio/audiosettings.h +++ b/src/blackmisc/audio/audiosettings.h @@ -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); } //! @} diff --git a/src/blackmisc/audio/notificationsounds.cpp b/src/blackmisc/audio/notificationsounds.cpp index e259848ed..ec51b98f4 100644 --- a/src/blackmisc/audio/notificationsounds.cpp +++ b/src/blackmisc/audio/notificationsounds.cpp @@ -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); diff --git a/src/blackmisc/audio/notificationsounds.h b/src/blackmisc/audio/notificationsounds.h index a243623f7..2b5f56417 100644 --- a/src/blackmisc/audio/notificationsounds.h +++ b/src/blackmisc/audio/notificationsounds.h @@ -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 diff --git a/src/blacksound/share/sounds/noaudiotransmission.wav b/src/blacksound/share/sounds/noaudiotransmission.wav new file mode 100644 index 000000000..25a0fb9dc Binary files /dev/null and b/src/blacksound/share/sounds/noaudiotransmission.wav differ diff --git a/src/blacksound/soundgenerator.cpp b/src/blacksound/soundgenerator.cpp index d9cddd02c..b015c7a78 100644 --- a/src/blacksound/soundgenerator.cpp +++ b/src/blacksound/soundgenerator.cpp @@ -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);