File kdemultimedia-trinity-fix-setmute.patch of Package kdemultimedia3

From bc9049aa6f9297a4927ec6e5720bd38276660309 Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Thu, 21 May 2020 00:53:32 +0900
Subject: KMix: fixed setMute() function on PulseAudio mixer.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 kmix/mixer.cpp | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/kmix/mixer.cpp b/kmix/mixer.cpp
index 0cc4fbc..d8e93fc 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

openSUSE Build Service is sponsored by