mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
[AFV] Do not show audio LED on if audio is disabled
This commit is contained in:
@@ -78,9 +78,9 @@ namespace BlackGui
|
||||
ui->led_DBus->setOn(sGui->getIContextApplication()->isUsingImplementingObject());
|
||||
}
|
||||
|
||||
ui->led_Audio->setOn(CInfoBarStatusComponent::isAudioAvailableAndNotMuted());
|
||||
if (sGui->getCContextAudioBase())
|
||||
{
|
||||
ui->led_Audio->setOn(!sGui->getCContextAudioBase()->isMuted());
|
||||
connect(sGui->getCContextAudioBase(), &CContextAudioBase::changedMute, this, &CInfoBarStatusComponent::onMuteChanged);
|
||||
|
||||
// PTT as received on audio
|
||||
@@ -228,6 +228,7 @@ namespace BlackGui
|
||||
const QList<QAction *> actions = menuAudio.actions();
|
||||
if (selectedItem == actions.at(0))
|
||||
{
|
||||
// toggle MUTED
|
||||
sGui->getCContextAudioBase()->setMute(!sGui->getCContextAudioBase()->isMuted());
|
||||
}
|
||||
else if (actions.size() > 1 && selectedItem == actions.at(1))
|
||||
@@ -323,14 +324,7 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
// audio context can be empty depending on which side it is called
|
||||
if (sGui->getCContextAudioBase())
|
||||
{
|
||||
ui->led_Audio->setOn(!sGui->getCContextAudioBase()->isMuted());
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->led_Audio->setOn(false);
|
||||
}
|
||||
ui->led_Audio->setOn(CInfoBarStatusComponent::isAudioAvailableAndNotMuted());
|
||||
}
|
||||
|
||||
void CInfoBarStatusComponent::updateSpacing()
|
||||
@@ -340,5 +334,12 @@ namespace BlackGui
|
||||
const int s = (w >= 400) ? 6 : 2;
|
||||
this->setSpacing(s);
|
||||
}
|
||||
|
||||
bool CInfoBarStatusComponent::isAudioAvailableAndNotMuted()
|
||||
{
|
||||
if (!sGui || !sGui->getCContextAudioBase() || sGui->isShuttingDown()) { return false; }
|
||||
if (!sGui->getCContextAudioBase()->isAudioStarted()) { return false; }
|
||||
return !sGui->getCContextAudioBase()->isMuted();
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -67,6 +67,9 @@ namespace BlackGui
|
||||
|
||||
BlackMisc::CDigestSignal m_dsResize { this, &CInfoBarStatusComponent::adjustTextSize, 1000, 50 };
|
||||
|
||||
//! Audio available and NOT muted
|
||||
static bool isAudioAvailableAndNotMuted();
|
||||
|
||||
//! Init the LEDs
|
||||
void initLeds();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user