mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-06 10:26:03 +08:00
Fixed mute handling and audio LED
* AFV client has own "changedMute" signal * unmute if started/stopped AFC client * in statusbar also check audio start/stop to refresh LEDs * see https://discordapp.com/channels/539048679160676382/539486309882789888/713491666971000872
This commit is contained in:
committed by
Mat Sutcliffe
parent
24bc57ac32
commit
6fc3d55d9a
@@ -273,7 +273,10 @@ namespace BlackCore
|
||||
|
||||
void CAfvClient::setMuted(bool mute)
|
||||
{
|
||||
if (this->isMuted() == mute) { return; }
|
||||
this->setNormalizedOutputVolume(mute ? 0 : 50);
|
||||
|
||||
emit this->changedMute(mute);
|
||||
}
|
||||
|
||||
void CAfvClient::startAudio()
|
||||
@@ -352,6 +355,13 @@ namespace BlackCore
|
||||
this->onTimerUpdate(); // update values
|
||||
|
||||
emit this->startedAudio(useInputDevice, useOutputDevice);
|
||||
|
||||
if (this->isMuted())
|
||||
{
|
||||
// un-mute after startup
|
||||
this->setMuted(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CAfvClient::startAudio(const QString &inputDeviceName, const QString &outputDeviceName)
|
||||
@@ -388,6 +398,8 @@ namespace BlackCore
|
||||
}
|
||||
CLogMessage(this).info(u"AFV Client stopped");
|
||||
|
||||
if (this->isMuted()) { this->setMuted(false); }
|
||||
|
||||
emit this->inputVolumePeakVU(0.0);
|
||||
emit this->outputVolumePeakVU(0.0);
|
||||
emit this->stoppedAudio();
|
||||
|
||||
@@ -313,6 +313,9 @@ namespace BlackCore
|
||||
//! Audio has been stopped
|
||||
void stoppedAudio();
|
||||
|
||||
//! Mute changed
|
||||
void changedMute(bool muted);
|
||||
|
||||
protected:
|
||||
//! \copydoc BlackMisc::CContinuousWorker::initialize
|
||||
virtual void initialize() override;
|
||||
|
||||
Reference in New Issue
Block a user