mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 01:35:45 +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_DBus->setOn(sGui->getIContextApplication()->isUsingImplementingObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->led_Audio->setOn(CInfoBarStatusComponent::isAudioAvailableAndNotMuted());
|
||||||
if (sGui->getCContextAudioBase())
|
if (sGui->getCContextAudioBase())
|
||||||
{
|
{
|
||||||
ui->led_Audio->setOn(!sGui->getCContextAudioBase()->isMuted());
|
|
||||||
connect(sGui->getCContextAudioBase(), &CContextAudioBase::changedMute, this, &CInfoBarStatusComponent::onMuteChanged);
|
connect(sGui->getCContextAudioBase(), &CContextAudioBase::changedMute, this, &CInfoBarStatusComponent::onMuteChanged);
|
||||||
|
|
||||||
// PTT as received on audio
|
// PTT as received on audio
|
||||||
@@ -228,6 +228,7 @@ namespace BlackGui
|
|||||||
const QList<QAction *> actions = menuAudio.actions();
|
const QList<QAction *> actions = menuAudio.actions();
|
||||||
if (selectedItem == actions.at(0))
|
if (selectedItem == actions.at(0))
|
||||||
{
|
{
|
||||||
|
// toggle MUTED
|
||||||
sGui->getCContextAudioBase()->setMute(!sGui->getCContextAudioBase()->isMuted());
|
sGui->getCContextAudioBase()->setMute(!sGui->getCContextAudioBase()->isMuted());
|
||||||
}
|
}
|
||||||
else if (actions.size() > 1 && selectedItem == actions.at(1))
|
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
|
// audio context can be empty depending on which side it is called
|
||||||
if (sGui->getCContextAudioBase())
|
ui->led_Audio->setOn(CInfoBarStatusComponent::isAudioAvailableAndNotMuted());
|
||||||
{
|
|
||||||
ui->led_Audio->setOn(!sGui->getCContextAudioBase()->isMuted());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->led_Audio->setOn(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoBarStatusComponent::updateSpacing()
|
void CInfoBarStatusComponent::updateSpacing()
|
||||||
@@ -340,5 +334,12 @@ namespace BlackGui
|
|||||||
const int s = (w >= 400) ? 6 : 2;
|
const int s = (w >= 400) ? 6 : 2;
|
||||||
this->setSpacing(s);
|
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
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ namespace BlackGui
|
|||||||
|
|
||||||
BlackMisc::CDigestSignal m_dsResize { this, &CInfoBarStatusComponent::adjustTextSize, 1000, 50 };
|
BlackMisc::CDigestSignal m_dsResize { this, &CInfoBarStatusComponent::adjustTextSize, 1000, 50 };
|
||||||
|
|
||||||
|
//! Audio available and NOT muted
|
||||||
|
static bool isAudioAvailableAndNotMuted();
|
||||||
|
|
||||||
//! Init the LEDs
|
//! Init the LEDs
|
||||||
void initLeds();
|
void initLeds();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user