mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #372 Add context method to set the voice output volume
This commit is contained in:
committed by
Klaus Basan
parent
84ac5e9972
commit
984c0d084f
@@ -149,6 +149,9 @@ namespace BlackCore
|
||||
//! Set the volumes (0..100)
|
||||
virtual void setVolumes(int volumeCom1, int volumeCom2) = 0;
|
||||
|
||||
//! Set voice output volume (0..300)
|
||||
virtual void setVoiceOutputVolume(int volume) = 0;
|
||||
|
||||
//! Set mute state
|
||||
virtual void setMute(bool mute) = 0;
|
||||
|
||||
|
||||
@@ -242,6 +242,12 @@ namespace BlackCore
|
||||
emit changedAudioVolumes(com1Volume, com2Volume);
|
||||
}
|
||||
|
||||
void CContextAudio::setVoiceOutputVolume(int volume)
|
||||
{
|
||||
m_outDeviceVolume = volume;
|
||||
if (!isMuted()) m_voiceOutputDevice->setOutputVolume(m_outDeviceVolume);
|
||||
}
|
||||
|
||||
void CContextAudio::setMute(bool muted)
|
||||
{
|
||||
if (this->isMuted() == muted) { return; } // avoid roundtrips / unnecessary signals
|
||||
|
||||
@@ -84,6 +84,9 @@ namespace BlackCore
|
||||
//!\copydoc IContext::setVolumes
|
||||
virtual void setVolumes(int com1Volume, int com2Volume) override;
|
||||
|
||||
//!\copydoc IContext::setVoiceOutputVolume
|
||||
virtual void setVoiceOutputVolume(int volume) override;
|
||||
|
||||
//! \copydoc ICOntext::setMute
|
||||
virtual void setMute(bool muted) override;
|
||||
|
||||
|
||||
@@ -197,6 +197,11 @@ namespace BlackCore
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("setVolumes"), com1Volume, com2Volume);
|
||||
}
|
||||
|
||||
void CContextAudioProxy::setVoiceOutputVolume(int volume)
|
||||
{
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("setVoiceOutputVolume"), volume);
|
||||
}
|
||||
|
||||
/*
|
||||
* Toggle mute
|
||||
*/
|
||||
|
||||
@@ -87,6 +87,9 @@ namespace BlackCore
|
||||
//!\copydoc IContextAudio::setVolumes
|
||||
virtual void setVolumes(int com1Volume, int com2Volume) override;
|
||||
|
||||
//!\copydoc IContext::setVoiceOutputVolume
|
||||
virtual void setVoiceOutputVolume(int volume) override;
|
||||
|
||||
//! \copydoc IContextAudio::setMute
|
||||
virtual void setMute(bool muted) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user