[PTT] Make sure the "other" PTT keys light the LEDs and play notification

Remark: Eventually it would be best to really hook up with audio to
display the PTT key really consumed (instead directly consuming the action)
This commit is contained in:
Klaus Basan
2019-11-03 17:01:17 +01:00
committed by Mat Sutcliffe
parent 516a7063e5
commit 076813e866
3 changed files with 34 additions and 3 deletions

View File

@@ -82,6 +82,10 @@ namespace BlackGui
{
ui->led_Audio->setOn(!sGui->getCContextAudioBase()->isMuted());
connect(sGui->getCContextAudioBase(), &CContextAudioBase::changedMute, this, &CInfoBarStatusComponent::onMuteChanged);
// PTT as received on audio
// that also would need to be reconnected if audio is disabled/enabled
// connect(sGui->getCContextAudioBase(), &CContextAudioBase::ptt, this, &CInfoBarStatusComponent::onPttChanged, Qt::QueuedConnection);
}
QPointer<CInfoBarStatusComponent> myself(this);
@@ -262,6 +266,23 @@ namespace BlackGui
ui->led_Ptt->setOn(enabled);
}
void CInfoBarStatusComponent::onAudioPtt(bool active, PTTCOM pttcom, const CIdentifier &identifier)
{
// those here come directly from AUDIO client,
// we display COM1/2 directly, but COM is directly hooked up with onPttChanged
Q_UNUSED(identifier)
Q_UNUSED(active)
Q_UNUSED(pttcom)
/**
if (pttcom == COM1 || pttcom == COM2)
{
this->onPttChanged(active);
}
**/
}
void CInfoBarStatusComponent::onInternetAccessibleChanged(bool access)
{
if (access)

View File

@@ -13,6 +13,8 @@
#include "blackcore/actionbind.h"
#include "blackgui/blackguiexport.h"
#include "blackmisc/audio/ptt.h"
#include "blackmisc/input/actionhotkeydefs.h"
#include "blackmisc/network/connectionstatus.h"
@@ -59,7 +61,10 @@ namespace BlackGui
private:
QScopedPointer<Ui::CInfoBarStatusComponent> ui;
BlackCore::CActionBind m_actionPtt { BlackMisc::Input::pttHotkeyAction(), BlackMisc::Input::pttHotkeyIcon(), this, &CInfoBarStatusComponent::onPttChanged };
BlackCore::CActionBind m_actionPtt { BlackMisc::Input::pttHotkeyAction(), BlackMisc::Input::pttHotkeyIcon(), this, &CInfoBarStatusComponent::onPttChanged };
BlackCore::CActionBind m_actionPtt1 { BlackMisc::Input::pttCom1HotkeyAction(), BlackMisc::Input::pttHotkeyIcon(), this, &CInfoBarStatusComponent::onPttChanged };
BlackCore::CActionBind m_actionPtt2 { BlackMisc::Input::pttCom2HotkeyAction(), BlackMisc::Input::pttHotkeyIcon(), this, &CInfoBarStatusComponent::onPttChanged };
BlackMisc::CDigestSignal m_dsResize { this, &CInfoBarStatusComponent::adjustTextSize, 1000, 50 };
//! Init the LEDs
@@ -83,9 +88,12 @@ namespace BlackGui
//! Mapper is ready
void onMapperReady();
//! Ptt button changed
//! PTT button changed
void onPttChanged(bool enabled);
//! PTT, as received in in audio
void onAudioPtt(bool active, BlackMisc::Audio::PTTCOM pttcom, const BlackMisc::CIdentifier &identifier);
//! Internet accessible?
void onInternetAccessibleChanged(bool access);

View File

@@ -122,7 +122,9 @@ private:
QScopedPointer<BlackGui::Components::CAfvMapDialog> m_mapDialog; //!< map dialog
QScopedPointer<BlackGui::Components::CAircraftModelSetValidationDialog> m_validationDialog; //!< aircraft model validation dialog
BlackMisc::CData<BlackMisc::Simulation::Data::TLastAutoPublish> m_lastAutoPublish { this };
BlackCore::CActionBind m_actionPtt { BlackMisc::Input::pttHotkeyAction(), BlackMisc::CIcons::StandardIconRadio16, this, &SwiftGuiStd::onPttChanged };
BlackCore::CActionBind m_actionPtt { BlackMisc::Input::pttHotkeyAction(), BlackMisc::CIcons::StandardIconRadio16, this, &SwiftGuiStd::onPttChanged };
BlackCore::CActionBind m_actionPtt1 { BlackMisc::Input::pttCom1HotkeyAction(), BlackMisc::CIcons::StandardIconRadio16, this, &SwiftGuiStd::onPttChanged };
BlackCore::CActionBind m_actionPtt2 { BlackMisc::Input::pttCom2HotkeyAction(), BlackMisc::CIcons::StandardIconRadio16, this, &SwiftGuiStd::onPttChanged };
BlackCore::CActionBindings m_menuHotkeyHandlers;
BlackGui::CManagedStatusBar m_statusBar;
BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::displayStatusMessageInGui };