summarylogtreecommitdiffstats
path: root/fix-2.2.x-for-gobject-property-system.patch
blob: 9dbffc403e68fe813c8f5d166a5fbb6f1274a74b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
diff --git a/src/plugins/fluidsynth.c b/src/plugins/fluidsynth.c
index 067c6d7..3fcd3d8 100644
--- a/src/plugins/fluidsynth.c
+++ b/src/plugins/fluidsynth.c
@@ -276,12 +276,12 @@ static void active_item_realtime_update(WavetblFluidSynth *wavetbl,
 /* FluidSynth settings boolean exceptions (yes/no string values) */
 static const char *settings_str_bool[] =
 {
-    "audio.jack.multi",
-    "synth.chorus.active",
-    "synth.dump",
-    "synth.ladspa.active",
-    "synth.reverb.active",
-    "synth.verbose",
+    "audio-jack-multi",
+    "synth-chorus-active",
+    "synth-dump",
+    "synth-ladspa-active",
+    "synth-reverb-active",
+    "synth-verbose",
     NULL
 };
 
@@ -667,7 +667,7 @@ wavetbl_fluidsynth_class_init(WavetblFluidSynthClass *klass)
     g_object_class_install_property(obj_class, WTBL_PROP_CHORUS_COUNT,
                                     g_param_spec_int("chorus-count", _("Chorus count"),
                                             _("Number of chorus delay lines"),
-                                            1, 99, chorus_presets[0].count,
+                                            0, 99, chorus_presets[0].count,
                                             G_PARAM_READWRITE));
     g_object_class_install_property(obj_class, WTBL_PROP_CHORUS_LEVEL,
                                     g_param_spec_double("chorus-level", _("Chorus level"),
@@ -677,12 +677,12 @@ wavetbl_fluidsynth_class_init(WavetblFluidSynthClass *klass)
     g_object_class_install_property(obj_class, WTBL_PROP_CHORUS_FREQ,
                                     g_param_spec_double("chorus-freq", _("Chorus freq"),
                                             _("Chorus modulation frequency (Hz)"),
-                                            0.3, 5.0, chorus_presets[0].freq,
+                                            0.1, 5.0, chorus_presets[0].freq,
                                             G_PARAM_READWRITE));
     g_object_class_install_property(obj_class, WTBL_PROP_CHORUS_DEPTH,
                                     g_param_spec_double("chorus-depth", _("Chorus depth"),
                                             _("Chorus depth"),
-                                            0.0, 20.0, chorus_presets[0].depth,
+                                            0.0, 46.0, chorus_presets[0].depth,
                                             G_PARAM_READWRITE));
     g_object_class_install_property(obj_class, WTBL_PROP_CHORUS_WAVEFORM,
                                     g_param_spec_enum("chorus-waveform", _("Chorus waveform"),
@@ -752,6 +752,9 @@ settings_foreach_func(void *data, const char *name, int type)
     int optcount = 0;
     char *optname;
 
+    /* GObject property names don't allow '.' */
+    char *gobj_name = g_strdelimit(g_strdup(name), ".", '-');
+
     /* check if this property is on the string boolean list */
     for(sp = settings_str_bool; *sp; sp++)
         if(type == FLUID_STR_TYPE && strcmp(name, *sp) == 0)
@@ -762,7 +765,7 @@ settings_foreach_func(void *data, const char *name, int type)
     if(*sp)	/* string boolean value? */
     {
         bdef = fluid_settings_str_equal(bag->settings, name, "yes");
-        spec = g_param_spec_boolean(name, name, name, bdef, G_PARAM_READWRITE);
+        spec = g_param_spec_boolean(gobj_name, name, name, bdef, G_PARAM_READWRITE);
 
         /* set PROP_STRING_BOOL property flag */
         dynamic_prop_flags[last_property_id - FIRST_DYNAMIC_PROP] |= PROP_STRING_BOOL;
@@ -774,7 +777,7 @@ settings_foreach_func(void *data, const char *name, int type)
         case FLUID_NUM_TYPE:
             fluid_settings_getnum_range(bag->settings, name, &dmin, &dmax);
             fluid_settings_getnum_default(bag->settings, name, &ddef);
-            spec = g_param_spec_double(name, name, name, dmin, dmax, ddef,
+            spec = g_param_spec_double(gobj_name, name, name, dmin, dmax, ddef,
                                        G_PARAM_READWRITE);
             break;
 
@@ -785,18 +788,18 @@ settings_foreach_func(void *data, const char *name, int type)
 
             if((hint & FLUID_HINT_TOGGLED) != 0)	/* boolean parameter? */
             {
-                spec = g_param_spec_boolean(name, name, name, idef != 0, G_PARAM_READWRITE);
+                spec = g_param_spec_boolean(gobj_name, name, name, idef != 0, G_PARAM_READWRITE);
             }
             else
             {
-                spec = g_param_spec_int(name, name, name, imin, imax, idef, G_PARAM_READWRITE);
+                spec = g_param_spec_int(gobj_name, name, name, imin, imax, idef, G_PARAM_READWRITE);
             }
 
             break;
 
         case FLUID_STR_TYPE:
             fluid_settings_getstr_default(bag->settings, name, &defstr);
-            spec = g_param_spec_string(name, name, name, defstr, G_PARAM_READWRITE);
+            spec = g_param_spec_string(gobj_name, name, name, defstr, G_PARAM_READWRITE);
 
             /* count options for this string parameter (if any) */
             fluid_settings_foreach_option(bag->settings, name, &optcount,
@@ -837,7 +840,7 @@ settings_foreach_func(void *data, const char *name, int type)
     /* install an options parameter if there are any string options */
     if(options)
     {
-        optname = g_strconcat(name, "-options", NULL);	/* ++ alloc */
+        optname = g_strconcat(gobj_name, "-options", NULL);	/* ++ alloc */
         spec = g_param_spec_boxed(optname, optname, optname, G_TYPE_STRV,
                                   G_PARAM_READABLE);
 
@@ -853,6 +856,8 @@ settings_foreach_func(void *data, const char *name, int type)
 
         last_property_id++;	/* advance the last dynamic property ID */
     }
+
+    g_free(gobj_name);
 }
 
 /* function to iterate over FluidSynth string options for string parameters
diff --git a/src/plugins/fluidsynth_gui.c b/src/plugins/fluidsynth_gui.c
index 13d3fe1..4922159 100644
--- a/src/plugins/fluidsynth_gui.c
+++ b/src/plugins/fluidsynth_gui.c
@@ -132,7 +132,7 @@ fluid_synth_pref_handler(void)
                                        "text", 0,
                                        NULL);
 
-        g_object_get(swamigui_root->wavetbl, "audio.driver-options", &options, NULL);	/* ++ alloc */
+        g_object_get(swamigui_root->wavetbl, "audio-driver-options", &options, NULL);	/* ++ alloc */
 
         for(optionp = options; *optionp; optionp++)
         {
@@ -147,7 +147,7 @@ fluid_synth_pref_handler(void)
 
         /* Connect the audio combo box to the "audio.driver" property */
         swamigui_control_prop_connect_widget(G_OBJECT(swamigui_root->wavetbl),
-                                             "audio.driver", G_OBJECT(widg));
+                                             "audio-driver", G_OBJECT(widg));
 
         /* Initialize MIDI driver list */
         widg = swamigui_util_glade_lookup(fluid_widg, "ComboMidiDriver");
@@ -162,7 +162,7 @@ fluid_synth_pref_handler(void)
                                        "text", 0,
                                        NULL);
 
-        g_object_get(swamigui_root->wavetbl, "midi.driver-options", &options, NULL);	/* ++ alloc */
+        g_object_get(swamigui_root->wavetbl, "midi-driver-options", &options, NULL);	/* ++ alloc */
 
         for(optionp = options; *optionp; optionp++)
         {
@@ -177,7 +177,7 @@ fluid_synth_pref_handler(void)
 
         /* Connect the MIDI combo box to the "midi.driver" property */
         swamigui_control_prop_connect_widget(G_OBJECT(swamigui_root->wavetbl),
-                                             "midi.driver", G_OBJECT(widg));
+                                             "midi-driver", G_OBJECT(widg));
 
         /* Connect widgets to FluidSynth properties */
         swamigui_control_glade_prop_connect(fluid_widg, G_OBJECT(swamigui_root->wavetbl));
@@ -357,7 +357,7 @@ fluid_synth_gui_control_init(FluidSynthGuiControl *fsctrl)
     }
 
     /* ++Ref  */
-    propctrl = swami_get_control_prop_by_name(G_OBJECT(wavetbl), "synth.reverb.active");
+    propctrl = swami_get_control_prop_by_name(G_OBJECT(wavetbl), "synth-reverb-active");
     widg = swamigui_util_glade_lookup(fsctrl->ctrl_widg, "BtnReverb");
     /* widget control is owned by the widget (it will be freed when the widget
        will be destroyed) */
@@ -369,7 +369,7 @@ fluid_synth_gui_control_init(FluidSynthGuiControl *fsctrl)
     fsctrl->ctrl_list = g_slist_append(fsctrl->ctrl_list, propctrl);
 
     /* ++Ref  */
-    propctrl = swami_get_control_prop_by_name(G_OBJECT(wavetbl), "synth.chorus.active");
+    propctrl = swami_get_control_prop_by_name(G_OBJECT(wavetbl), "synth-chorus-active");
     widg = swamigui_util_glade_lookup(fsctrl->ctrl_widg, "BtnChorus");
     /* widget control is owned by the widget (it will be freed when the widget
        will be destroyed) */
diff --git a/src/swamigui/swami-2.ui b/src/swamigui/swami-2.ui
index 648305a..5dd4518 100644
--- a/src/swamigui/swami-2.ui
+++ b/src/swamigui/swami-2.ui
@@ -778,68 +778,6 @@ BALATON Zoltan <balaton@users.sourceforge.net> (Spectralis support, Mac OS
         <property name="y_options"/>
       </packing>
     </child>
-    <child>
-      <object class="GtkSpinButton" id="PROP::audio-input-channels">
-        <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="invisible_char">•</property>
-        <property name="primary_icon_activatable">False</property>
-        <property name="secondary_icon_activatable">False</property>
-        <property name="primary_icon_sensitive">True</property>
-        <property name="secondary_icon_sensitive">True</property>
-        <property name="adjustment">adjustment3</property>
-      </object>
-      <packing>
-        <property name="left_attach">1</property>
-        <property name="right_attach">2</property>
-        <property name="top_attach">1</property>
-        <property name="bottom_attach">2</property>
-        <property name="y_options"/>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkLabel" id="label49">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="xalign">0</property>
-        <property name="label" translatable="yes">Input channels</property>
-      </object>
-      <packing>
-        <property name="top_attach">1</property>
-        <property name="bottom_attach">2</property>
-        <property name="x_options">GTK_FILL</property>
-        <property name="y_options"/>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkSpinButton" id="PROP::audio-output-channels">
-        <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="invisible_char">•</property>
-        <property name="primary_icon_activatable">False</property>
-        <property name="secondary_icon_activatable">False</property>
-        <property name="primary_icon_sensitive">True</property>
-        <property name="secondary_icon_sensitive">True</property>
-        <property name="adjustment">adjustment4</property>
-      </object>
-      <packing>
-        <property name="left_attach">1</property>
-        <property name="right_attach">2</property>
-        <property name="y_options"/>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkLabel" id="label39">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="xalign">0</property>
-        <property name="label" translatable="yes">Output channels</property>
-      </object>
-      <packing>
-        <property name="x_options">GTK_FILL</property>
-        <property name="y_options"/>
-      </packing>
-    </child>
   </object>
   <object class="GtkTable" id="FluidSynth-Audio:oss">
     <property name="visible">True</property>