[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-multimedia
Subject:    Fwd: small kmix patch
From:       Florian Ehrenthal <dizzinger () gmx ! net>
Date:       2004-07-12 22:27:47
Message-ID: 200407130027.48022.dizzinger () gmx ! net
[Download RAW message or body]

Hi,

I don't know if this is the right list to post this to, but here we go :)

----------  Forwarded Message  ----------

Subject: small kmix patch
Date: Tuesday 06 July 2004 18:28
From: Florian Ehrenthal <dizzinger@gmx.net>
To: esken@kde.org

hi Christian,

attached is a little patch, that adds a toggleMute function to the dcop
interface of kmix. i've found this quite comfortable in combination with
khotkeys, to have a single button mute/unmute sound. well, one can do the
same without that patch, but you'll need to write/run a shellscript then from
within khotkeys.
hope to see this in kde 3.3

thanks
Florian Ehrenthal

-------------------------------------------------------

["kmix.patch" (text/x-diff)]

Index: mixer.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/kmix/mixer.cpp,v
retrieving revision 1.77
diff -u -r1.77 mixer.cpp
--- mixer.cpp	27 Jun 2004 13:38:30 -0000	1.77
+++ mixer.cpp	6 Jul 2004 16:14:40 -0000
@@ -465,6 +465,18 @@
   writeVolumeToHW(deviceidx, mixdev->getVolume() );
 }
 
+void Mixer::toggleMute( int deviceidx )
+{
+  MixDevice *mixdev= mixDeviceByType( deviceidx );
+  if (!mixdev) return;
+
+  bool previousState= mixdev->isMuted();
+  
+  mixdev->setMuted( !previousState );
+
+  writeVolumeToHW(deviceidx, mixdev->getVolume() );
+}
+
 bool Mixer::mute( int deviceidx )
 {
   MixDevice *mixdev= mixDeviceByType( deviceidx );
Index: mixer.h
===================================================================
RCS file: /home/kde/kdemultimedia/kmix/mixer.h,v
retrieving revision 1.49
diff -u -r1.49 mixer.h
--- mixer.h	16 Jun 2004 13:09:28 -0000	1.49
+++ mixer.h	6 Jul 2004 16:14:40 -0000
@@ -121,6 +121,7 @@
       virtual int masterVolume();
 
       virtual void setMute( int channeltype, bool on );
+      virtual void toggleMute( int channeltype );
       virtual bool mute( int channeltype );
       virtual bool isRecordSource( int deviceidx );
 
Index: mixerIface.h
===================================================================
RCS file: /home/kde/kdemultimedia/kmix/mixerIface.h,v
retrieving revision 1.2
diff -u -r1.2 mixerIface.h
--- mixerIface.h	17 Oct 2002 15:52:27 -0000	1.2
+++ mixerIface.h	6 Jul 2004 16:14:40 -0000
@@ -41,6 +41,12 @@
     Mutes or unmutes the specified device.
     */
    virtual void setMute( int deviceidx, bool on )=0;
+
+   /**
+    Toggles mute-state for the given device.
+    */
+   virtual void toggleMute( int deviceidx )=0;
+
    /**
     Returns if the given device is muted or not. If the device is not
     available in this mixer, it is reported as muted.


_______________________________________________
kde-multimedia mailing list
kde-multimedia@kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic