]> git.alsa-project.org Git - alsa-tools.git/commitdiff
envy24control save state of LRGang button in config file
authorTakashi Iwai <tiwai@suse.de>
Thu, 4 Aug 2005 16:01:10 +0000 (16:01 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 4 Aug 2005 16:01:10 +0000 (16:01 +0000)
From: Dirk Jagdmann <doj@cubic.org>

The last mail I sent for this topic contained a non functional patch,
which has not been included in CVS yet.
I resend the patch, which should now work.

envy24control/Makefile.am
envy24control/envy24control.c
envy24control/mixer.c

index 9e0364873e3dffb6bfcb3f6a942bb4d26adac4a8..38e1b3d6d783e048edbd658fa1bb6e7234f2b7f3 100644 (file)
@@ -3,7 +3,7 @@ bin_PROGRAMS = envy24control
 man_MANS = envy24control.1
 envy24control_SOURCES = envy24control.c envy24control.h levelmeters.c midi.c \
                         mixer.c patchbay.c hardware.c driverevents.c volume.c \
-                       profiles.c profiles.h midi.h
+                       profiles.c profiles.h midi.h config.c config.h
 envy24control_LDFLAGS = @ENVY24CONTROL_LIBS@
 EXTRA_DIST = envy24control.1 depcomp configure.in-gtk2 \
             strstr_icase_blank.c new_process.c README.profiles
index cf30e08ac6132cda51a1221e171a10bef6e1c7a5..1aaf982e0a045d40aac84cf74b93bccf62045e4d 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "envy24control.h"
 #include "midi.h"
+#include "config.h"
 #define _GNU_SOURCE
 #include <getopt.h>
 
@@ -244,7 +245,9 @@ static void create_mixer_frame(GtkWidget *box, int stream)
        gtk_widget_show(toggle);
        gtk_box_pack_end(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
        /* gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), TRUE); */
-       
+       gtk_signal_connect(GTK_OBJECT(toggle), "toggled",
+                          GTK_SIGNAL_FUNC(config_set_stereo), (gpointer)stream-1);
+
        hbox = gtk_hbox_new(TRUE, 6);
        gtk_widget_show(hbox);
        gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
@@ -2118,6 +2121,7 @@ int main(int argc, char **argv)
        }
 
        /* Initialize code */
+       config_open();
        level_meters_init();
        mixer_init();
        patchbay_init();
@@ -2187,6 +2191,7 @@ int main(int argc, char **argv)
 
        snd_ctl_close(ctl);
        midi_close();
+       config_close();
 
        return EXIT_SUCCESS;
 }
index 48c33a979bf66b7d1e6585486a7e957899b78eaf..7de04868143781ce82ae1c50d7af5cf54458160c 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "envy24control.h"
 #include "midi.h"
+#include "config.h"
 
 #define        MULTI_PLAYBACK_SWITCH           "Multi Playback Switch"
 #define MULTI_PLAYBACK_VOLUME          "Multi Playback Volume"
@@ -268,4 +269,6 @@ void mixer_postinit(void)
                if (stream_is_active[stream - 1])
                        mixer_update_stream(stream, 1, 1);
        }
+
+       config_restore_stereo();
 }