mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 20:25:34 +08:00
Ref T730, Ref T739, first implementation of "Mute" for CAfvClient
This commit is contained in:
committed by
Mat Sutcliffe
parent
b632232566
commit
11a3fa873d
@@ -160,12 +160,12 @@ namespace BlackCore
|
|||||||
|
|
||||||
bool CAfvClient::isMuted() const
|
bool CAfvClient::isMuted() const
|
||||||
{
|
{
|
||||||
return !this->isStarted();
|
return this->getNormalizedOutputVolume() < 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAfvClient::setMuted(bool mute)
|
void CAfvClient::setMuted(bool mute)
|
||||||
{
|
{
|
||||||
Q_UNUSED(mute)
|
this->setNormalizedOutputVolume(mute ? 0 : 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAfvClient::restartWithNewDevices(const CAudioDeviceInfo &inputDevice, const CAudioDeviceInfo &outputDevice)
|
bool CAfvClient::restartWithNewDevices(const CAudioDeviceInfo &inputDevice, const CAudioDeviceInfo &outputDevice)
|
||||||
@@ -480,7 +480,7 @@ namespace BlackCore
|
|||||||
void CAfvClient::setInputVolumeDb(double valueDb)
|
void CAfvClient::setInputVolumeDb(double valueDb)
|
||||||
{
|
{
|
||||||
if (valueDb > MaxDbIn) { valueDb = MaxDbIn; }
|
if (valueDb > MaxDbIn) { valueDb = MaxDbIn; }
|
||||||
if (valueDb < MinDbIn) { valueDb = MinDbIn; }
|
else if (valueDb < MinDbIn) { valueDb = MinDbIn; }
|
||||||
|
|
||||||
QMutexLocker lock(&m_mutex);
|
QMutexLocker lock(&m_mutex);
|
||||||
m_inputVolumeDb = valueDb;
|
m_inputVolumeDb = valueDb;
|
||||||
|
|||||||
@@ -229,8 +229,14 @@ namespace BlackCore
|
|||||||
if (!m_voiceClient) { return; }
|
if (!m_voiceClient) { return; }
|
||||||
if (this->isMuted() == muted) { return; } // avoid roundtrips / unnecessary signals
|
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);
|
m_voiceClient->setMuted(muted);
|
||||||
|
if (!muted) { m_voiceClient->setNormalizedOutputVolume(m_outVolumeBeforeMute); }
|
||||||
|
|
||||||
// signal
|
// signal
|
||||||
emit this->changedMute(muted);
|
emit this->changedMute(muted);
|
||||||
|
|||||||
Reference in New Issue
Block a user