Mercurial > audlegacy-plugins
annotate src/skins/ui_equalizer.c @ 3123:a2093254960a
Sanity check to work around a WMA decoding error.
author | John Lindgren <john.lindgren@tds.net> |
---|---|
date | Wed, 06 May 2009 12:11:06 -0400 |
parents | 963796db51ea |
children | 8b97f9560dc3 |
rev | line source |
---|---|
2606 | 1 /* Audacious - Cross-platform multimedia player |
2 * Copyright (C) 2005-2007 Audacious development team. | |
3 * | |
4 * Based on BMP: | |
5 * Copyright (C) 2003-2004 BMP development team. | |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2003 XMMS development team. | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; under version 3 of the License. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program. If not, see <http://www.gnu.org/licenses>. | |
21 * | |
22 * The Audacious team does not consider modular code linking to | |
23 * Audacious or using our public API to be a derived work. | |
24 */ | |
25 | |
26 /*#define AUD_DEBUG*/ | |
27 | |
28 #ifdef HAVE_CONFIG_H | |
29 # include "config.h" | |
30 #endif | |
31 | |
32 #include "ui_equalizer.h" | |
33 | |
34 #include <glib.h> | |
35 #include <glib/gi18n.h> | |
36 #include <gtk/gtk.h> | |
37 #include <stdio.h> | |
38 #include <math.h> | |
39 #include <string.h> | |
40 | |
41 #include "platform/smartinclude.h" | |
42 #include "ui_skin.h" | |
43 #include "ui_manager.h" | |
44 #include "actions-equalizer.h" | |
45 #include "util.h" | |
46 #include "ui_main.h" | |
2678 | 47 #include "ui_playlist.h" |
2971
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2792
diff
changeset
|
48 #include <audlegacy/plugin.h> |
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2792
diff
changeset
|
49 #include <audlegacy/equalizer_preset.h> |
2606 | 50 |
51 #include "images/audacious_eq.xpm" | |
52 | |
53 #include "ui_dock.h" | |
54 #include "ui_skinned_window.h" | |
55 #include "ui_skinned_button.h" | |
56 #include "ui_skinned_horizontal_slider.h" | |
57 #include "ui_skinned_equalizer_slider.h" | |
58 #include "ui_skinned_equalizer_graph.h" | |
59 #include "skins_cfg.h" | |
60 | |
61 enum PresetViewCols { | |
62 PRESET_VIEW_COL_NAME, | |
63 PRESET_VIEW_N_COLS | |
64 }; | |
65 | |
66 GtkWidget *equalizerwin; | |
67 GtkWidget *equalizerwin_graph; | |
68 | |
69 static GtkWidget *equalizerwin_load_window = NULL; | |
70 static GtkWidget *equalizerwin_load_auto_window = NULL; | |
71 static GtkWidget *equalizerwin_save_window = NULL; | |
72 static GtkWidget *equalizerwin_save_entry = NULL; | |
73 static GtkWidget *equalizerwin_save_auto_window = NULL; | |
74 static GtkWidget *equalizerwin_save_auto_entry = NULL; | |
75 static GtkWidget *equalizerwin_delete_window = NULL; | |
76 static GtkWidget *equalizerwin_delete_auto_window = NULL; | |
77 | |
78 static GtkWidget *equalizerwin_on, *equalizerwin_auto; | |
79 | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
80 static GtkWidget *equalizerwin_close, *equalizerwin_shade; |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
81 static GtkWidget *equalizerwin_shaded_close, *equalizerwin_shaded_shade; |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
82 static GtkWidget *equalizerwin_presets; |
2606 | 83 static GtkWidget *equalizerwin_preamp,*equalizerwin_bands[10]; |
84 static GtkWidget *equalizerwin_volume, *equalizerwin_balance; | |
85 | |
86 static GList *equalizer_presets = NULL, *equalizer_auto_presets = NULL; | |
87 | |
88 EqualizerPreset * | |
89 equalizer_preset_new(const gchar * name) | |
90 { | |
91 EqualizerPreset *preset = g_new0(EqualizerPreset, 1); | |
92 preset->name = g_strdup(name); | |
93 return preset; | |
94 } | |
95 | |
96 void | |
97 equalizer_preset_free(EqualizerPreset * preset) | |
98 { | |
99 if (!preset) | |
100 return; | |
101 | |
102 g_free(preset->name); | |
103 g_free(preset); | |
104 } | |
105 | |
106 void | |
107 equalizerwin_set_scaled(gboolean ds) | |
108 { | |
109 gint height; | |
110 | |
111 if (config.equalizer_shaded) | |
112 height = 14; | |
113 else | |
114 height = 116; | |
115 | |
116 if (config.scaled) { | |
117 dock_window_resize(GTK_WINDOW(equalizerwin), 275 * config.scale_factor, | |
118 height * config.scale_factor, 275 * config.scale_factor, height * config.scale_factor); | |
119 } else { | |
120 dock_window_resize(GTK_WINDOW(equalizerwin), 275, height, 275, height); | |
121 } | |
122 | |
123 GList *iter; | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
124 for (iter = GTK_FIXED (SKINNED_WINDOW(equalizerwin)->normal)->children; iter; iter = g_list_next (iter)) { |
2606 | 125 GtkFixedChild *child_data = (GtkFixedChild *) iter->data; |
126 GtkWidget *child = child_data->widget; | |
127 g_signal_emit_by_name(child, "toggle-scaled"); | |
128 } | |
129 gtk_widget_shape_combine_mask(equalizerwin, skin_get_mask(aud_active_skin, SKIN_MASK_EQ + config.equalizer_shaded), 0, 0); | |
130 } | |
131 | |
132 void | |
133 equalizerwin_set_shade_menu_cb(gboolean shaded) | |
134 { | |
135 config.equalizer_shaded = shaded; | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
136 ui_skinned_window_set_shade(equalizerwin, shaded); |
2606 | 137 |
138 if (shaded) { | |
139 dock_shade(get_dock_window_list(), GTK_WINDOW(equalizerwin), | |
140 14 * EQUALIZER_SCALE_FACTOR); | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
141 } else { |
2606 | 142 dock_shade(get_dock_window_list(), GTK_WINDOW(equalizerwin), |
143 116 * EQUALIZER_SCALE_FACTOR); | |
144 } | |
145 | |
146 gtk_widget_shape_combine_mask(equalizerwin, skin_get_mask(aud_active_skin, SKIN_MASK_EQ + config.equalizer_shaded), 0, 0); | |
147 } | |
148 | |
149 static void | |
150 equalizerwin_set_shade(gboolean shaded) | |
151 { | |
152 GtkAction *action = gtk_action_group_get_action( | |
153 toggleaction_group_others , "roll up equalizer" ); | |
154 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , shaded ); | |
155 } | |
156 | |
157 static void | |
158 equalizerwin_shade_toggle(void) | |
159 { | |
160 equalizerwin_set_shade(!config.equalizer_shaded); | |
161 } | |
162 | |
163 void | |
164 equalizerwin_eq_changed(void) | |
165 { | |
166 gint i; | |
167 | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
168 aud_cfg->equalizer_preamp = equalizerwin_get_preamp(); |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
169 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
170 aud_cfg->equalizer_bands[i] = equalizerwin_get_band(i); |
2641 | 171 |
172 aud_hook_call("equalizer changed", NULL); | |
2606 | 173 gtk_widget_queue_draw(equalizerwin_graph); |
174 } | |
175 | |
176 static void | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
177 equalizerwin_apply_preset(EqualizerPreset *preset) |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
178 { |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
179 if (preset == NULL) |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
180 return; |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
181 |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
182 gint i; |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
183 |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
184 equalizerwin_set_preamp(preset->preamp); |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
185 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
186 equalizerwin_set_band(i, preset->bands[i]); |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
187 } |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
188 |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
189 static void |
2606 | 190 equalizerwin_on_pushed(void) |
191 { | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
192 equalizerwin_activate(!aud_cfg->equalizer_active); |
2606 | 193 } |
194 | |
195 static void | |
196 equalizerwin_presets_pushed(void) | |
197 { | |
198 GdkModifierType modmask; | |
199 gint x, y; | |
200 | |
201 gdk_window_get_pointer(NULL, &x, &y, &modmask); | |
202 ui_manager_popup_menu_show(GTK_MENU(equalizerwin_presets_menu), x, y, 1, GDK_CURRENT_TIME); | |
203 } | |
204 | |
205 static void | |
206 equalizerwin_auto_pushed(void) | |
207 { | |
208 aud_cfg->equalizer_autoload = UI_SKINNED_BUTTON(equalizerwin_auto)->inside; | |
209 } | |
210 | |
211 gboolean | |
212 equalizerwin_press(GtkWidget * widget, GdkEventButton * event, | |
213 gpointer callback_data) | |
214 { | |
215 if (event->button == 1 && event->type == GDK_2BUTTON_PRESS | |
216 && event->y < 14) { | |
217 equalizerwin_set_shade(!config.equalizer_shaded); | |
218 if (dock_is_moving(GTK_WINDOW(equalizerwin))) | |
219 dock_move_release(GTK_WINDOW(equalizerwin)); | |
220 return TRUE; | |
221 } | |
222 if (event->button == 3) { | |
223 /* | |
224 * Pop up the main menu a few pixels down to avoid | |
225 * anything to be selected initially. | |
226 */ | |
227 ui_manager_popup_menu_show(GTK_MENU(mainwin_general_menu), event->x_root, | |
228 event->y_root + 2, 3, event->time); | |
229 return TRUE; | |
230 } | |
231 | |
232 return FALSE; | |
233 } | |
234 | |
235 static gboolean | |
236 equalizerwin_keypress(GtkWidget * widget, | |
237 GdkEventKey * event, | |
238 gpointer data) | |
239 { | |
240 if (event->keyval == GDK_Tab && event->state & GDK_CONTROL_MASK) { | |
241 if (config.playlist_visible) | |
242 gtk_window_present(GTK_WINDOW(playlistwin)); | |
243 else if (config.player_visible) | |
244 gtk_window_present(GTK_WINDOW(mainwin)); | |
245 return TRUE; | |
246 } | |
247 if (!config.equalizer_shaded) { | |
248 gtk_widget_event(mainwin, (GdkEvent *) event); | |
249 return TRUE; | |
250 } | |
251 | |
252 switch (event->keyval) { | |
253 case GDK_Left: | |
254 case GDK_KP_Left: | |
255 mainwin_set_balance_diff(-4); | |
256 break; | |
257 case GDK_Right: | |
258 case GDK_KP_Right: | |
259 mainwin_set_balance_diff(4); | |
260 break; | |
261 default: | |
262 gtk_widget_event(mainwin, (GdkEvent *) event); | |
263 break; | |
264 } | |
265 | |
266 return FALSE; | |
267 } | |
268 | |
269 static void | |
270 equalizerwin_close_cb(void) | |
271 { | |
272 equalizerwin_show(FALSE); | |
273 } | |
274 | |
275 static gboolean | |
276 equalizerwin_delete(GtkWidget * widget, | |
277 gpointer data) | |
278 { | |
279 equalizerwin_show(FALSE); | |
280 return TRUE; | |
281 } | |
282 | |
283 gint | |
284 equalizerwin_volume_frame_cb(gint pos) | |
285 { | |
286 if (equalizerwin_volume) { | |
287 gint x; | |
288 if (pos < 32) | |
289 x = 1; | |
290 else if (pos < 63) | |
291 x = 4; | |
292 else | |
293 x = 7; | |
294 | |
295 UI_SKINNED_HORIZONTAL_SLIDER(equalizerwin_volume)->knob_nx = x; | |
296 UI_SKINNED_HORIZONTAL_SLIDER(equalizerwin_volume)->knob_px = x; | |
297 } | |
298 return 1; | |
299 } | |
300 | |
301 static void | |
302 equalizerwin_volume_motion_cb(GtkWidget *widget, gint pos) | |
303 { | |
304 gint v = (gint) rint(pos * 100 / 94.0); | |
305 mainwin_adjust_volume_motion(v); | |
306 mainwin_set_volume_slider(v); | |
307 } | |
308 | |
309 static void | |
310 equalizerwin_volume_release_cb(GtkWidget *widget, gint pos) | |
311 { | |
312 mainwin_adjust_volume_release(); | |
313 } | |
314 | |
315 static gint | |
316 equalizerwin_balance_frame_cb(gint pos) | |
317 { | |
318 if (equalizerwin_balance) { | |
319 gint x; | |
320 if (pos < 13) | |
321 x = 11; | |
322 else if (pos < 26) | |
323 x = 14; | |
324 else | |
325 x = 17; | |
326 | |
327 UI_SKINNED_HORIZONTAL_SLIDER(equalizerwin_balance)->knob_nx = x; | |
328 UI_SKINNED_HORIZONTAL_SLIDER(equalizerwin_balance)->knob_px = x; | |
329 } | |
330 | |
331 return 1; | |
332 } | |
333 | |
334 static void | |
335 equalizerwin_balance_motion_cb(GtkWidget *widget, gint pos) | |
336 { | |
337 gint b; | |
338 pos = MIN(pos, 38); /* The skin uses a even number of pixels | |
339 for the balance-slider *sigh* */ | |
340 b = (gint) rint((pos - 19) * 100 / 19.0); | |
341 mainwin_adjust_balance_motion(b); | |
342 mainwin_set_balance_slider(b); | |
343 } | |
344 | |
345 static void | |
346 equalizerwin_balance_release_cb(GtkWidget *widget, gint pos) | |
347 { | |
348 mainwin_adjust_balance_release(); | |
349 } | |
350 | |
351 void | |
352 equalizerwin_set_balance_slider(gint percent) | |
353 { | |
354 ui_skinned_horizontal_slider_set_position(equalizerwin_balance, | |
355 (gint) rint((percent * 19 / 100.0) + 19)); | |
356 } | |
357 | |
358 void | |
359 equalizerwin_set_volume_slider(gint percent) | |
360 { | |
361 ui_skinned_horizontal_slider_set_position(equalizerwin_volume, | |
362 (gint) rint(percent * 94 / 100.0)); | |
363 } | |
364 | |
365 static void | |
366 equalizerwin_create_widgets(void) | |
367 { | |
368 gint i; | |
369 | |
370 equalizerwin_on = ui_skinned_button_new(); | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
371 ui_skinned_toggle_button_setup(equalizerwin_on, SKINNED_WINDOW(equalizerwin)->normal, |
2606 | 372 14, 18, 25, 12, 10, 119, 128, 119, 69, 119, 187, 119, SKIN_EQMAIN); |
373 g_signal_connect(equalizerwin_on, "clicked", equalizerwin_on_pushed, NULL); | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
374 equalizerwin_activate(aud_cfg->equalizer_active); |
2606 | 375 |
376 equalizerwin_auto = ui_skinned_button_new(); | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
377 ui_skinned_toggle_button_setup(equalizerwin_auto, SKINNED_WINDOW(equalizerwin)->normal, |
2606 | 378 39, 18, 33, 12, 35, 119, 153, 119, 94, 119, 212, 119, SKIN_EQMAIN); |
379 g_signal_connect(equalizerwin_auto, "clicked", equalizerwin_auto_pushed, NULL); | |
2668
a1431a900f28
introduce ui_skinned_button_set_inside
Tomasz Mon <desowin@gmail.com>
parents:
2641
diff
changeset
|
380 ui_skinned_button_set_inside(equalizerwin_auto, aud_cfg->equalizer_autoload); |
2606 | 381 |
382 equalizerwin_presets = ui_skinned_button_new(); | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
383 ui_skinned_push_button_setup(equalizerwin_presets, SKINNED_WINDOW(equalizerwin)->normal, |
2606 | 384 217, 18, 44, 12, 224, 164, 224, 176, SKIN_EQMAIN); |
385 g_signal_connect(equalizerwin_presets, "clicked", equalizerwin_presets_pushed, NULL ); | |
386 | |
387 equalizerwin_close = ui_skinned_button_new(); | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
388 ui_skinned_push_button_setup(equalizerwin_close, SKINNED_WINDOW(equalizerwin)->normal, |
2606 | 389 264, 3, 9, 9, 0, 116, 0, 125, SKIN_EQMAIN); |
390 g_signal_connect(equalizerwin_close, "clicked", equalizerwin_close_cb, NULL ); | |
391 | |
392 equalizerwin_shade = ui_skinned_button_new(); | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
393 ui_skinned_push_button_setup(equalizerwin_shade, SKINNED_WINDOW(equalizerwin)->normal, |
2606 | 394 254, 3, 9, 9, 254, 137, 1, 38, SKIN_EQMAIN); |
395 ui_skinned_button_set_skin_index2(equalizerwin_shade, SKIN_EQ_EX); | |
396 g_signal_connect(equalizerwin_shade, "clicked", equalizerwin_shade_toggle, NULL ); | |
397 | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
398 equalizerwin_shaded_close = ui_skinned_button_new(); |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
399 ui_skinned_push_button_setup(equalizerwin_shaded_close, SKINNED_WINDOW(equalizerwin)->shaded, |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
400 264, 3, 9, 9, 11, 38, 11, 47, SKIN_EQ_EX); |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
401 g_signal_connect(equalizerwin_shaded_close, "clicked", equalizerwin_close_cb, NULL ); |
2606 | 402 |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
403 equalizerwin_shaded_shade = ui_skinned_button_new(); |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
404 ui_skinned_push_button_setup(equalizerwin_shaded_shade, SKINNED_WINDOW(equalizerwin)->shaded, |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
405 254, 3, 9, 9, 254, 3, 1, 47, SKIN_EQ_EX); |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
406 g_signal_connect(equalizerwin_shaded_shade, "clicked", equalizerwin_shade_toggle, NULL ); |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
407 |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
408 equalizerwin_graph = ui_skinned_equalizer_graph_new(SKINNED_WINDOW(equalizerwin)->normal, 86, 17); |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
409 |
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
410 equalizerwin_preamp = ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->normal, 21, 38); |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
411 equalizerwin_set_preamp(aud_cfg->equalizer_preamp); |
2606 | 412 |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
413 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) { |
2606 | 414 equalizerwin_bands[i] = |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
415 ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->normal, 78 + (i * 18), 38); |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
416 equalizerwin_set_band(i, aud_cfg->equalizer_bands[i]); |
2606 | 417 } |
418 | |
419 equalizerwin_volume = | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
420 ui_skinned_horizontal_slider_new(SKINNED_WINDOW(equalizerwin)->shaded, |
2606 | 421 61, 4, 97, 8, 1, 30, 1, 30, 3, 7, 4, 61, 0, 94, |
422 equalizerwin_volume_frame_cb, SKIN_EQ_EX); | |
423 g_signal_connect(equalizerwin_volume, "motion", G_CALLBACK(equalizerwin_volume_motion_cb), NULL); | |
424 g_signal_connect(equalizerwin_volume, "release", G_CALLBACK(equalizerwin_volume_release_cb), NULL); | |
425 | |
426 | |
427 equalizerwin_balance = | |
2719
51fc44b99b58
use two GtkFixed in SkinnedWindow - normal and shaded
Tomasz Mon <desowin@gmail.com>
parents:
2678
diff
changeset
|
428 ui_skinned_horizontal_slider_new(SKINNED_WINDOW(equalizerwin)->shaded, |
2606 | 429 164, 4, 42, 8, 11, 30, 11, 30, 3, 7, 4, 164, 0, 39, |
430 equalizerwin_balance_frame_cb, SKIN_EQ_EX); | |
431 g_signal_connect(equalizerwin_balance, "motion", G_CALLBACK(equalizerwin_balance_motion_cb), NULL); | |
432 g_signal_connect(equalizerwin_balance, "release", G_CALLBACK(equalizerwin_balance_release_cb), NULL); | |
433 } | |
434 | |
435 | |
436 static void | |
437 equalizerwin_create_window(void) | |
438 { | |
439 GdkPixbuf *icon; | |
440 gint width, height; | |
441 | |
442 width = 275; | |
443 height = config.equalizer_shaded ? 14 : 116; | |
444 | |
445 equalizerwin = ui_skinned_window_new("equalizer"); | |
446 gtk_window_set_title(GTK_WINDOW(equalizerwin), _("Audacious Equalizer")); | |
447 gtk_window_set_role(GTK_WINDOW(equalizerwin), "equalizer"); | |
448 gtk_window_set_resizable(GTK_WINDOW(equalizerwin), FALSE); | |
449 | |
450 if (config.scaled && config.eq_scaled_linked) { | |
451 width *= config.scale_factor; | |
452 height *= config.scale_factor; | |
453 } | |
454 | |
455 gtk_widget_set_size_request(equalizerwin, width, height); | |
456 | |
457 /* this will hide only mainwin. it's annoying! yaz */ | |
458 gtk_window_set_transient_for(GTK_WINDOW(equalizerwin), | |
459 GTK_WINDOW(mainwin)); | |
460 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(equalizerwin), TRUE); | |
461 | |
462 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) audacious_eq_icon); | |
463 gtk_window_set_icon(GTK_WINDOW(equalizerwin), icon); | |
464 g_object_unref(icon); | |
465 | |
466 gtk_widget_set_app_paintable(equalizerwin, TRUE); | |
467 | |
468 if (config.equalizer_x != -1 && config.save_window_position) | |
469 gtk_window_move(GTK_WINDOW(equalizerwin), | |
470 config.equalizer_x, config.equalizer_y); | |
471 | |
472 g_signal_connect(equalizerwin, "delete_event", | |
473 G_CALLBACK(equalizerwin_delete), NULL); | |
474 g_signal_connect(equalizerwin, "button_press_event", | |
475 G_CALLBACK(equalizerwin_press), NULL); | |
476 g_signal_connect(equalizerwin, "key_press_event", | |
477 G_CALLBACK(equalizerwin_keypress), NULL); | |
478 } | |
479 | |
480 void | |
481 equalizerwin_create(void) | |
482 { | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
483 equalizer_presets = aud_equalizer_read_presets("eq.preset"); |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
484 equalizer_auto_presets = aud_equalizer_read_presets("eq.auto_preset"); |
2606 | 485 |
486 equalizerwin_create_window(); | |
487 | |
488 gtk_window_add_accel_group( GTK_WINDOW(equalizerwin) , ui_manager_get_accel_group() ); | |
489 | |
490 equalizerwin_create_widgets(); | |
491 } | |
492 | |
493 | |
494 void | |
495 equalizerwin_show(gboolean show) | |
496 { | |
497 GtkAction *action = gtk_action_group_get_action( | |
498 toggleaction_group_others , "show equalizer" ); | |
499 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , show ); | |
500 | |
501 if (show) | |
502 equalizerwin_real_show(); | |
503 else | |
504 equalizerwin_real_hide(); | |
505 } | |
506 | |
507 void | |
508 equalizerwin_real_show(void) | |
509 { | |
510 gtk_window_move(GTK_WINDOW(equalizerwin), config.equalizer_x, config.equalizer_y); | |
511 if (config.scaled && config.eq_scaled_linked) | |
512 gtk_widget_set_size_request(equalizerwin, 275 * config.scale_factor, | |
513 ((config.equalizer_shaded ? 14 : 116) * config.scale_factor)); | |
514 else | |
515 gtk_widget_set_size_request(equalizerwin, 275, | |
516 (config.equalizer_shaded ? 14 : 116)); | |
517 config.equalizer_visible = TRUE; | |
2668
a1431a900f28
introduce ui_skinned_button_set_inside
Tomasz Mon <desowin@gmail.com>
parents:
2641
diff
changeset
|
518 ui_skinned_button_set_inside(mainwin_eq, TRUE); |
2606 | 519 gtk_widget_show_all(equalizerwin); |
520 | |
521 gtk_window_present(GTK_WINDOW(equalizerwin)); | |
522 } | |
523 | |
524 void | |
525 equalizerwin_real_hide(void) | |
526 { | |
527 /* | |
528 * This function should only be called from the | |
529 * main menu signal handler | |
530 */ | |
531 gtk_widget_hide(equalizerwin); | |
532 config.equalizer_visible = FALSE; | |
2668
a1431a900f28
introduce ui_skinned_button_set_inside
Tomasz Mon <desowin@gmail.com>
parents:
2641
diff
changeset
|
533 ui_skinned_button_set_inside(mainwin_eq, FALSE); |
2606 | 534 gtk_widget_queue_draw(mainwin_eq); |
535 } | |
536 | |
537 static EqualizerPreset * | |
538 equalizerwin_find_preset(GList * list, const gchar * name) | |
539 { | |
540 GList *node = list; | |
541 EqualizerPreset *preset; | |
542 | |
543 while (node) { | |
544 preset = node->data; | |
545 if (!strcasecmp(preset->name, name)) | |
546 return preset; | |
547 node = g_list_next(node); | |
548 } | |
549 return NULL; | |
550 } | |
551 | |
552 static gboolean | |
553 equalizerwin_load_preset(GList * list, const gchar * name) | |
554 { | |
555 EqualizerPreset *preset; | |
556 gint i; | |
557 | |
558 if ((preset = equalizerwin_find_preset(list, name)) != NULL) { | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
559 equalizerwin_set_preamp(preset->preamp); |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
560 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
561 equalizerwin_set_band(i, preset->bands[i]); |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
562 |
2606 | 563 return TRUE; |
564 } | |
565 return FALSE; | |
566 } | |
567 | |
568 static GList * | |
569 equalizerwin_save_preset(GList * list, const gchar * name, | |
570 const gchar * filename) | |
571 { | |
572 gint i; | |
573 EqualizerPreset *preset; | |
574 | |
575 if (!(preset = equalizerwin_find_preset(list, name))) { | |
576 preset = g_new0(EqualizerPreset, 1); | |
577 preset->name = g_strdup(name); | |
578 list = g_list_append(list, preset); | |
579 } | |
580 | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
581 preset->preamp = equalizerwin_get_preamp(); |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
582 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
583 preset->bands[i] = equalizerwin_get_band(i); |
2606 | 584 |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
585 aud_equalizer_write_preset_file(list, filename); |
2606 | 586 |
587 return list; | |
588 } | |
589 | |
590 static GList * | |
591 equalizerwin_delete_preset(GList * list, gchar * name, gchar * filename) | |
592 { | |
593 EqualizerPreset *preset; | |
594 GList *node; | |
595 | |
596 if (!(preset = equalizerwin_find_preset(list, name))) | |
597 return list; | |
598 | |
599 if (!(node = g_list_find(list, preset))) | |
600 return list; | |
601 | |
602 list = g_list_remove_link(list, node); | |
603 equalizer_preset_free(preset); | |
604 g_list_free_1(node); | |
605 | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
606 aud_equalizer_write_preset_file(list, filename); |
2606 | 607 |
608 return list; | |
609 } | |
610 | |
611 static void | |
612 equalizerwin_delete_selected_presets(GtkTreeView *view, gchar *filename) | |
613 { | |
614 gchar *text; | |
615 | |
616 GtkTreeSelection *selection = gtk_tree_view_get_selection(view); | |
617 GtkTreeModel *model = gtk_tree_view_get_model(view); | |
618 | |
619 /* | |
620 * first we are making a list of the selected rows, then we convert this | |
621 * list into a list of GtkTreeRowReferences, so that when you delete an | |
622 * item you can still access the other items | |
623 * finally we iterate through all GtkTreeRowReferences, convert them to | |
624 * GtkTreeIters and delete those one after the other | |
625 */ | |
626 | |
627 GList *list = gtk_tree_selection_get_selected_rows(selection, &model); | |
628 GList *rrefs = NULL; | |
629 GList *litr; | |
630 | |
631 for (litr = list; litr; litr = litr->next) | |
632 { | |
633 GtkTreePath *path = litr->data; | |
634 rrefs = g_list_append(rrefs, gtk_tree_row_reference_new(model, path)); | |
635 } | |
636 | |
637 for (litr = rrefs; litr; litr = litr->next) | |
638 { | |
639 GtkTreeRowReference *ref = litr->data; | |
640 GtkTreePath *path = gtk_tree_row_reference_get_path(ref); | |
641 GtkTreeIter iter; | |
642 gtk_tree_model_get_iter(model, &iter, path); | |
643 | |
644 gtk_tree_model_get(model, &iter, 0, &text, -1); | |
645 | |
646 if (!strcmp(filename, "eq.preset")) | |
647 equalizer_presets = equalizerwin_delete_preset(equalizer_presets, text, filename); | |
648 else if (!strcmp(filename, "eq.auto_preset")) | |
649 equalizer_auto_presets = equalizerwin_delete_preset(equalizer_auto_presets, text, filename); | |
650 | |
651 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); | |
652 } | |
653 } | |
654 | |
655 static void | |
656 free_cb (gpointer data, gpointer user_data) | |
657 { | |
658 equalizer_preset_free((EqualizerPreset*)data); | |
659 } | |
660 | |
661 static void | |
662 equalizerwin_read_winamp_eqf(VFSFile * file) | |
663 { | |
664 GList *presets; | |
665 gint i; | |
666 | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
667 if ((presets = aud_import_winamp_eqf(file)) == NULL) |
2606 | 668 return; |
669 | |
670 /* just get the first preset --asphyx */ | |
671 EqualizerPreset *preset = (EqualizerPreset*)presets->data; | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
672 equalizerwin_set_preamp(preset->preamp); |
2606 | 673 |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
674 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
675 equalizerwin_set_band(i, preset->bands[i]); |
2606 | 676 |
677 g_list_foreach(presets, free_cb, NULL); | |
678 g_list_free(presets); | |
679 | |
680 equalizerwin_eq_changed(); | |
681 } | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
682 |
2606 | 683 static void |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
684 equalizerwin_read_aud_preset(const gchar * file) |
2606 | 685 { |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
686 EqualizerPreset *preset = aud_equalizer_read_aud_preset(file); |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
687 if (preset) { |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
688 equalizerwin_apply_preset(preset); |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
689 equalizer_preset_free(preset); |
2606 | 690 } |
691 } | |
692 | |
693 static void | |
694 equalizerwin_save_ok(GtkWidget * widget, gpointer data) | |
695 { | |
696 const gchar *text; | |
697 | |
698 text = gtk_entry_get_text(GTK_ENTRY(equalizerwin_save_entry)); | |
699 if (strlen(text) != 0) | |
700 equalizer_presets = | |
701 equalizerwin_save_preset(equalizer_presets, text, "eq.preset"); | |
702 gtk_widget_destroy(equalizerwin_save_window); | |
703 } | |
704 | |
705 static void | |
706 equalizerwin_save_select(GtkTreeView *treeview, GtkTreePath *path, | |
707 GtkTreeViewColumn *col, gpointer data) | |
708 { | |
709 gchar *text; | |
710 | |
711 GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); | |
712 GtkTreeModel *model; | |
713 GtkTreeIter iter; | |
714 | |
715 if (selection) | |
716 { | |
717 if (gtk_tree_selection_get_selected(selection, &model, &iter)) | |
718 { | |
719 gtk_tree_model_get(model, &iter, 0, &text, -1); | |
720 gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_entry), text); | |
721 equalizerwin_save_ok(NULL, NULL); | |
722 | |
723 g_free(text); | |
724 } | |
725 } | |
726 } | |
727 | |
728 static void | |
729 equalizerwin_load_ok(GtkWidget *widget, gpointer data) | |
730 { | |
731 gchar *text; | |
732 | |
733 GtkTreeView* view = GTK_TREE_VIEW(data); | |
734 GtkTreeSelection *selection = gtk_tree_view_get_selection(view); | |
735 GtkTreeModel *model; | |
736 GtkTreeIter iter; | |
737 | |
738 if (selection) | |
739 { | |
740 if (gtk_tree_selection_get_selected(selection, &model, &iter)) | |
741 { | |
742 gtk_tree_model_get(model, &iter, 0, &text, -1); | |
743 equalizerwin_load_preset(equalizer_presets, text); | |
744 | |
745 g_free(text); | |
746 } | |
747 } | |
748 gtk_widget_destroy(equalizerwin_load_window); | |
749 } | |
750 | |
751 static void | |
752 equalizerwin_load_select(GtkTreeView *treeview, GtkTreePath *path, | |
753 GtkTreeViewColumn *col, gpointer data) | |
754 { | |
755 equalizerwin_load_ok(NULL, treeview); | |
756 } | |
757 | |
758 static void | |
759 equalizerwin_delete_delete(GtkWidget *widget, gpointer data) | |
760 { | |
761 equalizerwin_delete_selected_presets(GTK_TREE_VIEW(data), "eq.preset"); | |
762 } | |
763 | |
764 static void | |
765 equalizerwin_save_auto_ok(GtkWidget *widget, gpointer data) | |
766 { | |
767 const gchar *text; | |
768 | |
769 text = gtk_entry_get_text(GTK_ENTRY(equalizerwin_save_auto_entry)); | |
770 if (strlen(text) != 0) | |
771 equalizer_auto_presets = | |
772 equalizerwin_save_preset(equalizer_auto_presets, text, | |
773 "eq.auto_preset"); | |
774 gtk_widget_destroy(equalizerwin_save_auto_window); | |
775 } | |
776 | |
777 static void | |
778 equalizerwin_save_auto_select(GtkTreeView *treeview, GtkTreePath *path, | |
779 GtkTreeViewColumn *col, gpointer data) | |
780 { | |
781 gchar *text; | |
782 | |
783 GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); | |
784 GtkTreeModel *model; | |
785 GtkTreeIter iter; | |
786 | |
787 if (selection) | |
788 { | |
789 if (gtk_tree_selection_get_selected(selection, &model, &iter)) | |
790 { | |
791 gtk_tree_model_get(model, &iter, 0, &text, -1); | |
792 gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_auto_entry), text); | |
793 equalizerwin_save_auto_ok(NULL, NULL); | |
794 | |
795 g_free(text); | |
796 } | |
797 } | |
798 } | |
799 | |
800 static void | |
801 equalizerwin_load_auto_ok(GtkWidget *widget, gpointer data) | |
802 { | |
803 gchar *text; | |
804 | |
805 GtkTreeView *view = GTK_TREE_VIEW(data); | |
806 GtkTreeSelection *selection = gtk_tree_view_get_selection(view); | |
807 GtkTreeModel *model; | |
808 GtkTreeIter iter; | |
809 | |
810 if (selection) | |
811 { | |
812 if (gtk_tree_selection_get_selected(selection, &model, &iter)) | |
813 { | |
814 gtk_tree_model_get(model, &iter, 0, &text, -1); | |
815 equalizerwin_load_preset(equalizer_auto_presets, text); | |
816 | |
817 g_free(text); | |
818 } | |
819 } | |
820 gtk_widget_destroy(equalizerwin_load_auto_window); | |
821 } | |
822 | |
823 static void | |
824 equalizerwin_load_auto_select(GtkTreeView *treeview, GtkTreePath *path, | |
825 GtkTreeViewColumn *col, gpointer data) | |
826 { | |
827 equalizerwin_load_auto_ok(NULL, treeview); | |
828 } | |
829 | |
830 static void | |
831 equalizerwin_delete_auto_delete(GtkWidget *widget, gpointer data) | |
832 { | |
833 equalizerwin_delete_selected_presets(GTK_TREE_VIEW(data), "eq.auto_preset"); | |
834 } | |
835 | |
836 static VFSFile * | |
837 open_vfs_file(const gchar *filename, const gchar *mode) | |
838 { | |
839 VFSFile *file; | |
840 GtkWidget *dialog; | |
841 | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
842 if (!(file = aud_vfs_fopen(filename, mode))) { |
2606 | 843 dialog = gtk_message_dialog_new (GTK_WINDOW (mainwin), |
844 GTK_DIALOG_DESTROY_WITH_PARENT, | |
845 GTK_MESSAGE_ERROR, | |
846 GTK_BUTTONS_CLOSE, | |
847 "Error loading file '%s'", | |
848 filename); | |
849 gtk_dialog_run (GTK_DIALOG (dialog)); | |
850 gtk_widget_destroy (dialog); | |
851 } | |
852 | |
853 return file; | |
854 } | |
855 | |
856 static void | |
857 load_winamp_file(const gchar * filename) | |
858 { | |
859 VFSFile *file; | |
860 | |
861 if (!(file = open_vfs_file(filename, "rb"))) | |
862 return; | |
863 | |
864 equalizerwin_read_winamp_eqf(file); | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
865 aud_vfs_fclose(file); |
2606 | 866 } |
867 | |
868 static void | |
869 import_winamp_file(const gchar * filename) | |
870 { | |
871 VFSFile *file; | |
872 GList *list; | |
873 | |
874 if (!(file = open_vfs_file(filename, "rb")) || | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
875 !(list = aud_import_winamp_eqf(file))) |
2606 | 876 return; |
877 | |
878 equalizer_presets = g_list_concat(equalizer_presets, list); | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
879 aud_equalizer_write_preset_file(equalizer_presets, "eq.preset"); |
2606 | 880 |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
881 aud_vfs_fclose(file); |
2606 | 882 } |
883 | |
884 static void | |
885 save_winamp_file(const gchar * filename) | |
886 { | |
887 VFSFile *file; | |
888 | |
889 gchar name[257]; | |
890 gint i; | |
891 guchar bands[11]; | |
892 | |
893 if (!(file = open_vfs_file(filename, "wb"))) | |
894 return; | |
895 | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
896 aud_vfs_fwrite("Winamp EQ library file v1.1\x1a!--", 1, 31, file); |
2606 | 897 |
898 memset(name, 0, 257); | |
899 g_strlcpy(name, "Entry1", 257); | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
900 aud_vfs_fwrite(name, 1, 257, file); |
2606 | 901 |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
902 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
903 bands[i] = 63 - (((equalizerwin_get_band(i) + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
904 |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
905 bands[AUD_EQUALIZER_NBANDS] = 63 - (((equalizerwin_get_preamp() + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
906 |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
907 aud_vfs_fwrite(bands, 1, 11, file); |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
908 aud_vfs_fclose(file); |
2606 | 909 } |
910 | |
911 static GtkWidget * | |
912 equalizerwin_create_list_window(GList *preset_list, | |
913 const gchar *title, | |
914 GtkWidget **window, | |
915 GtkSelectionMode sel_mode, | |
916 GtkWidget **entry, | |
917 const gchar *action_name, | |
918 GCallback action_func, | |
919 GCallback select_row_func) | |
920 { | |
921 GtkWidget *vbox, *scrolled_window, *bbox, *view; | |
922 GtkWidget *button_cancel, *button_action; | |
923 GList *node; | |
924 | |
925 GtkListStore *store; | |
926 GtkTreeIter iter; | |
927 GtkTreeModel *model; | |
928 GtkCellRenderer *renderer; | |
929 GtkTreeSelection *selection; | |
930 GtkTreeSortable *sortable; | |
931 | |
932 | |
933 | |
934 *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
935 gtk_window_set_title(GTK_WINDOW(*window), title); | |
936 gtk_window_set_type_hint(GTK_WINDOW(*window), GDK_WINDOW_TYPE_HINT_DIALOG); | |
937 gtk_window_set_default_size(GTK_WINDOW(*window), 350, 300); | |
938 gtk_window_set_position(GTK_WINDOW(*window), GTK_WIN_POS_CENTER); | |
939 gtk_container_set_border_width(GTK_CONTAINER(*window), 10); | |
940 gtk_window_set_transient_for(GTK_WINDOW(*window), | |
941 GTK_WINDOW(equalizerwin)); | |
942 g_signal_connect(*window, "destroy", | |
943 G_CALLBACK(gtk_widget_destroyed), window); | |
944 | |
945 vbox = gtk_vbox_new(FALSE, 10); | |
946 gtk_container_add(GTK_CONTAINER(*window), vbox); | |
947 | |
948 scrolled_window = gtk_scrolled_window_new(NULL, NULL); | |
949 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), | |
950 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
951 | |
952 | |
953 /* fill the store with the names of all available presets */ | |
954 store = gtk_list_store_new(1, G_TYPE_STRING); | |
955 for (node = preset_list; node; node = g_list_next(node)) | |
956 { | |
957 gtk_list_store_append(store, &iter); | |
958 gtk_list_store_set(store, &iter, | |
959 0, ((EqualizerPreset*)node->data)->name, | |
960 -1); | |
961 } | |
962 model = GTK_TREE_MODEL(store); | |
963 | |
964 | |
965 sortable = GTK_TREE_SORTABLE(store); | |
966 gtk_tree_sortable_set_sort_column_id(sortable, 0, GTK_SORT_ASCENDING); | |
967 | |
968 | |
969 view = gtk_tree_view_new(); | |
970 renderer = gtk_cell_renderer_text_new(); | |
971 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, | |
972 _("Presets"), renderer, | |
973 "text", 0, NULL); | |
974 gtk_tree_view_set_model(GTK_TREE_VIEW(view), model); | |
975 g_object_unref(model); | |
976 | |
977 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); | |
978 gtk_tree_selection_set_mode(selection, sel_mode); | |
979 | |
980 | |
981 | |
982 | |
983 gtk_container_add(GTK_CONTAINER(scrolled_window), view); | |
984 gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0); | |
985 | |
986 if (entry) { | |
987 *entry = gtk_entry_new(); | |
988 g_signal_connect(*entry, "activate", action_func, NULL); | |
989 gtk_box_pack_start(GTK_BOX(vbox), *entry, FALSE, FALSE, 0); | |
990 } | |
991 | |
992 bbox = gtk_hbutton_box_new(); | |
993 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
3017
963796db51ea
Don't use deprecated gtk macros and types
Tomasz Mon <desowin@gmail.com>
parents:
2971
diff
changeset
|
994 gtk_box_set_spacing(GTK_BOX(bbox), 5); |
2606 | 995 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); |
996 | |
997 button_cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL); | |
998 g_signal_connect_swapped(button_cancel, "clicked", | |
999 G_CALLBACK(gtk_widget_destroy), | |
1000 GTK_OBJECT(*window)); | |
1001 gtk_box_pack_start(GTK_BOX(bbox), button_cancel, TRUE, TRUE, 0); | |
1002 | |
1003 button_action = gtk_button_new_from_stock(action_name); | |
1004 g_signal_connect(button_action, "clicked", G_CALLBACK(action_func), view); | |
1005 GTK_WIDGET_SET_FLAGS(button_action, GTK_CAN_DEFAULT); | |
1006 | |
1007 if (select_row_func) | |
1008 g_signal_connect(view, "row-activated", G_CALLBACK(select_row_func), NULL); | |
1009 | |
1010 | |
1011 gtk_box_pack_start(GTK_BOX(bbox), button_action, TRUE, TRUE, 0); | |
1012 | |
1013 gtk_widget_grab_default(button_action); | |
1014 | |
1015 | |
1016 gtk_widget_show_all(*window); | |
1017 | |
1018 return *window; | |
1019 } | |
1020 | |
1021 void | |
1022 equalizerwin_load_auto_preset(const gchar * filename) | |
1023 { | |
1024 gchar *presetfilename, *directory; | |
1025 | |
1026 g_return_if_fail(filename != NULL); | |
1027 | |
1028 if (!aud_cfg->equalizer_autoload) | |
1029 return; | |
1030 | |
1031 presetfilename = g_strconcat(filename, ".", aud_cfg->eqpreset_extension, NULL); | |
1032 | |
1033 /* First try to find a per file preset file */ | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1034 if (strlen(aud_cfg->eqpreset_extension) > 0) { |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1035 equalizerwin_read_aud_preset(presetfilename); |
2606 | 1036 g_free(presetfilename); |
1037 return; | |
1038 } | |
1039 | |
1040 g_free(presetfilename); | |
1041 | |
1042 directory = g_path_get_dirname(filename); | |
1043 presetfilename = g_build_filename(directory, aud_cfg->eqpreset_default_file, | |
1044 NULL); | |
1045 g_free(directory); | |
1046 | |
1047 /* Try to find a per directory preset file */ | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1048 if (strlen(aud_cfg->eqpreset_default_file) > 0) { |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1049 equalizerwin_read_aud_preset(presetfilename); |
2606 | 1050 } |
1051 else if (!equalizerwin_load_preset | |
1052 (equalizer_auto_presets, g_basename(filename))) { | |
1053 /* Fall back to the oldstyle auto presets */ | |
1054 equalizerwin_load_preset(equalizer_presets, "Default"); | |
1055 } | |
1056 | |
1057 g_free(presetfilename); | |
1058 } | |
1059 | |
1060 void | |
1061 equalizerwin_set_preamp(gfloat preamp) | |
1062 { | |
1063 ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, preamp); | |
1064 equalizerwin_eq_changed(); | |
1065 } | |
1066 | |
1067 void | |
1068 equalizerwin_set_band(gint band, gfloat value) | |
1069 { | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1070 g_return_if_fail(band >= 0 && band < AUD_EQUALIZER_NBANDS); |
2606 | 1071 ui_skinned_equalizer_slider_set_position(equalizerwin_bands[band], value); |
1072 } | |
1073 | |
1074 gfloat | |
1075 equalizerwin_get_preamp(void) | |
1076 { | |
1077 return ui_skinned_equalizer_slider_get_position(equalizerwin_preamp); | |
1078 } | |
1079 | |
1080 gfloat | |
1081 equalizerwin_get_band(gint band) | |
1082 { | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1083 g_return_val_if_fail(band >= 0 && band < AUD_EQUALIZER_NBANDS, 0.0); |
2606 | 1084 return ui_skinned_equalizer_slider_get_position(equalizerwin_bands[band]); |
1085 } | |
1086 | |
1087 void | |
1088 action_equ_load_preset(void) | |
1089 { | |
1090 if (equalizerwin_load_window) { | |
1091 gtk_window_present(GTK_WINDOW(equalizerwin_load_window)); | |
1092 return; | |
1093 } | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1094 |
2606 | 1095 equalizerwin_create_list_window(equalizer_presets, |
1096 Q_("Load preset"), | |
1097 &equalizerwin_load_window, | |
1098 GTK_SELECTION_SINGLE, NULL, | |
1099 GTK_STOCK_OK, | |
1100 G_CALLBACK(equalizerwin_load_ok), | |
1101 G_CALLBACK(equalizerwin_load_select)); | |
1102 } | |
1103 | |
1104 void | |
1105 action_equ_load_auto_preset(void) | |
1106 { | |
1107 if (equalizerwin_load_auto_window) { | |
1108 gtk_window_present(GTK_WINDOW(equalizerwin_load_auto_window)); | |
1109 return; | |
1110 } | |
1111 | |
1112 equalizerwin_create_list_window(equalizer_auto_presets, | |
1113 Q_("Load auto-preset"), | |
1114 &equalizerwin_load_auto_window, | |
1115 GTK_SELECTION_SINGLE, NULL, | |
1116 GTK_STOCK_OK, | |
1117 G_CALLBACK(equalizerwin_load_auto_ok), | |
1118 G_CALLBACK(equalizerwin_load_auto_select)); | |
1119 } | |
1120 | |
1121 void | |
1122 action_equ_load_default_preset(void) | |
1123 { | |
1124 equalizerwin_load_preset(equalizer_presets, "Default"); | |
1125 } | |
1126 | |
1127 void | |
1128 action_equ_zero_preset(void) | |
1129 { | |
1130 gint i; | |
1131 | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1132 equalizerwin_set_preamp(0); |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1133 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1134 equalizerwin_set_band(i, 0); |
2606 | 1135 } |
1136 | |
1137 void | |
1138 action_equ_load_preset_file(void) | |
1139 { | |
1140 GtkWidget *dialog; | |
1141 gchar *file_uri; | |
1142 | |
1143 dialog = make_filebrowser(Q_("Load equalizer preset"), FALSE); | |
1144 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) | |
1145 { | |
1146 file_uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog)); | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1147 EqualizerPreset *preset = aud_load_preset_file(file_uri); |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1148 equalizerwin_apply_preset(preset); |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1149 equalizer_preset_free(preset); |
2606 | 1150 g_free(file_uri); |
1151 } | |
1152 gtk_widget_destroy(dialog); | |
1153 } | |
1154 | |
1155 void | |
1156 action_equ_load_preset_eqf(void) | |
1157 { | |
1158 GtkWidget *dialog; | |
1159 gchar *file_uri; | |
1160 | |
1161 dialog = make_filebrowser(Q_("Load equalizer preset"), FALSE); | |
1162 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) | |
1163 { | |
1164 file_uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog)); | |
1165 load_winamp_file(file_uri); | |
1166 g_free(file_uri); | |
1167 } | |
1168 gtk_widget_destroy(dialog); | |
1169 } | |
1170 | |
1171 void | |
1172 action_equ_import_winamp_presets(void) | |
1173 { | |
1174 GtkWidget *dialog; | |
1175 gchar *file_uri; | |
1176 | |
1177 dialog = make_filebrowser(Q_("Load equalizer preset"), FALSE); | |
1178 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) | |
1179 { | |
1180 file_uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog)); | |
1181 import_winamp_file(file_uri); | |
1182 g_free(file_uri); | |
1183 } | |
1184 gtk_widget_destroy(dialog); | |
1185 } | |
1186 | |
1187 void | |
1188 action_equ_save_preset(void) | |
1189 { | |
1190 if (equalizerwin_save_window) { | |
1191 gtk_window_present(GTK_WINDOW(equalizerwin_save_window)); | |
1192 return; | |
1193 } | |
1194 | |
1195 equalizerwin_create_list_window(equalizer_presets, | |
1196 Q_("Save preset"), | |
1197 &equalizerwin_save_window, | |
1198 GTK_SELECTION_SINGLE, | |
1199 &equalizerwin_save_entry, | |
1200 GTK_STOCK_OK, | |
1201 G_CALLBACK(equalizerwin_save_ok), | |
1202 G_CALLBACK(equalizerwin_save_select)); | |
1203 } | |
1204 | |
1205 void | |
1206 action_equ_save_auto_preset(void) | |
1207 { | |
1208 gchar *name; | |
1209 Playlist *playlist = aud_playlist_get_active(); | |
1210 | |
1211 if (equalizerwin_save_auto_window) | |
1212 gtk_window_present(GTK_WINDOW(equalizerwin_save_auto_window)); | |
1213 else | |
1214 equalizerwin_create_list_window(equalizer_auto_presets, | |
1215 Q_("Save auto-preset"), | |
1216 &equalizerwin_save_auto_window, | |
1217 GTK_SELECTION_SINGLE, | |
1218 &equalizerwin_save_auto_entry, | |
1219 GTK_STOCK_OK, | |
1220 G_CALLBACK(equalizerwin_save_auto_ok), | |
1221 G_CALLBACK(equalizerwin_save_auto_select)); | |
1222 | |
1223 name = aud_playlist_get_filename(playlist, aud_playlist_get_position(playlist)); | |
1224 if (name) { | |
1225 gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_auto_entry), | |
1226 g_basename(name)); | |
1227 g_free(name); | |
1228 } | |
1229 } | |
1230 | |
1231 void | |
1232 action_equ_save_default_preset(void) | |
1233 { | |
1234 equalizer_presets = | |
1235 equalizerwin_save_preset(equalizer_presets, Q_("Default"), "eq.preset"); | |
1236 } | |
1237 | |
1238 void | |
1239 action_equ_save_preset_file(void) | |
1240 { | |
1241 GtkWidget *dialog; | |
1242 gchar *file_uri; | |
1243 gchar *songname; | |
1244 Playlist *playlist = aud_playlist_get_active(); | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1245 gint i; |
2606 | 1246 |
1247 dialog = make_filebrowser(Q_("Save equalizer preset"), TRUE); | |
1248 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) | |
1249 { | |
1250 file_uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog)); | |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1251 EqualizerPreset *preset = g_new0(EqualizerPreset, 1); |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1252 preset->name = g_strdup(file_uri); |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1253 preset->preamp = equalizerwin_get_preamp(); |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1254 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1255 preset->bands[i] = equalizerwin_get_band(i); |
2786
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1256 aud_save_preset_file(preset, file_uri); |
b7d8e6fd4644
make use of exported equalzier preset functions
Tomasz Mon <desowin@gmail.com>
parents:
2719
diff
changeset
|
1257 equalizer_preset_free(preset); |
2606 | 1258 g_free(file_uri); |
1259 } | |
1260 | |
1261 songname = aud_playlist_get_filename(playlist, aud_playlist_get_position(playlist)); | |
1262 if (songname) { | |
1263 gchar *eqname = g_strdup_printf("%s.%s", songname, | |
1264 aud_cfg->eqpreset_extension); | |
1265 g_free(songname); | |
1266 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), | |
1267 eqname); | |
1268 g_free(eqname); | |
1269 } | |
1270 | |
1271 gtk_widget_destroy(dialog); | |
1272 } | |
1273 | |
1274 void | |
1275 action_equ_save_preset_eqf(void) | |
1276 { | |
1277 GtkWidget *dialog; | |
1278 gchar *file_uri; | |
1279 | |
1280 dialog = make_filebrowser(Q_("Save equalizer preset"), TRUE); | |
1281 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) | |
1282 { | |
1283 file_uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog)); | |
1284 save_winamp_file(file_uri); | |
1285 g_free(file_uri); | |
1286 } | |
1287 gtk_widget_destroy(dialog); | |
1288 } | |
1289 | |
1290 void | |
1291 action_equ_delete_preset(void) | |
1292 { | |
1293 if (equalizerwin_delete_window) { | |
1294 gtk_window_present(GTK_WINDOW(equalizerwin_delete_window)); | |
1295 return; | |
1296 } | |
1297 | |
1298 equalizerwin_create_list_window(equalizer_presets, | |
1299 Q_("Delete preset"), | |
1300 &equalizerwin_delete_window, | |
1301 GTK_SELECTION_EXTENDED, NULL, | |
1302 GTK_STOCK_DELETE, | |
1303 G_CALLBACK(equalizerwin_delete_delete), | |
1304 NULL); | |
1305 } | |
1306 | |
1307 void | |
1308 action_equ_delete_auto_preset(void) | |
1309 { | |
1310 if (equalizerwin_delete_auto_window) { | |
1311 gtk_window_present(GTK_WINDOW(equalizerwin_delete_auto_window)); | |
1312 return; | |
1313 } | |
1314 | |
1315 equalizerwin_create_list_window(equalizer_auto_presets, | |
1316 Q_("Delete auto-preset"), | |
1317 &equalizerwin_delete_auto_window, | |
1318 GTK_SELECTION_EXTENDED, NULL, | |
1319 GTK_STOCK_DELETE, | |
1320 G_CALLBACK(equalizerwin_delete_auto_delete), | |
1321 NULL); | |
1322 } | |
1323 | |
1324 void | |
2792
04c38b7a6079
sync ui_equalizer changes with skins plugin
mf0102 <0102@gmx.at>
parents:
2786
diff
changeset
|
1325 equalizerwin_activate(gboolean active) |
2606 | 1326 { |
1327 aud_cfg->equalizer_active = active; | |
2668
a1431a900f28
introduce ui_skinned_button_set_inside
Tomasz Mon <desowin@gmail.com>
parents:
2641
diff
changeset
|
1328 ui_skinned_button_set_inside(equalizerwin_on, active); |
2606 | 1329 equalizerwin_eq_changed(); |
1330 } |