From bc9049aa6f9297a4927ec6e5720bd38276660309 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 21 May 2020 00:53:32 +0900 Subject: KMix: fixed setMute() function on PulseAudio mixer. Signed-off-by: Michele Calgaro --- kmix/mixer.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/kmix/mixer.cpp b/kmix/mixer.cpp index 0cc4fbcf..d8e93fc4 100644 --- a/kmix/mixer.cpp +++ b/kmix/mixer.cpp @@ -684,22 +684,25 @@ void Mixer::decreaseVolume(int deviceidx, int percentage) } // @dcop -void Mixer::setMute( int deviceidx, bool on ) +void Mixer::setMute(int deviceidx, bool on) { - MixDevice *mixdev= mixDeviceByType( deviceidx ); - if (!mixdev) return; - - mixdev->setMuted( on ); + MixDevice *mixdev= mixDeviceByType(deviceidx); + if (!mixdev) + { + return; + } - _mixerBackend->writeVolumeToHW(deviceidx, mixdev->getVolume() ); + mixdev->setMuted(on); + commitVolumeChange(mixdev); } // @dcop only -void Mixer::setMasterMute( bool on ) +void Mixer::setMasterMute(bool on) { - MixDevice *master = masterDevice(); - if (master != 0 ) { - setMute( master->num(), on ); + MixDevice *md = masterDevice(); + if (md) + { + setMute(md->num(), on); } } @@ -757,10 +760,10 @@ bool Mixer::isRecordSource( int deviceidx ) return mixdev->isRecSource(); } -/// @DCOP WHAT DOES THIS METHOD?!?!? +// @dcop bool Mixer::isAvailableDevice( int deviceidx ) { - return mixDeviceByType( deviceidx ); + return (mixDeviceByType(deviceidx) != NULL); } #include "mixer.moc" -- cgit v1.2.1