Add login/logoff notification sound option

Fixes #156
This commit is contained in:
Lars Toenning
2023-11-07 22:05:35 +01:00
parent e1cf40463f
commit ee33a75ba0
5 changed files with 34 additions and 3 deletions

View File

@@ -530,7 +530,7 @@ void SwiftGuiStd::checkDbDataLoaded()
void SwiftGuiStd::playNotifcationSound(CNotificationSounds::NotificationFlag notification) const
{
if (!m_contextAudioAvailable) { return; }
if (!ui->comp_MainInfoArea->getSettingsComponent()->playNotificationSounds()) { return; }
if (!m_audioSettings.get().isNotificationFlagSet(notification)) { return; }
if (!sGui || sGui->isShuttingDown()) { return; }
sGui->getCContextAudioBase()->playNotification(notification, true);
}

View File

@@ -24,6 +24,7 @@
#include "blackmisc/simulation/simulatedaircraft.h"
#include "blackmisc/simulation/autopublishdata.h"
#include "blackmisc/audio/notificationsounds.h"
#include "blackmisc/audio/audiosettings.h"
#include "blackmisc/input/actionhotkeydefs.h"
#include "blackmisc/identifiable.h"
#include "blackmisc/variant.h"
@@ -137,6 +138,7 @@ private:
BlackGui::CManagedStatusBar m_statusBar;
BlackMisc::CLogHistoryReplica m_logHistoryForStatus { this };
BlackMisc::CLogHistoryReplica m_logHistoryForOverlay { this };
BlackMisc::CSetting<BlackMisc::Audio::TSettings> m_audioSettings { this };
// contexts
static constexpr int MaxCoreFailures = 5; //!< Failures counted before reconnecting