annotate src/audacious/ui_equalizer.c @ 3350:1292e4ca0f08 trunk

press ctrl+tab to switch between windows
author Tomasz Mon <desowin@gmail.com>
date Mon, 13 Aug 2007 18:49:34 +0200
parents 8560d99e36be
children 10990786a090
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1 /* Audacious - Cross-platform multimedia player
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
2 * Copyright (C) 2005-2007 Audacious development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
3 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
4 * Based on BMP:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
5 * Copyright (C) 2003-2004 BMP development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
6 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
7 * Based on XMMS:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
8 * Copyright (C) 1998-2003 XMMS development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
9 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 3102
diff changeset
12 * the Free Software Foundation; under version 3 of the License.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
13 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
17 * GNU General Public License for more details.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
18 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 3102
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses>.
3123
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
21 *
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
22 * The Audacious team does not consider modular code linking to
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
23 * Audacious or using our public API to be a derived work.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26 #ifdef HAVE_CONFIG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27 # include "config.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30 #include "ui_equalizer.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
31
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
32 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33 #include <glib/gi18n.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 #include <gtk/gtk.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 #include <stdio.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 #include <math.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39 #include "platform/smartinclude.h"
3251
f02623377013 goodbye widgets directory
Tomasz Mon <desowin@gmail.com>
parents: 3245
diff changeset
40 #include "skin.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 #include "dock.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 #include "hints.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
43 #include "input.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44 #include "main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45 #include "ui_manager.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
46 #include "actions-equalizer.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47 #include "playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48 #include "ui_playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
49 #include "util.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
50 #include "output.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51
2537
7aac1b5ef85d [svn] - reinstate rcfile class for now
nenolod
parents: 2526
diff changeset
52 #include "rcfile.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
53 #include "vfs.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
54
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
55 #include "images/audacious_eq.xpm"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56
2494
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents: 2331
diff changeset
57 #include "ui_skinned_window.h"
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
58 #include "ui_skinned_button.h"
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
59 #include "ui_skinned_horizontal_slider.h"
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
60 #include "ui_skinned_equalizer_slider.h"
3101
b25db04ee2a1 replace EqGraph with UiSkinnedEqualizerGraph
Tomasz Mon <desowin@gmail.com>
parents: 3098
diff changeset
61 #include "ui_skinned_equalizer_graph.h"
2494
59661bd074b4 [svn] Try to put some skinned window code in a common place.
nenolod
parents: 2331
diff changeset
62
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63 enum PresetViewCols {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
64 PRESET_VIEW_COL_NAME,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
65 PRESET_VIEW_N_COLS
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
66 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68 struct _EqualizerPreset {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
69 gchar *name;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
70 gfloat preamp, bands[10];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
71 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
72
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
73 typedef struct _EqualizerPreset EqualizerPreset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
74
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
75
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
76 GtkWidget *equalizerwin;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
77
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
78 static GtkWidget *equalizerwin_load_window = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
79 static GtkWidget *equalizerwin_load_auto_window = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
80 static GtkWidget *equalizerwin_save_window = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
81 static GtkWidget *equalizerwin_save_entry = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
82 static GtkWidget *equalizerwin_save_auto_window = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
83 static GtkWidget *equalizerwin_save_auto_entry = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
84 static GtkWidget *equalizerwin_delete_window = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
85 static GtkWidget *equalizerwin_delete_auto_window = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
86
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
87 static GtkWidget *equalizerwin_on, *equalizerwin_auto;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
88
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
89 static GtkWidget *equalizerwin_close, *equalizerwin_presets, *equalizerwin_shade;
3101
b25db04ee2a1 replace EqGraph with UiSkinnedEqualizerGraph
Tomasz Mon <desowin@gmail.com>
parents: 3098
diff changeset
90 static GtkWidget *equalizerwin_graph;
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
91 static GtkWidget *equalizerwin_preamp,*equalizerwin_bands[10];
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
92 static GtkWidget *equalizerwin_volume, *equalizerwin_balance;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
93
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
94 static GList *equalizer_presets = NULL, *equalizer_auto_presets = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
95
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
96 EqualizerPreset *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
97 equalizer_preset_new(const gchar * name)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
98 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
99 EqualizerPreset *preset = g_new0(EqualizerPreset, 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
100 preset->name = g_strdup(name);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
101 return preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
102 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
103
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
104 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
105 equalizer_preset_free(EqualizerPreset * preset)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
106 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
107 if (!preset)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
108 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
109
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
110 g_free(preset->name);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
111 g_free(preset);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
112 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
113
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
114
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
115 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
116 equalizerwin_set_shape_mask(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
117 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
118 if (cfg.show_wm_decorations)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
119 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
120
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
121 if (cfg.doublesize == FALSE)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
122 gtk_widget_shape_combine_mask(equalizerwin,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
123 skin_get_mask(bmp_active_skin,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
124 SKIN_MASK_EQ), 0, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
125 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
126 gtk_widget_shape_combine_mask(equalizerwin, NULL, 0, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
127 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
128
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
129 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
130 equalizerwin_set_doublesize(gboolean ds)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
131 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
132 gint height;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
133
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
134 if (cfg.equalizer_shaded)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
135 height = 14;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
136 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
137 height = 116;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
138
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
139 equalizerwin_set_shape_mask();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
140
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
141 if (ds) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142 dock_window_resize(GTK_WINDOW(equalizerwin), 550, height * 2, 550, height * 2);
3243
5033f237f180 cleaning
Tomasz Mon <desowin@gmail.com>
parents: 3238
diff changeset
143 } else {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
144 dock_window_resize(GTK_WINDOW(equalizerwin), 275, height, 275, height);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
145 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
146
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
147 GList *iter;
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
148 for (iter = GTK_FIXED (SKINNED_WINDOW(equalizerwin)->fixed)->children; iter; iter = g_list_next (iter)) {
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
149 GtkFixedChild *child_data = (GtkFixedChild *) iter->data;
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
150 GtkWidget *child = child_data->widget;
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
151 g_signal_emit_by_name(child, "toggle-double-size");
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
152 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
153 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
154
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
155 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
156 equalizerwin_set_shade_menu_cb(gboolean shaded)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
157 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
158 cfg.equalizer_shaded = shaded;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
159
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
160 equalizerwin_set_shape_mask();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
161
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
162 if (shaded) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
163 dock_shade(dock_window_list, GTK_WINDOW(equalizerwin),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
164 14 * (EQUALIZER_DOUBLESIZE + 1));
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
165 ui_skinned_set_push_button_data(equalizerwin_shade, -1, 3, -1, 47);
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
166 ui_skinned_button_set_skin_index1(equalizerwin_shade, SKIN_EQ_EX);
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
167 ui_skinned_set_push_button_data(equalizerwin_close, 11, 38, 11, 47);
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
168 ui_skinned_button_set_skin_index(equalizerwin_close, SKIN_EQ_EX);
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
169 gtk_widget_show(equalizerwin_volume);
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
170 gtk_widget_show(equalizerwin_balance);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
171 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
172 else {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
173 dock_shade(dock_window_list, GTK_WINDOW(equalizerwin),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
174 116 * (EQUALIZER_DOUBLESIZE + 1));
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
175 ui_skinned_set_push_button_data(equalizerwin_shade, -1, 137, -1, 38);
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
176 ui_skinned_button_set_skin_index1(equalizerwin_shade, SKIN_EQMAIN);
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
177 ui_skinned_set_push_button_data(equalizerwin_close, 0, 116, 0, 125);
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
178 ui_skinned_button_set_skin_index(equalizerwin_close, SKIN_EQMAIN);
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
179 gtk_widget_hide(equalizerwin_volume);
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
180 gtk_widget_hide(equalizerwin_balance);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
181 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
182 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
183
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
184 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
185 equalizerwin_set_shade(gboolean shaded)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
186 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
187 GtkAction *action = gtk_action_group_get_action(
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
188 toggleaction_group_others , "roll up equalizer" );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
189 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , shaded );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
190 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
191
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
192 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
193 equalizerwin_shade_toggle(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
194 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
195 equalizerwin_set_shade(!cfg.equalizer_shaded);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
196 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
197
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
198 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
199 equalizerwin_raise(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
200 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
201 if (cfg.equalizer_visible)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
202 gtk_window_present(GTK_WINDOW(equalizerwin));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
203 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
204
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
205 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
206 equalizerwin_eq_changed(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
207 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
208 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
209
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
210 cfg.equalizer_preamp = ui_skinned_equalizer_slider_get_position(equalizerwin_preamp);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
211 for (i = 0; i < 10; i++)
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
212 cfg.equalizer_bands[i] = ui_skinned_equalizer_slider_get_position(equalizerwin_bands[i]);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
213 /* um .. i think we need both of these for xmms compatibility ..
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
214 not sure. -larne */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
215 input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
216 cfg.equalizer_bands);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
217 output_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
218 cfg.equalizer_bands);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
219
3101
b25db04ee2a1 replace EqGraph with UiSkinnedEqualizerGraph
Tomasz Mon <desowin@gmail.com>
parents: 3098
diff changeset
220 gtk_widget_queue_draw(equalizerwin_graph);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
221 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
222
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
223 static void
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
224 equalizerwin_on_pushed(void)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
225 {
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
226 cfg.equalizer_active = UI_SKINNED_BUTTON(equalizerwin_on)->inside;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
227 equalizerwin_eq_changed();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
228 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
229
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
230 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
231 equalizerwin_presets_pushed(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
232 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
233 GdkModifierType modmask;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
234 gint x, y;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
235
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
236 gdk_window_get_pointer(NULL, &x, &y, &modmask);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
237 ui_manager_popup_menu_show(GTK_MENU(equalizerwin_presets_menu), x, y, 1, GDK_CURRENT_TIME);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
238 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
239
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
240 static void
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
241 equalizerwin_auto_pushed(void)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
242 {
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
243 cfg.equalizer_autoload = UI_SKINNED_BUTTON(equalizerwin_auto)->inside;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
244 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
245
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
246 gboolean
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
247 equalizerwin_press(GtkWidget * widget, GdkEventButton * event,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
248 gpointer callback_data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
249 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
250 if (event->button == 1 && event->type == GDK_BUTTON_PRESS &&
3218
018b37cf0730 hasta la vista old widgetcore
Tomasz Mon <desowin@gmail.com>
parents: 3123
diff changeset
251 (cfg.easy_move || cfg.equalizer_shaded || event->y < 14)) {
2497
204d1bab71f9 [svn] - if (0 && hint_move_resize_available()) -- i'm not sure how this linked as we do not have a hint_move_resize_available().
nenolod
parents: 2495
diff changeset
252 equalizerwin_raise();
204d1bab71f9 [svn] - if (0 && hint_move_resize_available()) -- i'm not sure how this linked as we do not have a hint_move_resize_available().
nenolod
parents: 2495
diff changeset
253 dock_move_press(dock_window_list, GTK_WINDOW(equalizerwin), event,
204d1bab71f9 [svn] - if (0 && hint_move_resize_available()) -- i'm not sure how this linked as we do not have a hint_move_resize_available().
nenolod
parents: 2495
diff changeset
254 FALSE);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
255 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
256 else if (event->button == 1 && event->type == GDK_2BUTTON_PRESS
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
257 && event->y < 14) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
258 equalizerwin_set_shade(!cfg.equalizer_shaded);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
259 if (dock_is_moving(GTK_WINDOW(equalizerwin)))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
260 dock_move_release(GTK_WINDOW(equalizerwin));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
261 }
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
262 else if (event->button == 3) {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
263 /*
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
264 * Pop up the main menu a few pixels down to avoid
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
265 * anything to be selected initially.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
266 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
267 ui_manager_popup_menu_show(GTK_MENU(mainwin_general_menu), event->x_root,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
268 event->y_root + 2, 3, event->time);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
269 }
3102
d5f270d12b0c little cleaning
Tomasz Mon <desowin@gmail.com>
parents: 3101
diff changeset
270
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
271 return FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
272 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
273
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
274 static gboolean
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
275 equalizerwin_release(GtkWidget * widget,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
276 GdkEventButton * event, gpointer callback_data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
277 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
278 if (dock_is_moving(GTK_WINDOW(equalizerwin))) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
279 dock_move_release(GTK_WINDOW(equalizerwin));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
280 }
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
281
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
282 return FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
283 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
284
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
285 static gboolean
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
286 equalizerwin_keypress(GtkWidget * widget,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
287 GdkEventKey * event,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
288 gpointer data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
289 {
3350
1292e4ca0f08 press ctrl+tab to switch between windows
Tomasz Mon <desowin@gmail.com>
parents: 3311
diff changeset
290 if (event->keyval == GDK_Tab && event->state & GDK_CONTROL_MASK) {
1292e4ca0f08 press ctrl+tab to switch between windows
Tomasz Mon <desowin@gmail.com>
parents: 3311
diff changeset
291 gtk_window_present(GTK_WINDOW(playlistwin));
1292e4ca0f08 press ctrl+tab to switch between windows
Tomasz Mon <desowin@gmail.com>
parents: 3311
diff changeset
292 return TRUE;
1292e4ca0f08 press ctrl+tab to switch between windows
Tomasz Mon <desowin@gmail.com>
parents: 3311
diff changeset
293 }
1292e4ca0f08 press ctrl+tab to switch between windows
Tomasz Mon <desowin@gmail.com>
parents: 3311
diff changeset
294
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
295 if (!cfg.equalizer_shaded) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
296 gtk_widget_event(mainwin, (GdkEvent *) event);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
297 return TRUE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
298 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
299
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
300 switch (event->keyval) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
301 case GDK_Left:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
302 case GDK_KP_Left:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
303 mainwin_set_balance_diff(-4);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
304 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
305 case GDK_Right:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
306 case GDK_KP_Right:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
307 mainwin_set_balance_diff(4);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
308 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
309 default:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
310 gtk_widget_event(mainwin, (GdkEvent *) event);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
311 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
312 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
314 return FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
315 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
316
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
317 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
318 equalizerwin_close_cb(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
319 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
320 equalizerwin_show(FALSE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
321 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
322
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
323 static gboolean
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
324 equalizerwin_delete(GtkWidget * widget,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
325 gpointer data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
326 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
327 equalizerwin_show(FALSE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
328 return TRUE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
329 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
330
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
331 static GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
332 equalizerwin_read_presets(const gchar * basename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
333 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
334 gchar *filename, *name;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
335 RcFile *rcfile;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
336 GList *list = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
337 gint i, p = 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
338 EqualizerPreset *preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
339
3238
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
340 /* START mod: add check for the default presets locate in system path ({prefix}/share/audacious)
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
341 by Massimo Cavalleri (submax) */
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
342
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
343 filename = g_build_filename(bmp_paths[BMP_PATH_USER_DIR], basename, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
344
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
345 if ((rcfile = bmp_rcfile_open(filename)) == NULL) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
346 g_free(filename);
3238
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
347 // DATA_DIR = "{prefix}/share/audacious" ; example is "/usr/share/audacious"
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
348 filename = g_build_filename(DATA_DIR, basename, NULL);
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
349 if ((rcfile = bmp_rcfile_open(filename)) == NULL) {
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
350 g_free(filename);
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
351 return NULL;
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
352 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
353 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
354
3238
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
355 // END mod
ceaaadccfa00 Add a system path for default presets.
William Pitcock <nenolod@atheme-project.org>
parents: 3221
diff changeset
356
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
357 g_free(filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
358
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
359 for (;;) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
360 gchar section[21];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
361
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
362 g_snprintf(section, sizeof(section), "Preset%d", p++);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
363 if (bmp_rcfile_read_string(rcfile, "Presets", section, &name)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
364 preset = g_new0(EqualizerPreset, 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
365 preset->name = name;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
366 bmp_rcfile_read_float(rcfile, name, "Preamp", &preset->preamp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
367 for (i = 0; i < 10; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
368 gchar band[7];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
369 g_snprintf(band, sizeof(band), "Band%d", i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
370 bmp_rcfile_read_float(rcfile, name, band, &preset->bands[i]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
371 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
372 list = g_list_prepend(list, preset);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
373 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
374 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
375 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
376 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
377 list = g_list_reverse(list);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
378 bmp_rcfile_free(rcfile);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
379 return list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
380 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
381
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
382 gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
383 equalizerwin_volume_frame_cb(gint pos)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
384 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
385 if (equalizerwin_volume) {
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
386 gint x;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
387 if (pos < 32)
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
388 x = 1;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
389 else if (pos < 63)
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
390 x = 4;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
391 else
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
392 x = 7;
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
393
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
394 UI_SKINNED_HORIZONTAL_SLIDER(equalizerwin_volume)->knob_nx = x;
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
395 UI_SKINNED_HORIZONTAL_SLIDER(equalizerwin_volume)->knob_px = x;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
396 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
397 return 1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
398 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
399
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
400 static void
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
401 equalizerwin_volume_motion_cb(GtkWidget *widget, gint pos)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
402 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
403 gint v = (gint) rint(pos * 100 / 94.0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
404 mainwin_adjust_volume_motion(v);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
405 mainwin_set_volume_slider(v);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
406 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
407
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
408 static void
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
409 equalizerwin_volume_release_cb(GtkWidget *widget, gint pos)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
410 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
411 mainwin_adjust_volume_release();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
412 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
413
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
414 static gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
415 equalizerwin_balance_frame_cb(gint pos)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
416 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
417 if (equalizerwin_balance) {
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
418 gint x;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
419 if (pos < 13)
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
420 x = 11;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
421 else if (pos < 26)
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
422 x = 14;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
423 else
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
424 x = 17;
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
425
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
426 UI_SKINNED_HORIZONTAL_SLIDER(equalizerwin_balance)->knob_nx = x;
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
427 UI_SKINNED_HORIZONTAL_SLIDER(equalizerwin_balance)->knob_px = x;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
428 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
429
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
430 return 1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
431 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
432
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
433 static void
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
434 equalizerwin_balance_motion_cb(GtkWidget *widget, gint pos)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
435 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
436 gint b;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
437 pos = MIN(pos, 38); /* The skin uses a even number of pixels
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
438 for the balance-slider *sigh* */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
439 b = (gint) rint((pos - 19) * 100 / 19.0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
440 mainwin_adjust_balance_motion(b);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
441 mainwin_set_balance_slider(b);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
442 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
443
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
444 static void
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
445 equalizerwin_balance_release_cb(GtkWidget *widget, gint pos)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
446 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
447 mainwin_adjust_balance_release();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
448 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
449
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
450 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
451 equalizerwin_set_balance_slider(gint percent)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
452 {
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
453 ui_skinned_horizontal_slider_set_position(equalizerwin_balance,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
454 (gint) rint((percent * 19 / 100.0) + 19));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
455 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
456
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
457 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
458 equalizerwin_set_volume_slider(gint percent)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
459 {
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
460 ui_skinned_horizontal_slider_set_position(equalizerwin_volume,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
461 (gint) rint(percent * 94 / 100.0));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
462 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
463
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
464 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
465 equalizerwin_create_widgets(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
466 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
467 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
468
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
469 equalizerwin_on = ui_skinned_button_new();
3005
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
470 ui_skinned_toggle_button_setup(equalizerwin_on, SKINNED_WINDOW(equalizerwin)->fixed,
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
471 14, 18, 25, 12, 10, 119, 128, 119, 69, 119, 187, 119, SKIN_EQMAIN);
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
472 g_signal_connect(equalizerwin_on, "clicked", equalizerwin_on_pushed, NULL);
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
473 UI_SKINNED_BUTTON(equalizerwin_on)->inside = cfg.equalizer_active;
2524
d135f97bf48d [svn] - ui_skinned_window_widgetlist_associate
nenolod
parents: 2515
diff changeset
474
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
475 equalizerwin_auto = ui_skinned_button_new();
3005
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
476 ui_skinned_toggle_button_setup(equalizerwin_auto, SKINNED_WINDOW(equalizerwin)->fixed,
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
477 39, 18, 33, 12, 35, 119, 153, 119, 94, 119, 212, 119, SKIN_EQMAIN);
2857
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
478 g_signal_connect(equalizerwin_auto, "clicked", equalizerwin_auto_pushed, NULL);
c35703c9dd9e fix equalizerwin, replace TButtons with UiSkinnedButton, tbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 2853
diff changeset
479 UI_SKINNED_BUTTON(equalizerwin_auto)->inside = cfg.equalizer_autoload;
2524
d135f97bf48d [svn] - ui_skinned_window_widgetlist_associate
nenolod
parents: 2515
diff changeset
480
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
481 equalizerwin_presets = ui_skinned_button_new();
3005
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
482 ui_skinned_push_button_setup(equalizerwin_presets, SKINNED_WINDOW(equalizerwin)->fixed,
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
483 217, 18, 44, 12, 224, 164, 224, 176, SKIN_EQMAIN);
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
484 g_signal_connect(equalizerwin_presets, "clicked", equalizerwin_presets_pushed, NULL );
2524
d135f97bf48d [svn] - ui_skinned_window_widgetlist_associate
nenolod
parents: 2515
diff changeset
485
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
486 equalizerwin_close = ui_skinned_button_new();
3005
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
487 ui_skinned_push_button_setup(equalizerwin_close, SKINNED_WINDOW(equalizerwin)->fixed,
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
488 264, 3, 9, 9, 0, 116, 0, 125, SKIN_EQMAIN);
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
489 g_signal_connect(equalizerwin_close, "clicked", equalizerwin_close_cb, NULL );
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
490
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
491 equalizerwin_shade = ui_skinned_button_new();
3005
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
492 ui_skinned_push_button_setup(equalizerwin_shade, SKINNED_WINDOW(equalizerwin)->fixed,
3db40ad79fd9 request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents: 3000
diff changeset
493 254, 3, 9, 9, 254, 137, 1, 38, SKIN_EQMAIN);
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
494 ui_skinned_button_set_skin_index2(equalizerwin_shade, SKIN_EQ_EX);
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
495 g_signal_connect(equalizerwin_shade, "clicked", equalizerwin_shade_toggle, NULL );
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
496
3101
b25db04ee2a1 replace EqGraph with UiSkinnedEqualizerGraph
Tomasz Mon <desowin@gmail.com>
parents: 3098
diff changeset
497 equalizerwin_graph = ui_skinned_equalizer_graph_new(SKINNED_WINDOW(equalizerwin)->fixed, 86, 17);
2524
d135f97bf48d [svn] - ui_skinned_window_widgetlist_associate
nenolod
parents: 2515
diff changeset
498
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
499 equalizerwin_preamp = ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->fixed, 21, 38);
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
500 ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, cfg.equalizer_preamp);
2524
d135f97bf48d [svn] - ui_skinned_window_widgetlist_associate
nenolod
parents: 2515
diff changeset
501
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
502 for (i = 0; i < 10; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
503 equalizerwin_bands[i] =
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
504 ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->fixed, 78 + (i * 18), 38);
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
505 ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i], cfg.equalizer_bands[i]);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
506 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
507
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
508 equalizerwin_volume =
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
509 ui_skinned_horizontal_slider_new(SKINNED_WINDOW(equalizerwin)->fixed,
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
510 61, 4, 97, 8, 1, 30, 1, 30, 3, 7, 4, 61, 0, 94,
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
511 equalizerwin_volume_frame_cb, SKIN_EQ_EX);
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
512 g_signal_connect(equalizerwin_volume, "motion", G_CALLBACK(equalizerwin_volume_motion_cb), NULL);
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
513 g_signal_connect(equalizerwin_volume, "release", G_CALLBACK(equalizerwin_volume_release_cb), NULL);
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
514
2524
d135f97bf48d [svn] - ui_skinned_window_widgetlist_associate
nenolod
parents: 2515
diff changeset
515
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
516 equalizerwin_balance =
3049
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
517 ui_skinned_horizontal_slider_new(SKINNED_WINDOW(equalizerwin)->fixed,
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
518 164, 4, 42, 8, 11, 30, 11, 30, 3, 7, 4, 164, 0, 39,
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
519 equalizerwin_balance_frame_cb, SKIN_EQ_EX);
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
520 g_signal_connect(equalizerwin_balance, "motion", G_CALLBACK(equalizerwin_balance_motion_cb), NULL);
1a1116e50ad6 equalizerwin_volume and equalzerwin_balance are now UiSkinnedHorizontalSliders; hslider.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents: 3005
diff changeset
521 g_signal_connect(equalizerwin_balance, "release", G_CALLBACK(equalizerwin_balance_release_cb), NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
522 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
523
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
524
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
525 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
526 equalizerwin_create_window(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
527 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
528 GdkPixbuf *icon;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
529 gint width, height;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
530
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
531 width = 275;
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
532 height = cfg.equalizer_shaded ? 14 : 116;
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
533
3068
c5189bc4100b Refactor skinned window code.
William Pitcock <nenolod@atheme-project.org>
parents: 3065
diff changeset
534 equalizerwin = ui_skinned_window_new("equalizer");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
535 gtk_window_set_title(GTK_WINDOW(equalizerwin), _("Audacious Equalizer"));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
536 gtk_window_set_role(GTK_WINDOW(equalizerwin), "equalizer");
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
537 gtk_window_set_resizable(GTK_WINDOW(equalizerwin), FALSE);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
538
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
539 if (cfg.doublesize && cfg.eq_doublesize_linked) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
540 width *= 2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
541 height *= 2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
542 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
543
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
544 gtk_widget_set_size_request(equalizerwin, width, height);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
545
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
546 /* this will hide only mainwin. it's annoying! yaz */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
547 gtk_window_set_transient_for(GTK_WINDOW(equalizerwin),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
548 GTK_WINDOW(mainwin));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
549 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(equalizerwin), TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
550
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
551 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) bmp_eq_icon);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
552 gtk_window_set_icon(GTK_WINDOW(equalizerwin), icon);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
553 g_object_unref(icon);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
554
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
555 gtk_widget_set_app_paintable(equalizerwin, TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
556
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
557 if (cfg.equalizer_x != -1 && cfg.save_window_position)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
558 gtk_window_move(GTK_WINDOW(equalizerwin),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
559 cfg.equalizer_x, cfg.equalizer_y);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
560
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
561 g_signal_connect(equalizerwin, "delete_event",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
562 G_CALLBACK(equalizerwin_delete), NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
563 g_signal_connect(equalizerwin, "button_press_event",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
564 G_CALLBACK(equalizerwin_press), NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
565 g_signal_connect(equalizerwin, "button_release_event",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
566 G_CALLBACK(equalizerwin_release), NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
567 g_signal_connect(equalizerwin, "key_press_event",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
568 G_CALLBACK(equalizerwin_keypress), NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
569 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
570
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
571 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
572 equalizerwin_create(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
573 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
574 equalizer_presets = equalizerwin_read_presets("eq.preset");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
575 equalizer_auto_presets = equalizerwin_read_presets("eq.auto_preset");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
576
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
577 equalizerwin_create_window();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
578
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
579 gtk_window_add_accel_group( GTK_WINDOW(equalizerwin) , ui_manager_get_accel_group() );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
580
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
581 equalizerwin_create_widgets();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
582 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
583
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
584
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
585 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
586 equalizerwin_show(gboolean show)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
587 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
588 GtkAction *action = gtk_action_group_get_action(
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
589 toggleaction_group_others , "show equalizer" );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
590 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , show );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
591
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
592 if (show)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
593 equalizerwin_real_show();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
594 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
595 equalizerwin_real_hide();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
596 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
597
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
598 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
599 equalizerwin_real_show(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
600 {
2596
9903326fddf2 [svn] - reset the position of the equalizer window properly.
nenolod
parents: 2595
diff changeset
601 gtk_window_move(GTK_WINDOW(equalizerwin), cfg.equalizer_x, cfg.equalizer_y);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
602 if (cfg.doublesize && cfg.eq_doublesize_linked)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
603 gtk_widget_set_size_request(equalizerwin, 550,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
604 (cfg.equalizer_shaded ? 28 : 232));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
605 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
606 gtk_widget_set_size_request(equalizerwin, 275,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
607 (cfg.equalizer_shaded ? 14 : 116));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
608 cfg.equalizer_visible = TRUE;
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
609 UI_SKINNED_BUTTON(mainwin_eq)->inside = TRUE;
3050
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
610 gtk_widget_show_all(equalizerwin);
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
611
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
612 if (!cfg.equalizer_shaded) {
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
613 gtk_widget_hide(equalizerwin_volume);
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
614 gtk_widget_hide(equalizerwin_balance);
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
615 }
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
616 else {
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
617 ui_skinned_set_push_button_data(equalizerwin_shade, -1, 3, -1, 47);
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
618 ui_skinned_button_set_skin_index1(equalizerwin_shade, SKIN_EQ_EX);
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
619 ui_skinned_set_push_button_data(equalizerwin_close, 11, 38, 11, 47);
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
620 ui_skinned_button_set_skin_index(equalizerwin_close, SKIN_EQ_EX);
a4288aa638b8 correct showing equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 3049
diff changeset
621 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
622
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
623 gtk_window_present(GTK_WINDOW(equalizerwin));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
624 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
625
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
626 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
627 equalizerwin_real_hide(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
628 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
629 /*
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
630 * This function should only be called from the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
631 * main menu signal handler
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
632 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
633 gtk_widget_hide(equalizerwin);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
634 cfg.equalizer_visible = FALSE;
2853
bec320cfcc12 use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents: 2843
diff changeset
635 UI_SKINNED_BUTTON(mainwin_eq)->inside = FALSE;
2999
e6340ab753a1 replace calling redraw signals with gtk_widget_queue_draw()
Tomasz Mon <desowin@gmail.com>
parents: 2857
diff changeset
636 gtk_widget_queue_draw(mainwin_eq);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
637 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
638
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
639 static EqualizerPreset *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
640 equalizerwin_find_preset(GList * list, const gchar * name)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
641 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
642 GList *node = list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
643 EqualizerPreset *preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
644
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
645 while (node) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
646 preset = node->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
647 if (!strcasecmp(preset->name, name))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
648 return preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
649 node = g_list_next(node);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
650 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
651 return NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
652 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
653
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
654 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
655 equalizerwin_write_preset_file(GList * list, const gchar * basename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
656 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
657 gchar *filename, *tmp;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
658 gint i, p;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
659 EqualizerPreset *preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
660 RcFile *rcfile;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
661 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
662
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
663 rcfile = bmp_rcfile_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
664 p = 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
665 for (node = list; node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
666 preset = node->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
667 tmp = g_strdup_printf("Preset%d", p++);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
668 bmp_rcfile_write_string(rcfile, "Presets", tmp, preset->name);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
669 g_free(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
670 bmp_rcfile_write_float(rcfile, preset->name, "Preamp",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
671 preset->preamp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
672 for (i = 0; i < 10; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
673 tmp = g_strdup_printf("Band%d\n", i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
674 bmp_rcfile_write_float(rcfile, preset->name, tmp,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
675 preset->bands[i]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
676 g_free(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
677 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
678 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
679
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
680 filename = g_build_filename(bmp_paths[BMP_PATH_USER_DIR], basename, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
681 bmp_rcfile_write(rcfile, filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
682 bmp_rcfile_free(rcfile);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
683 g_free(filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
684 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
685
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
686 static gboolean
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
687 equalizerwin_load_preset(GList * list, const gchar * name)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
688 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
689 EqualizerPreset *preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
690 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
691
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
692 if ((preset = equalizerwin_find_preset(list, name)) != NULL) {
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
693 ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, preset->preamp);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
694 for (i = 0; i < 10; i++)
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
695 ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i], preset->bands[i]);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
696 equalizerwin_eq_changed();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
697 return TRUE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
698 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
699 return FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
700 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
701
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
702 static GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
703 equalizerwin_save_preset(GList * list, const gchar * name,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
704 const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
705 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
706 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
707 EqualizerPreset *preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
708
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
709 if (!(preset = equalizerwin_find_preset(list, name))) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
710 preset = g_new0(EqualizerPreset, 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
711 preset->name = g_strdup(name);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
712 list = g_list_append(list, preset);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
713 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
714
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
715 preset->preamp = ui_skinned_equalizer_slider_get_position(equalizerwin_preamp);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
716 for (i = 0; i < 10; i++)
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
717 preset->bands[i] = ui_skinned_equalizer_slider_get_position(equalizerwin_bands[i]);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
718
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
719 equalizerwin_write_preset_file(list, filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
720
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
721 return list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
722 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
723
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
724 static GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
725 equalizerwin_delete_preset(GList * list, gchar * name, gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
726 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
727 EqualizerPreset *preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
728 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
729
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
730 if (!(preset = equalizerwin_find_preset(list, name)))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
731 return list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
732
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
733 if (!(node = g_list_find(list, preset)))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
734 return list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
735
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
736 list = g_list_remove_link(list, node);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
737 equalizer_preset_free(preset);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
738 g_list_free_1(node);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
739
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
740 equalizerwin_write_preset_file(list, filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
741
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
742 return list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
743 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
744
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
745 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
746 equalizerwin_delete_selected_presets(GtkTreeView *view, gchar *filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
747 {
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
748 gchar *text;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
749
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
750 GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
751 GtkTreeModel *model = gtk_tree_view_get_model(view);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
752
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
753 /*
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
754 * first we are making a list of the selected rows, then we convert this
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
755 * list into a list of GtkTreeRowReferences, so that when you delete an
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
756 * item you can still access the other items
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
757 * finally we iterate through all GtkTreeRowReferences, convert them to
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
758 * GtkTreeIters and delete those one after the other
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
759 */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
760
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
761 GList *list = gtk_tree_selection_get_selected_rows(selection, &model);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
762 GList *rrefs = NULL;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
763 GList *litr;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
764
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
765 for (litr = list; litr; litr = litr->next)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
766 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
767 GtkTreePath *path = litr->data;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
768 rrefs = g_list_append(rrefs, gtk_tree_row_reference_new(model, path));
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
769 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
770
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
771 for (litr = rrefs; litr; litr = litr->next)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
772 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
773 GtkTreeRowReference *ref = litr->data;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
774 GtkTreePath *path = gtk_tree_row_reference_get_path(ref);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
775 GtkTreeIter iter;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
776 gtk_tree_model_get_iter(model, &iter, path);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
777
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
778 gtk_tree_model_get(model, &iter, 0, &text, -1);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
779
2785
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2601
diff changeset
780 if (!strcmp(filename, "eq.preset"))
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
781 equalizer_presets = equalizerwin_delete_preset(equalizer_presets, text, filename);
2785
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2601
diff changeset
782 else if (!strcmp(filename, "eq.auto_preset"))
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
783 equalizer_auto_presets = equalizerwin_delete_preset(equalizer_auto_presets, text, filename);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
784
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
785 gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
786 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
787 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
788
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
789
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
790 static GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
791 import_winamp_eqf(VFSFile * file)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
792 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
793 gchar header[31];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
794 gchar name[257];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
795 gchar bands[11];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
796 gint i = 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
797 GList *list = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
798 EqualizerPreset *preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
799
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
800 vfs_fread(header, 1, 31, file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
801 if (!strncmp(header, "Winamp EQ library file v1.1", 27)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
802 while (vfs_fread(name, 1, 257, file)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
803 preset = equalizer_preset_new(name);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
804 preset->preamp = 20.0 - ((bands[10] * 40.0) / 64);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
805
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
806 vfs_fread(bands, 1, 11, file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
807
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
808 for (i = 0; i < 10; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
809 preset->bands[i] = 20.0 - ((bands[i] * 40.0) / 64);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
810
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
811 list = g_list_prepend(list, preset);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
812 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
813 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
814
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
815 list = g_list_reverse(list);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
816 return list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
817 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
818
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
819 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
820 equalizerwin_read_winamp_eqf(VFSFile * file)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
821 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
822 gchar header[31];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
823 guchar bands[11];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
824 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
825
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
826 vfs_fread(header, 1, 31, file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
827
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
828 if (!strncmp(header, "Winamp EQ library file v1.1", 27)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
829 /* Skip name */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
830 if (vfs_fseek(file, 257, SEEK_CUR) == -1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
831 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
832
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
833 if (vfs_fread(bands, 1, 11, file) != 11)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
834 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
835
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
836 ui_skinned_equalizer_slider_set_position(equalizerwin_preamp,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
837 20.0 - ((bands[10] * 40.0) / 63.0));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
838
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
839 for (i = 0; i < 10; i++)
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
840 ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i],
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
841 20.0 - ((bands[i] * 40.0) / 64.0));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
842 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
843
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
844 equalizerwin_eq_changed();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
845 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
846
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
847 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
848 equalizerwin_read_bmp_preset(RcFile * rcfile)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
849 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
850 gfloat val;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
851 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
852
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
853 if (bmp_rcfile_read_float(rcfile, "Equalizer preset", "Preamp", &val))
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
854 ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, val);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
855 for (i = 0; i < 10; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
856 gchar tmp[7];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
857 g_snprintf(tmp, sizeof(tmp), "Band%d", i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
858 if (bmp_rcfile_read_float(rcfile, "Equalizer preset", tmp, &val))
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
859 ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i], val);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
860 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
861 equalizerwin_eq_changed();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
862 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
863
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
864 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
865 equalizerwin_save_ok(GtkWidget * widget, gpointer data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
866 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
867 const gchar *text;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
868
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
869 text = gtk_entry_get_text(GTK_ENTRY(equalizerwin_save_entry));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
870 if (strlen(text) != 0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
871 equalizer_presets =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
872 equalizerwin_save_preset(equalizer_presets, text, "eq.preset");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
873 gtk_widget_destroy(equalizerwin_save_window);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
874 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
875
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
876 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
877 equalizerwin_save_select(GtkTreeView *treeview, GtkTreePath *path,
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
878 GtkTreeViewColumn *col, gpointer data)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
879 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
880 gchar *text;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
881
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
882 GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
883 GtkTreeModel *model;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
884 GtkTreeIter iter;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
885
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
886 if (selection)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
887 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
888 if (gtk_tree_selection_get_selected(selection, &model, &iter))
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
889 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
890 gtk_tree_model_get(model, &iter, 0, &text, -1);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
891 gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_entry), text);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
892 equalizerwin_save_ok(NULL, NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
893
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
894 g_free(text);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
895 }
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
896 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
897 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
898
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
899 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
900 equalizerwin_load_ok(GtkWidget *widget, gpointer data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
901 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
902 gchar *text;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
903
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
904 GtkTreeView* view = GTK_TREE_VIEW(data);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
905 GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
906 GtkTreeModel *model;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
907 GtkTreeIter iter;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
908
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
909 if (selection)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
910 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
911 if (gtk_tree_selection_get_selected(selection, &model, &iter))
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
912 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
913 gtk_tree_model_get(model, &iter, 0, &text, -1);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
914 equalizerwin_load_preset(equalizer_presets, text);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
915
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
916 g_free(text);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
917 }
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
918 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
919 gtk_widget_destroy(equalizerwin_load_window);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
920 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
921
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
922 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
923 equalizerwin_load_select(GtkTreeView *treeview, GtkTreePath *path,
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
924 GtkTreeViewColumn *col, gpointer data)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
925 {
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
926 equalizerwin_load_ok(NULL, treeview);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
927 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
928
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
929 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
930 equalizerwin_delete_delete(GtkWidget *widget, gpointer data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
931 {
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
932 equalizerwin_delete_selected_presets(GTK_TREE_VIEW(data), "eq.preset");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
933 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
934
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
935 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
936 equalizerwin_save_auto_ok(GtkWidget *widget, gpointer data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
937 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
938 const gchar *text;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
939
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
940 text = gtk_entry_get_text(GTK_ENTRY(equalizerwin_save_auto_entry));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
941 if (strlen(text) != 0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
942 equalizer_auto_presets =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
943 equalizerwin_save_preset(equalizer_auto_presets, text,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
944 "eq.auto_preset");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
945 gtk_widget_destroy(equalizerwin_save_auto_window);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
946 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
947
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
948 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
949 equalizerwin_save_auto_select(GtkTreeView *treeview, GtkTreePath *path,
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
950 GtkTreeViewColumn *col, gpointer data)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
951 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
952 gchar *text;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
953
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
954 GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
955 GtkTreeModel *model;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
956 GtkTreeIter iter;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
957
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
958 if (selection)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
959 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
960 if (gtk_tree_selection_get_selected(selection, &model, &iter))
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
961 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
962 gtk_tree_model_get(model, &iter, 0, &text, -1);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
963 gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_auto_entry), text);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
964 equalizerwin_save_auto_ok(NULL, NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
965
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
966 g_free(text);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
967 }
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
968 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
969 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
970
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
971 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
972 equalizerwin_load_auto_ok(GtkWidget *widget, gpointer data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
973 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
974 gchar *text;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
975
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
976 GtkTreeView *view = GTK_TREE_VIEW(data);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
977 GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
978 GtkTreeModel *model;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
979 GtkTreeIter iter;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
980
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
981 if (selection)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
982 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
983 if (gtk_tree_selection_get_selected(selection, &model, &iter))
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
984 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
985 gtk_tree_model_get(model, &iter, 0, &text, -1);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
986 equalizerwin_load_preset(equalizer_auto_presets, text);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
987
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
988 g_free(text);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
989 }
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
990 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
991 gtk_widget_destroy(equalizerwin_load_auto_window);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
992 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
993
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
994 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
995 equalizerwin_load_auto_select(GtkTreeView *treeview, GtkTreePath *path,
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
996 GtkTreeViewColumn *col, gpointer data)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
997 {
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
998 equalizerwin_load_auto_ok(NULL, treeview);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
999 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1000
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1001 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1002 equalizerwin_delete_auto_delete(GtkWidget *widget, gpointer data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1003 {
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1004 equalizerwin_delete_selected_presets(GTK_TREE_VIEW(data), "eq.auto_preset");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1005 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1006
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1007
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1008 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1009 load_preset_file(const gchar *filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1010 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1011 RcFile *rcfile;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1012
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1013 if ((rcfile = bmp_rcfile_open(filename)) != NULL) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1014 equalizerwin_read_bmp_preset(rcfile);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1015 bmp_rcfile_free(rcfile);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1016 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1017 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1018
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1019 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1020 load_winamp_file(const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1021 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1022 VFSFile *file;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1023 gchar *tmp;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1024
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1025 if (!(file = vfs_fopen(filename, "rb"))) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1026 tmp = g_strconcat("Failed to load WinAmp file: ",filename,"\n",NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1027 report_error(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1028 g_free(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1029 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1030 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1031
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1032 equalizerwin_read_winamp_eqf(file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1033 vfs_fclose(file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1034 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1035
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1036 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1037 import_winamp_file(const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1038 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1039 VFSFile *file;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1040 gchar *tmp;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1041
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1042 if (!(file = vfs_fopen(filename, "rb"))) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1043 tmp = g_strconcat("Failed to import WinAmp file: ",filename,"\n",NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1044 report_error(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1045 g_free(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1046 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1047 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1048
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1049 equalizer_presets = g_list_concat(equalizer_presets,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1050 import_winamp_eqf(file));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1051 equalizerwin_write_preset_file(equalizer_presets, "eq.preset");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1052
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1053 vfs_fclose(file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1054 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1055
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1056 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1057 save_preset_file(const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1058 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1059 RcFile *rcfile;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1060 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1061
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1062 rcfile = bmp_rcfile_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1063 bmp_rcfile_write_float(rcfile, "Equalizer preset", "Preamp",
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1064 ui_skinned_equalizer_slider_get_position(equalizerwin_preamp));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1065
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1066 for (i = 0; i < 10; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1067 gchar tmp[7];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1068 g_snprintf(tmp, sizeof(tmp), "Band%d", i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1069 bmp_rcfile_write_float(rcfile, "Equalizer preset", tmp,
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1070 ui_skinned_equalizer_slider_get_position(equalizerwin_bands[i]));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1071 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1072
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1073 bmp_rcfile_write(rcfile, filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1074 bmp_rcfile_free(rcfile);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1075 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1076
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1077 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1078 save_winamp_file(const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1079 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1080 VFSFile *file;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1081
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1082 gchar name[257];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1083 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1084 guchar bands[11];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1085 gchar *tmp;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1086
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1087 if (!(file = vfs_fopen(filename, "wb"))) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1088 tmp = g_strconcat("Failed to save WinAmp file: ",filename,"\n",NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1089 report_error(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1090 g_free(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1091 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1092 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1093
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1094 vfs_fwrite("Winamp EQ library file v1.1\x1a!--", 1, 31, file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1095
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1096 memset(name, 0, 257);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1097 strcpy(name, "Entry1");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1098 vfs_fwrite(name, 1, 257, file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1099
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1100 for (i = 0; i < 10; i++)
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1101 bands[i] = 63 - (((ui_skinned_equalizer_slider_get_position(equalizerwin_bands[i]) + 20) * 63) / 40);
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1102 bands[10] = 63 - (((ui_skinned_equalizer_slider_get_position(equalizerwin_preamp) + 20) * 63) / 40);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1103 vfs_fwrite(bands, 1, 11, file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1104
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1105 vfs_fclose(file);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1106 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1107
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1108 static GtkWidget *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1109 equalizerwin_create_list_window(GList *preset_list,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1110 const gchar *title,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1111 GtkWidget **window,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1112 GtkSelectionMode sel_mode,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1113 GtkWidget **entry,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1114 const gchar *action_name,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1115 GCallback action_func,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1116 GCallback select_row_func)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1117 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1118 GtkWidget *vbox, *scrolled_window, *bbox, *view;
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1119 GtkWidget *button_cancel, *button_action;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1120 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1121
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1122 GtkListStore *store;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1123 GtkTreeIter iter;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1124 GtkTreeModel *model;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1125 GtkCellRenderer *renderer;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1126 GtkTreeSelection *selection;
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1127 GtkTreeSortable *sortable;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1128
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1129
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1130
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1131 *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1132 gtk_window_set_title(GTK_WINDOW(*window), title);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1133 gtk_window_set_type_hint(GTK_WINDOW(*window), GDK_WINDOW_TYPE_HINT_DIALOG);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1134 gtk_window_set_default_size(GTK_WINDOW(*window), 350, 300);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1135 gtk_window_set_position(GTK_WINDOW(*window), GTK_WIN_POS_CENTER);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1136 gtk_container_set_border_width(GTK_CONTAINER(*window), 10);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1137 gtk_window_set_transient_for(GTK_WINDOW(*window),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1138 GTK_WINDOW(equalizerwin));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1139 g_signal_connect(*window, "destroy",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1140 G_CALLBACK(gtk_widget_destroyed), window);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1141
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1142 vbox = gtk_vbox_new(FALSE, 10);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1143 gtk_container_add(GTK_CONTAINER(*window), vbox);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1144
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1145 scrolled_window = gtk_scrolled_window_new(NULL, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1146 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1147 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1148
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1149
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1150 /* fill the store with the names of all available presets */
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1151 store = gtk_list_store_new(1, G_TYPE_STRING);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1152 for (node = preset_list; node; node = g_list_next(node))
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1153 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1154 gtk_list_store_append(store, &iter);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1155 gtk_list_store_set(store, &iter,
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1156 0, ((EqualizerPreset*)node->data)->name,
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1157 -1);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1158 }
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1159 model = GTK_TREE_MODEL(store);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1160
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1161
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1162 sortable = GTK_TREE_SORTABLE(store);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1163 gtk_tree_sortable_set_sort_column_id(sortable, 0, GTK_SORT_ASCENDING);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1164
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1165
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1166 view = gtk_tree_view_new();
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1167 renderer = gtk_cell_renderer_text_new();
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1168 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1,
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1169 _("Presets"), renderer,
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1170 "text", 0, NULL);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1171 gtk_tree_view_set_model(GTK_TREE_VIEW(view), model);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1172 g_object_unref(model);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1173
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1174 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1175 gtk_tree_selection_set_mode(selection, sel_mode);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1176
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1177
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1178
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1179
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1180 gtk_container_add(GTK_CONTAINER(scrolled_window), view);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1181 gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1182
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1183 if (entry) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1184 *entry = gtk_entry_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1185 g_signal_connect(*entry, "activate", action_func, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1186 gtk_box_pack_start(GTK_BOX(vbox), *entry, FALSE, FALSE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1187 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1188
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1189 bbox = gtk_hbutton_box_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1190 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1191 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1192 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1193
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1194 button_cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1195 g_signal_connect_swapped(button_cancel, "clicked",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1196 G_CALLBACK(gtk_widget_destroy),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1197 GTK_OBJECT(*window));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1198 gtk_box_pack_start(GTK_BOX(bbox), button_cancel, TRUE, TRUE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1199
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1200 button_action = gtk_button_new_from_stock(action_name);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1201 g_signal_connect(button_action, "clicked", G_CALLBACK(action_func), view);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1202 GTK_WIDGET_SET_FLAGS(button_action, GTK_CAN_DEFAULT);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1203
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1204 if (select_row_func)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1205 g_signal_connect(view, "row-activated", G_CALLBACK(select_row_func), NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1206
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1207
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1208 gtk_box_pack_start(GTK_BOX(bbox), button_action, TRUE, TRUE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1209
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1210 gtk_widget_grab_default(button_action);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1211
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1212
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1213 gtk_widget_show_all(*window);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1214
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1215 return *window;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1216 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1217
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1218 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1219 equalizerwin_load_auto_preset(const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1220 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1221 gchar *presetfilename, *directory;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1222 RcFile *rcfile;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1223
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1224 g_return_if_fail(filename != NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1225
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1226 if (!cfg.equalizer_autoload)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1227 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1228
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1229 presetfilename = g_strconcat(filename, ".", cfg.eqpreset_extension, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1230
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1231 /* First try to find a per file preset file */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1232 if (strlen(cfg.eqpreset_extension) > 0 &&
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1233 (rcfile = bmp_rcfile_open(presetfilename)) != NULL) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1234 g_free(presetfilename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1235 equalizerwin_read_bmp_preset(rcfile);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1236 bmp_rcfile_free(rcfile);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1237 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1238 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1239
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1240 g_free(presetfilename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1241
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1242 directory = g_path_get_dirname(filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1243 presetfilename = g_build_filename(directory, cfg.eqpreset_default_file,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1244 NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1245 g_free(directory);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1246
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1247 /* Try to find a per directory preset file */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1248 if (strlen(cfg.eqpreset_default_file) > 0 &&
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1249 (rcfile = bmp_rcfile_open(presetfilename)) != NULL) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1250 equalizerwin_read_bmp_preset(rcfile);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1251 bmp_rcfile_free(rcfile);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1252 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1253 else if (!equalizerwin_load_preset
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1254 (equalizer_auto_presets, g_basename(filename))) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1255 /* Fall back to the oldstyle auto presets */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1256 equalizerwin_load_preset(equalizer_presets, "Default");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1257 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1258
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1259 g_free(presetfilename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1260 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1261
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1262 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1263 equalizerwin_set_preamp(gfloat preamp)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1264 {
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1265 ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, preamp);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1266 equalizerwin_eq_changed();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1267 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1268
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1269 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1270 equalizerwin_set_band(gint band, gfloat value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1271 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1272 g_return_if_fail(band >= 0 && band < 10);
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1273 ui_skinned_equalizer_slider_set_position(equalizerwin_bands[band], value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1274 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1275
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1276 gfloat
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1277 equalizerwin_get_preamp(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1278 {
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1279 return ui_skinned_equalizer_slider_get_position(equalizerwin_preamp);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1280 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1281
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1282 gfloat
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1283 equalizerwin_get_band(gint band)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1284 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1285 g_return_val_if_fail(band >= 0 && band < 10, 0);
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1286 return ui_skinned_equalizer_slider_get_position(equalizerwin_bands[band]);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1287 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1288
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1289 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1290 action_equ_load_preset(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1291 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1292 if (equalizerwin_load_window) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1293 gtk_window_present(GTK_WINDOW(equalizerwin_load_window));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1294 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1295 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1296
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1297 equalizerwin_create_list_window(equalizer_presets,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1298 Q_("Load preset"),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1299 &equalizerwin_load_window,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1300 GTK_SELECTION_SINGLE, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1301 GTK_STOCK_OK,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1302 G_CALLBACK(equalizerwin_load_ok),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1303 G_CALLBACK(equalizerwin_load_select));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1304 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1305
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1306 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1307 action_equ_load_auto_preset(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1308 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1309 if (equalizerwin_load_auto_window) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1310 gtk_window_present(GTK_WINDOW(equalizerwin_load_auto_window));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1311 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1312 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1314 equalizerwin_create_list_window(equalizer_auto_presets,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1315 Q_("Load auto-preset"),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1316 &equalizerwin_load_auto_window,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1317 GTK_SELECTION_SINGLE, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1318 GTK_STOCK_OK,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1319 G_CALLBACK(equalizerwin_load_auto_ok),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1320 G_CALLBACK(equalizerwin_load_auto_select));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1321 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1322
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1323 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1324 action_equ_load_default_preset(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1325 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1326 equalizerwin_load_preset(equalizer_presets, "Default");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1327 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1328
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1329 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1330 action_equ_zero_preset(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1331 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1332 gint i;
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1333
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1334 ui_skinned_equalizer_slider_set_position(equalizerwin_preamp, 0);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1335 for (i = 0; i < 10; i++)
3098
821a712c08a3 replace EqSlider with UiSkinnedEqualizerSlider
Tomasz Mon <desowin@gmail.com>
parents: 3077
diff changeset
1336 ui_skinned_equalizer_slider_set_position(equalizerwin_bands[i], 0);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1337
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1338 equalizerwin_eq_changed();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1339 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1340
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1341 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1342 action_equ_load_preset_file(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1343 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1344 GtkWidget *dialog;
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1345 gchar *filename;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1346
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1347 dialog = make_filebrowser(Q_("Load equalizer preset"), FALSE);
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1348 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1349 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1350 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1351 load_preset_file(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1352 g_free(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1353 }
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1354 gtk_widget_destroy(dialog);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1355 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1356
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1357 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1358 action_equ_load_preset_eqf(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1359 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1360 GtkWidget *dialog;
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1361 gchar *filename;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1362
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1363 dialog = make_filebrowser(Q_("Load equalizer preset"), FALSE);
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1364 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1365 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1366 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1367 load_winamp_file(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1368 g_free(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1369 }
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1370 gtk_widget_destroy(dialog);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1371 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1372
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1373 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1374 action_equ_import_winamp_presets(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1375 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1376 GtkWidget *dialog;
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1377 gchar *filename;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1378
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1379 dialog = make_filebrowser(Q_("Load equalizer preset"), FALSE);
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1380 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1381 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1382 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1383 import_winamp_file(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1384 g_free(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1385 }
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1386 gtk_widget_destroy(dialog);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1387 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1388
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1389 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1390 action_equ_save_preset(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1391 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1392 if (equalizerwin_save_window) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1393 gtk_window_present(GTK_WINDOW(equalizerwin_save_window));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1394 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1395 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1396
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1397 equalizerwin_create_list_window(equalizer_presets,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1398 Q_("Save preset"),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1399 &equalizerwin_save_window,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1400 GTK_SELECTION_SINGLE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1401 &equalizerwin_save_entry,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1402 GTK_STOCK_OK,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1403 G_CALLBACK(equalizerwin_save_ok),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1404 G_CALLBACK(equalizerwin_save_select));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1405 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1406
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1407 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1408 action_equ_save_auto_preset(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1409 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1410 gchar *name;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1411 Playlist *playlist = playlist_get_active();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1412
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1413 if (equalizerwin_save_auto_window)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1414 gtk_window_present(GTK_WINDOW(equalizerwin_save_auto_window));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1415 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1416 equalizerwin_create_list_window(equalizer_auto_presets,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1417 Q_("Save auto-preset"),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1418 &equalizerwin_save_auto_window,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1419 GTK_SELECTION_SINGLE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1420 &equalizerwin_save_auto_entry,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1421 GTK_STOCK_OK,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1422 G_CALLBACK(equalizerwin_save_auto_ok),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1423 G_CALLBACK(equalizerwin_save_auto_select));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1424
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1425 name = playlist_get_filename(playlist, playlist_get_position(playlist));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1426 if (name) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1427 gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_auto_entry),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1428 g_basename(name));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1429 g_free(name);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1430 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1431 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1432
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1433 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1434 action_equ_save_default_preset(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1435 {
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1436 equalizer_presets =
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1437 equalizerwin_save_preset(equalizer_presets, Q_("Default"), "eq.preset");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1438 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1439
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1440 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1441 action_equ_save_preset_file(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1442 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1443 GtkWidget *dialog;
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1444 gchar *filename;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1445 gchar *songname;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1446 Playlist *playlist = playlist_get_active();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1447
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1448 dialog = make_filebrowser(Q_("Save equalizer preset"), TRUE);
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1449 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1450 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1451 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1452 save_preset_file(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1453 g_free(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1454 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1455
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1456 songname = playlist_get_filename(playlist, playlist_get_position(playlist));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1457 if (songname) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1458 gchar *eqname = g_strdup_printf("%s.%s", songname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1459 cfg.eqpreset_extension);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1460 g_free(songname);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1461 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1462 eqname);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1463 g_free(eqname);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1464 }
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1465
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1466 gtk_widget_destroy(dialog);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1467 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1468
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1469 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1470 action_equ_save_preset_eqf(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1471 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1472 GtkWidget *dialog;
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1473 gchar *filename;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1474
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1475 dialog = make_filebrowser(Q_("Save equalizer preset"), TRUE);
2514
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1476 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1477 {
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1478 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1479 save_winamp_file(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1480 g_free(filename);
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1481 }
7934ac463591 [svn] - removed unused function bmp_menu_translate()
mf0102
parents: 2497
diff changeset
1482 gtk_widget_destroy(dialog);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1483 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1484
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1485 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1486 action_equ_delete_preset(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1487 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1488 if (equalizerwin_delete_window) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1489 gtk_window_present(GTK_WINDOW(equalizerwin_delete_window));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1490 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1491 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1492
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1493 equalizerwin_create_list_window(equalizer_presets,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1494 Q_("Delete preset"),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1495 &equalizerwin_delete_window,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1496 GTK_SELECTION_EXTENDED, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1497 GTK_STOCK_DELETE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1498 G_CALLBACK(equalizerwin_delete_delete),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1499 NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1500 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1501
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1502 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1503 action_equ_delete_auto_preset(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1504 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1505 if (equalizerwin_delete_auto_window) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1506 gtk_window_present(GTK_WINDOW(equalizerwin_delete_auto_window));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1507 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1508 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1509
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1510 equalizerwin_create_list_window(equalizer_auto_presets,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1511 Q_("Delete auto-preset"),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1512 &equalizerwin_delete_auto_window,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1513 GTK_SELECTION_EXTENDED, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1514 GTK_STOCK_DELETE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1515 G_CALLBACK(equalizerwin_delete_auto_delete),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1516 NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1517 }