]> git.alsa-project.org Git - alsa-tools.git/commitdiff
envy24control midi bugfix
authorJaroslav Kysela <perex@perex.cz>
Wed, 27 Jul 2005 06:47:08 +0000 (06:47 +0000)
committerJaroslav Kysela <perex@perex.cz>
Wed, 27 Jul 2005 06:47:08 +0000 (06:47 +0000)
From: Dirk Jagdmann <doj@cubic.org>
this patch is a bugfix for the midi patch I posted yesterday. This patch
fixes the "mute" button when driven via midi and the "LR Gang" button is
set.

envy24control/mixer.c

index 7951be0ff38fc6c38e97a5dc628d06250ee7d713..48c33a979bf66b7d1e6585486a7e957899b78eaf 100644 (file)
@@ -133,10 +133,15 @@ void mixer_toggled_mute(GtkWidget *togglebutton, gpointer data)
 
 void mixer_set_mute(int stream, int left, int right)
 {
-       if (left >= 0)
+       int stereo = is_active(mixer_stereo_toggle[stream-1]) ? 1 : 0;
+       if (left >= 0 || stereo) {
                toggle_set(mixer_mute_toggle[stream-1][0], left ? TRUE : FALSE);
-       if (right >= 0)
+               if(stereo && left<0) left=right;
+       }
+       if (right >= 0 || stereo) {
                toggle_set(mixer_mute_toggle[stream-1][1], right ? TRUE : FALSE);
+               if(stereo && right<0) right=left;
+       }
        set_switch1(stream, left, right);
 }