[PATCH] set delay buttons to correct state

[email protected]
Newsgroups gmane.comp.audio.jamin.devel
Message-ID <56044.82.243.233.218.1193967749.squirrel@www.creatis.insa-lyon.fr>
Hi,

this is my first ever patch (remarks are welcomed). It adds the callbacks
to correctly display the band delay buttons state (on/off) when loading a
session.

the current CVS version actually saves and restores the delay values and
states, but they were not properly displayed.

the patch also removes duplicate functions definitions in callbacks.h:
on_low_bypass_toggled()
on_mid_bypass_toggled()
n_high_bypass_toggled()

Sebastien

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________
Jamin-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jamin-devel
set_delay_buttons_state.patch (text/x-patch, 3.8 KB)
? set_delay_buttons_state.patch
? po/stamp-it
? src/src-diff-2007-11-02-02-11-25.patch
Index: src/callbacks.c
===================================================================
RCS file: /cvsroot/jamin/jamin/src/callbacks.c,v
retrieving revision 1.176
diff -u -r1.176 callbacks.c
--- src/callbacks.c	1 Jul 2007 15:33:18 -0000	1.176
+++ src/callbacks.c	2 Nov 2007 01:39:43 -0000
@@ -60,7 +60,8 @@
 static char             *help_ptr = NULL, scene_name_text[100];
 static gboolean         text_focus = FALSE, force_keypress_help = FALSE;
 static GtkToggleButton  *l_solo_button[XO_NBANDS], *l_bypass_button[XO_NBANDS], 
-                        *l_global_bypass, *l_eq_bypass, *l_limiter_bypass;
+                        *l_global_bypass, *l_eq_bypass, *l_limiter_bypass,
+                        *l_low_delay,*l_mid_delay;
 static GtkLabel         *l_eqbFreqLabel, *l_eqbAmpLabel;
 GtkEventBox             *l_global_bypass_event_box, *l_comp_bypass_event_box[XO_NBANDS],
                         *l_eq_bypass_event_box, *l_limiter_bypass_event_box;
@@ -220,6 +221,9 @@
   main_style = gtk_widget_get_style (GTK_WIDGET (l_global_bypass_event_box));
   l_main_color = main_style->bg[GTK_STATE_NORMAL];
 
+  l_low_delay = GTK_TOGGLE_BUTTON (lookup_widget (main_window, "LowDelayButton"));
+  l_mid_delay = GTK_TOGGLE_BUTTON (lookup_widget (main_window, "MidDelayButton"));
+
 
   scene_name_dialog = create_scene_name_dialog ();
 
@@ -2304,6 +2308,20 @@
 }
 
 
+void 
+callbacks_set_low_delay_button_state (int state)
+{
+  gtk_toggle_button_set_active (l_low_delay, state);
+}
+
+
+void 
+callbacks_set_mid_delay_button_state (int state)
+{
+  gtk_toggle_button_set_active (l_mid_delay, state);
+}
+
+
 gboolean
 on_eq_bypass_event_box_enter_notify_event
                                         (GtkWidget       *widget,
Index: src/callbacks.h
===================================================================
RCS file: /cvsroot/jamin/jamin/src/callbacks.h,v
retrieving revision 1.89
diff -u -r1.89 callbacks.h
--- src/callbacks.h	1 Jul 2007 15:33:18 -0000	1.89
+++ src/callbacks.h	2 Nov 2007 01:39:44 -0000
@@ -1025,18 +1025,6 @@
                                         gpointer         user_data);
 
 void
-on_low_bypass_toggled                  (GtkToggleButton *togglebutton,
-                                        gpointer         user_data);
-
-void
-on_mid_bypass_toggled                  (GtkToggleButton *togglebutton,
-                                        gpointer         user_data);
-
-void
-on_high_bypass_toggled                 (GtkToggleButton *togglebutton,
-                                        gpointer         user_data);
-
-void
 on_solo_toggled                        (GtkToggleButton *togglebutton,
                                         gpointer         user_data);
 
@@ -1206,7 +1194,13 @@
 void 
 callbacks_set_limiter_bypass_button_state (int state);
 
-void
+void 
+callbacks_set_low_delay_button_state (int state);
+
+void 
+callbacks_set_mid_delay_button_state (int state);
+
+void 
 on_eqb_value_changed                   (GtkRange        *range,
                                         gpointer         user_data);
 
Index: src/state.c
===================================================================
RCS file: /cvsroot/jamin/jamin/src/state.c,v
retrieving revision 1.69
diff -u -r1.69 state.c
--- src/state.c	1 Jul 2007 15:33:19 -0000	1.69
+++ src/state.c	2 Nov 2007 01:39:44 -0000
@@ -782,6 +782,8 @@
     process_set_xo_delay_time (XO_MID, gp.xo_delay_time[XO_MID]);
     process_set_xo_delay_state (XO_LOW, gp.xo_delay_state[XO_LOW]);
     process_set_xo_delay_state (XO_MID, gp.xo_delay_state[XO_MID]);
+    callbacks_set_low_delay_button_state (gp.xo_delay_state[XO_LOW]);
+    callbacks_set_mid_delay_button_state (gp.xo_delay_state[XO_MID]);
 
     intrim_set_out_meter_peak_pref (gp.out_meter_peak_pref);
     intrim_set_rms_meter_peak_pref (gp.rms_meter_peak_pref);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.