From 7fdc2c3db33a1bfa2d74fbacaf450dcae5de9b41 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 17 Oct 2019 18:13:57 +0200 Subject: [PATCH] [AFV] Ref T730, changed/added settings for AFV and allow still to use old swift notifications --- src/blackcore/afv/audio/receiversampleprovider.cpp | 4 ++-- src/blackgui/components/cockpitinfoareacomponent.cpp | 11 ++++------- src/blackmisc/audio/audiosettings.h | 9 ++++++--- src/blackmisc/audio/notificationsounds.cpp | 7 +++++++ src/blackmisc/audio/notificationsounds.h | 9 +++++++-- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/blackcore/afv/audio/receiversampleprovider.cpp b/src/blackcore/afv/audio/receiversampleprovider.cpp index 83f68e842..b9f979e29 100644 --- a/src/blackcore/afv/audio/receiversampleprovider.cpp +++ b/src/blackcore/afv/audio/receiversampleprovider.cpp @@ -164,8 +164,8 @@ namespace BlackCore } const CSettings s = m_audioSettings.get(); - m_doClickWhenAppropriate = s.pttClickDown(); - m_doBlockWhenAppropriate = s.pttBlocked(); + m_doClickWhenAppropriate = s.afvClicked(); + m_doBlockWhenAppropriate = s.afvBlocked(); } void CReceiverSampleProvider::addSilentSamples(const IAudioDto &audioDto, uint frequency, float distanceRatio) diff --git a/src/blackgui/components/cockpitinfoareacomponent.cpp b/src/blackgui/components/cockpitinfoareacomponent.cpp index e1daa1092..5ed4717a1 100644 --- a/src/blackgui/components/cockpitinfoareacomponent.cpp +++ b/src/blackgui/components/cockpitinfoareacomponent.cpp @@ -35,7 +35,7 @@ namespace BlackGui QSize CCockpitInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const { - Q_UNUSED(areaIndex); + Q_UNUSED(areaIndex) return QSize(600, 400); } @@ -44,12 +44,9 @@ namespace BlackGui InfoArea area = static_cast(areaIndex); switch (area) { - case InfoAreaAudio: - return CIcons::appAudio16(); - case InfoAreaVoiceRooms: - return CIcons::appVoiceRooms16(); - default: - return CIcons::empty(); + case InfoAreaAudio: return CIcons::appAudio16(); + case InfoAreaVoiceRooms: return CIcons::appVoiceRooms16(); + default: return CIcons::empty(); } } diff --git a/src/blackmisc/audio/audiosettings.h b/src/blackmisc/audio/audiosettings.h index 69d7f6b98..0382c014a 100644 --- a/src/blackmisc/audio/audiosettings.h +++ b/src/blackmisc/audio/audiosettings.h @@ -62,9 +62,12 @@ namespace BlackMisc 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 pttClickDown() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyDown); } - bool pttClickUp() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyUp); } - bool pttBlocked() const { return this->isNotificationFlagSet(CNotificationSounds::PTTBlocked); } + bool pttClickDown() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyDown); } + bool pttClickUp() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyUp); } + bool pttBlocked() const { return this->isNotificationFlagSet(CNotificationSounds::PTTBlocked); } + + bool afvClicked() const { return this->isNotificationFlagSet(CNotificationSounds::AFVClicked); } + bool afvBlocked() const { return this->isNotificationFlagSet(CNotificationSounds::AFVBlocked); } //! @} //! Settings value diff --git a/src/blackmisc/audio/notificationsounds.cpp b/src/blackmisc/audio/notificationsounds.cpp index ae5c519bf..671ff47a1 100644 --- a/src/blackmisc/audio/notificationsounds.cpp +++ b/src/blackmisc/audio/notificationsounds.cpp @@ -33,6 +33,8 @@ namespace BlackMisc static const QString pttBlocked("PTT blocked"); static const QString load("load sounds"); static const QString noaudiotx("No audio tx"); + static const QString afvclick("AFC click"); + static const QString afvblock("AFV blocked"); switch (notification) { @@ -46,6 +48,8 @@ namespace BlackMisc case PTTClickKeyDown: return pttDown; case PTTClickKeyUp: return pttUp; case PTTBlocked: return pttBlocked; + case AFVClicked: return afvclick; + case AFVBlocked: return afvblock; default: break; } return unknown; @@ -64,6 +68,9 @@ namespace BlackMisc if (notification.testFlag(PTTClickKeyUp)) n << flagToString(PTTClickKeyUp); if (notification.testFlag(PTTClickKeyDown)) n << flagToString(PTTClickKeyDown); if (notification.testFlag(PTTBlocked)) n << flagToString(PTTBlocked); + + if (notification.testFlag(AFVClicked)) n << flagToString(AFVClicked); + if (notification.testFlag(AFVBlocked)) n << flagToString(AFVBlocked); return n.join(", "); } } // ns diff --git a/src/blackmisc/audio/notificationsounds.h b/src/blackmisc/audio/notificationsounds.h index 504cb844e..a0e63c97a 100644 --- a/src/blackmisc/audio/notificationsounds.h +++ b/src/blackmisc/audio/notificationsounds.h @@ -46,7 +46,9 @@ namespace BlackMisc NotificationNoAudioTransmission = 1 << 6, PTTClickKeyDown = 1 << 7, PTTClickKeyUp = 1 << 8, - PTTBlocked = 1 << 9 + PTTBlocked = 1 << 9, + AFVClicked = 1 << 14, + AFVBlocked = 1 << 15 }; Q_DECLARE_FLAGS(Notification, NotificationFlag) @@ -59,8 +61,11 @@ namespace BlackMisc //! All PTT notification flags constexpr static Notification AllPTTNotifications = Notification(PTTBlocked | PTTClickKeyUp | PTTClickKeyDown); + //! All AFV flags + constexpr static Notification AllAfv = Notification(AFVClicked | AFVBlocked); + //! All notification flags - constexpr static Notification AllNotifications = Notification(NotificationError | AllTextNotifications | AllLoginNotifications | AllPTTNotifications); + constexpr static Notification AllNotifications = Notification(NotificationError | AllTextNotifications | AllLoginNotifications | AllPTTNotifications | AllAfv); //! Default notification flags constexpr static Notification DefaultNotifications = Notification(AllNotifications);