diff --git a/src/blackcore/afv/clients/afvclient.cpp b/src/blackcore/afv/clients/afvclient.cpp index 4657be37e..8bc8fdffd 100644 --- a/src/blackcore/afv/clients/afvclient.cpp +++ b/src/blackcore/afv/clients/afvclient.cpp @@ -160,12 +160,12 @@ namespace BlackCore bool CAfvClient::isMuted() const { - return !this->isStarted(); + return this->getNormalizedOutputVolume() < 1; } void CAfvClient::setMuted(bool mute) { - Q_UNUSED(mute) + this->setNormalizedOutputVolume(mute ? 0 : 50); } bool CAfvClient::restartWithNewDevices(const CAudioDeviceInfo &inputDevice, const CAudioDeviceInfo &outputDevice) @@ -480,7 +480,7 @@ namespace BlackCore void CAfvClient::setInputVolumeDb(double valueDb) { if (valueDb > MaxDbIn) { valueDb = MaxDbIn; } - if (valueDb < MinDbIn) { valueDb = MinDbIn; } + else if (valueDb < MinDbIn) { valueDb = MinDbIn; } QMutexLocker lock(&m_mutex); m_inputVolumeDb = valueDb; diff --git a/src/blackcore/context/contextaudio.cpp b/src/blackcore/context/contextaudio.cpp index 2fc235902..e1d959898 100644 --- a/src/blackcore/context/contextaudio.cpp +++ b/src/blackcore/context/contextaudio.cpp @@ -229,8 +229,14 @@ namespace BlackCore if (!m_voiceClient) { return; } if (this->isMuted() == muted) { return; } // avoid roundtrips / unnecessary signals - if (m_voiceClient->isMuted() == muted) { return; } + if (muted) + { + const int nv = m_voiceClient->getNormalizedOutputVolume(); + m_outVolumeBeforeMute = nv; + } + m_voiceClient->setMuted(muted); + if (!muted) { m_voiceClient->setNormalizedOutputVolume(m_outVolumeBeforeMute); } // signal emit this->changedMute(muted);