[AFV] Ref T730, changed/added settings for AFV and allow still to use old swift notifications

This commit is contained in:
Klaus Basan
2019-10-17 18:13:57 +02:00
parent 3a469d4654
commit 7fdc2c3db3
5 changed files with 26 additions and 14 deletions

View File

@@ -164,8 +164,8 @@ namespace BlackCore
} }
const CSettings s = m_audioSettings.get(); const CSettings s = m_audioSettings.get();
m_doClickWhenAppropriate = s.pttClickDown(); m_doClickWhenAppropriate = s.afvClicked();
m_doBlockWhenAppropriate = s.pttBlocked(); m_doBlockWhenAppropriate = s.afvBlocked();
} }
void CReceiverSampleProvider::addSilentSamples(const IAudioDto &audioDto, uint frequency, float distanceRatio) void CReceiverSampleProvider::addSilentSamples(const IAudioDto &audioDto, uint frequency, float distanceRatio)

View File

@@ -35,7 +35,7 @@ namespace BlackGui
QSize CCockpitInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const QSize CCockpitInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
{ {
Q_UNUSED(areaIndex); Q_UNUSED(areaIndex)
return QSize(600, 400); return QSize(600, 400);
} }
@@ -44,12 +44,9 @@ namespace BlackGui
InfoArea area = static_cast<InfoArea>(areaIndex); InfoArea area = static_cast<InfoArea>(areaIndex);
switch (area) switch (area)
{ {
case InfoAreaAudio: case InfoAreaAudio: return CIcons::appAudio16();
return CIcons::appAudio16(); case InfoAreaVoiceRooms: return CIcons::appVoiceRooms16();
case InfoAreaVoiceRooms: default: return CIcons::empty();
return CIcons::appVoiceRooms16();
default:
return CIcons::empty();
} }
} }

View File

@@ -62,9 +62,12 @@ namespace BlackMisc
bool textMessageSupervisor() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextMessageSupervisor); } bool textMessageSupervisor() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextMessageSupervisor); }
bool textCallsignMentioned() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextCallsignMentioned); } bool textCallsignMentioned() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextCallsignMentioned); }
bool noAudioTransmission() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationNoAudioTransmission); } bool noAudioTransmission() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationNoAudioTransmission); }
bool pttClickDown() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyDown); } bool pttClickDown() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyDown); }
bool pttClickUp() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyUp); } bool pttClickUp() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyUp); }
bool pttBlocked() const { return this->isNotificationFlagSet(CNotificationSounds::PTTBlocked); } 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 //! Settings value

View File

@@ -33,6 +33,8 @@ namespace BlackMisc
static const QString pttBlocked("PTT blocked"); static const QString pttBlocked("PTT blocked");
static const QString load("load sounds"); static const QString load("load sounds");
static const QString noaudiotx("No audio tx"); static const QString noaudiotx("No audio tx");
static const QString afvclick("AFC click");
static const QString afvblock("AFV blocked");
switch (notification) switch (notification)
{ {
@@ -46,6 +48,8 @@ namespace BlackMisc
case PTTClickKeyDown: return pttDown; case PTTClickKeyDown: return pttDown;
case PTTClickKeyUp: return pttUp; case PTTClickKeyUp: return pttUp;
case PTTBlocked: return pttBlocked; case PTTBlocked: return pttBlocked;
case AFVClicked: return afvclick;
case AFVBlocked: return afvblock;
default: break; default: break;
} }
return unknown; return unknown;
@@ -64,6 +68,9 @@ namespace BlackMisc
if (notification.testFlag(PTTClickKeyUp)) n << flagToString(PTTClickKeyUp); if (notification.testFlag(PTTClickKeyUp)) n << flagToString(PTTClickKeyUp);
if (notification.testFlag(PTTClickKeyDown)) n << flagToString(PTTClickKeyDown); if (notification.testFlag(PTTClickKeyDown)) n << flagToString(PTTClickKeyDown);
if (notification.testFlag(PTTBlocked)) n << flagToString(PTTBlocked); if (notification.testFlag(PTTBlocked)) n << flagToString(PTTBlocked);
if (notification.testFlag(AFVClicked)) n << flagToString(AFVClicked);
if (notification.testFlag(AFVBlocked)) n << flagToString(AFVBlocked);
return n.join(", "); return n.join(", ");
} }
} // ns } // ns

View File

@@ -46,7 +46,9 @@ namespace BlackMisc
NotificationNoAudioTransmission = 1 << 6, NotificationNoAudioTransmission = 1 << 6,
PTTClickKeyDown = 1 << 7, PTTClickKeyDown = 1 << 7,
PTTClickKeyUp = 1 << 8, PTTClickKeyUp = 1 << 8,
PTTBlocked = 1 << 9 PTTBlocked = 1 << 9,
AFVClicked = 1 << 14,
AFVBlocked = 1 << 15
}; };
Q_DECLARE_FLAGS(Notification, NotificationFlag) Q_DECLARE_FLAGS(Notification, NotificationFlag)
@@ -59,8 +61,11 @@ namespace BlackMisc
//! All PTT notification flags //! All PTT notification flags
constexpr static Notification AllPTTNotifications = Notification(PTTBlocked | PTTClickKeyUp | PTTClickKeyDown); constexpr static Notification AllPTTNotifications = Notification(PTTBlocked | PTTClickKeyUp | PTTClickKeyDown);
//! All AFV flags
constexpr static Notification AllAfv = Notification(AFVClicked | AFVBlocked);
//! All notification flags //! 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 //! Default notification flags
constexpr static Notification DefaultNotifications = Notification(AllNotifications); constexpr static Notification DefaultNotifications = Notification(AllNotifications);