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