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:
Klaus Basan
2020-05-23 01:18:59 +02:00
committed by Mat Sutcliffe
parent 24bc57ac32
commit 6fc3d55d9a
5 changed files with 56 additions and 17 deletions

View File

@@ -207,6 +207,7 @@ namespace BlackCore
connect(m_voiceClient, &CAfvClient::startedAudio, this, &CContextAudioBase::startedAudio, Qt::QueuedConnection);
connect(m_voiceClient, &CAfvClient::stoppedAudio, this, &CContextAudioBase::stoppedAudio, Qt::QueuedConnection);
connect(m_voiceClient, &CAfvClient::ptt, this, &CContextAudioBase::ptt, Qt::QueuedConnection);
connect(m_voiceClient, &CAfvClient::changedMute, this, &CContextAudioBase::changedMute, Qt::QueuedConnection);
connect(m_voiceClient, &CAfvClient::connectionStatusChanged, this, &CContextAudioBase::onAfvConnectionStatusChanged, Qt::QueuedConnection);
connect(m_voiceClient, &CAfvClient::afvConnectionFailure, this, &CContextAudioBase::onAfvConnectionFailure, Qt::QueuedConnection);
}
@@ -429,6 +430,7 @@ namespace BlackCore
const bool changedVoiceOutput = (currentVolume != volume);
if (changedVoiceOutput)
{
// TODO: KB 2020-05 the mute handling should entirely go to AFV client!
m_voiceClient->setNormalizedOutputVolume(volume);
m_outVolumeBeforeMute = volume;
@@ -468,8 +470,8 @@ namespace BlackCore
m_voiceClient->setMuted(muted);
if (!muted) { m_voiceClient->setNormalizedOutputVolume(m_outVolumeBeforeMute); }
// signal
emit this->changedMute(muted);
// signal no longer need, signaled by m_voiceClient->setMuted
// emit this->changedMute(muted);
}
bool CContextAudioBase::isMuted() const
@@ -503,13 +505,13 @@ namespace BlackCore
if (!play) { return; }
if (notification == CNotificationSounds::PTTClickKeyDown && (considerSettings && settings.noAudioTransmission()))
{
/**
/*
if (!this->canTalk())
{
// warning sound
notification = CNotificationSounds::NotificationNoAudioTransmission;
}
**/
*/
}
if (volume < 0 || volume > 100)