Mercurial > audlegacy
annotate src/audacious/legacy/ui_equalizer.c @ 4732:65d67970fab7
Move the slider bar to the toolbar, but this is kinda ugly at the moment.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Thu, 17 Jul 2008 04:20:10 -0500 |
parents | 7e0685ceeb86 |
children |
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 |
4718 | 165 cfg.equalizer_preamp = equalizerwin_get_preamp(); |
4700
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++) |
4718 | 167 cfg.equalizer_bands[i] = equalizerwin_get_band(i); |
4700
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 |
4718 | 183 equalizerwin_set_preamp(preset->preamp); |
184 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) | |
185 equalizerwin_set_band(i, preset->bands[i]); | |
4711
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 |
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
188 static void |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
189 equalizerwin_on_pushed(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
190 { |
4718 | 191 equalizerwin_activate(!cfg.equalizer_active); |
4700
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
194 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
195 equalizerwin_presets_pushed(void) |
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 GdkModifierType modmask; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
198 gint x, y; |
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 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
|
201 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
|
202 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
203 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
204 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
205 equalizerwin_auto_pushed(void) |
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 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
|
208 } |
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 gboolean |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
211 equalizerwin_press(GtkWidget * widget, GdkEventButton * event, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
212 gpointer callback_data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
213 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
214 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
|
215 && event->y < 14) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
216 equalizerwin_set_shade(!cfg.equalizer_shaded); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
217 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
|
218 dock_move_release(GTK_WINDOW(equalizerwin)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
219 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
220 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
221 if (event->button == 3) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
222 /* |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
223 * 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
|
224 * anything to be selected initially. |
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 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
|
227 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
|
228 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
229 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
230 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
231 return FALSE; |
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 static gboolean |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
235 equalizerwin_keypress(GtkWidget * widget, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
236 GdkEventKey * event, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
237 gpointer data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
238 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
239 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
|
240 if (cfg.playlist_visible) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
241 gtk_window_present(GTK_WINDOW(playlistwin)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
242 else if (cfg.player_visible) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
243 gtk_window_present(GTK_WINDOW(mainwin)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
244 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
245 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
246 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
247 if (!cfg.equalizer_shaded) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
248 gtk_widget_event(mainwin, (GdkEvent *) event); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
249 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
250 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
251 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
252 switch (event->keyval) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
253 case GDK_Left: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
254 case GDK_KP_Left: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
255 mainwin_set_balance_diff(-4); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
256 break; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
257 case GDK_Right: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
258 case GDK_KP_Right: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
259 mainwin_set_balance_diff(4); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
260 break; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
261 default: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
262 gtk_widget_event(mainwin, (GdkEvent *) event); |
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 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
265 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
266 return FALSE; |
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 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
270 equalizerwin_close_cb(void) |
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 equalizerwin_show(FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
273 } |
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 static gboolean |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
276 equalizerwin_delete(GtkWidget * widget, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
277 gpointer data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
278 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
279 equalizerwin_show(FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
280 return TRUE; |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
283 gint |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
284 equalizerwin_volume_frame_cb(gint pos) |
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 if (equalizerwin_volume) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
287 gint x; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
288 if (pos < 32) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
289 x = 1; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
290 else if (pos < 63) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
291 x = 4; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
292 else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
293 x = 7; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
294 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
295 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
|
296 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
|
297 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
298 return 1; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
299 } |
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 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
302 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
|
303 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
304 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
|
305 mainwin_adjust_volume_motion(v); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
306 mainwin_set_volume_slider(v); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
307 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
308 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
309 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
310 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
|
311 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
312 mainwin_adjust_volume_release(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
313 } |
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 static gint |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
316 equalizerwin_balance_frame_cb(gint pos) |
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 if (equalizerwin_balance) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
319 gint x; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
320 if (pos < 13) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
321 x = 11; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
322 else if (pos < 26) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
323 x = 14; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
324 else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
325 x = 17; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
326 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
327 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
|
328 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
|
329 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
330 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
331 return 1; |
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 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
335 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
|
336 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
337 gint b; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
338 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
|
339 for the balance-slider *sigh* */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
340 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
|
341 mainwin_adjust_balance_motion(b); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
342 mainwin_set_balance_slider(b); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
343 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
344 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
345 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
346 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
|
347 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
348 mainwin_adjust_balance_release(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
349 } |
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 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
352 equalizerwin_set_balance_slider(gint percent) |
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 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
|
355 (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
|
356 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
357 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
358 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
359 equalizerwin_set_volume_slider(gint percent) |
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 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
|
362 (gint) rint(percent * 94 / 100.0)); |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
365 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
366 equalizerwin_create_widgets(void) |
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 gint i; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
369 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
370 equalizerwin_on = ui_skinned_button_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
371 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
|
372 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
|
373 g_signal_connect(equalizerwin_on, "clicked", equalizerwin_on_pushed, NULL); |
4718 | 374 equalizerwin_activate(cfg.equalizer_active); |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
375 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
376 equalizerwin_auto = ui_skinned_button_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
377 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
|
378 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
|
379 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
|
380 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
|
381 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
382 equalizerwin_presets = ui_skinned_button_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
383 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
|
384 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
|
385 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
|
386 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
387 equalizerwin_close = ui_skinned_button_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
388 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
|
389 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
|
390 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
|
391 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
392 equalizerwin_shade = ui_skinned_button_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
393 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
|
394 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
|
395 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
|
396 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
|
397 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
398 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
|
399 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
400 equalizerwin_preamp = ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->fixed, 21, 38); |
4718 | 401 equalizerwin_set_preamp(cfg.equalizer_preamp); |
4700
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 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
|
404 equalizerwin_bands[i] = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
405 ui_skinned_equalizer_slider_new(SKINNED_WINDOW(equalizerwin)->fixed, 78 + (i * 18), 38); |
4718 | 406 equalizerwin_set_band(i, cfg.equalizer_bands[i]); |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
407 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
408 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
409 equalizerwin_volume = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
410 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
|
411 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
|
412 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
|
413 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
|
414 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
|
415 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
416 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
417 equalizerwin_balance = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
418 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
|
419 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
|
420 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
|
421 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
|
422 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
|
423 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
424 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
425 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
426 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
427 equalizerwin_create_window(void) |
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 GdkPixbuf *icon; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
430 gint width, height; |
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 width = 275; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
433 height = cfg.equalizer_shaded ? 14 : 116; |
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 equalizerwin = ui_skinned_window_new("equalizer"); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
436 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
|
437 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
|
438 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
|
439 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
440 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
|
441 width *= cfg.scale_factor; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
442 height *= cfg.scale_factor; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
443 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
444 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
445 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
|
446 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
447 /* 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
|
448 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
|
449 GTK_WINDOW(mainwin)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
450 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
|
451 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
452 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
|
453 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
|
454 g_object_unref(icon); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
455 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
456 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
|
457 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
458 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
|
459 gtk_window_move(GTK_WINDOW(equalizerwin), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
460 cfg.equalizer_x, cfg.equalizer_y); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
461 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
462 g_signal_connect(equalizerwin, "delete_event", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
463 G_CALLBACK(equalizerwin_delete), NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
464 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
|
465 G_CALLBACK(equalizerwin_press), NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
466 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
|
467 G_CALLBACK(equalizerwin_keypress), NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
468 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
469 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
470 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
471 equalizerwin_create(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
472 { |
4703
49ea99d333e9
begin seperating equalizer preset from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4700
diff
changeset
|
473 equalizer_presets = equalizer_read_presets("eq.preset"); |
49ea99d333e9
begin seperating equalizer preset from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4700
diff
changeset
|
474 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
|
475 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
476 equalizerwin_create_window(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
477 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
478 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
|
479 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
480 equalizerwin_create_widgets(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
481 } |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
484 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
485 equalizerwin_show(gboolean show) |
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 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
|
488 toggleaction_group_others , "show equalizer" ); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
489 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
|
490 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
491 if (show) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
492 equalizerwin_real_show(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
493 else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
494 equalizerwin_real_hide(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
495 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
496 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
497 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
498 equalizerwin_real_show(void) |
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 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
|
501 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
|
502 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
|
503 ((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
|
504 else |
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, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
506 (cfg.equalizer_shaded ? 14 : 116)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
507 cfg.equalizer_visible = TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
508 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
|
509 gtk_widget_show_all(equalizerwin); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
510 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
511 if (!cfg.equalizer_shaded) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
512 gtk_widget_hide(equalizerwin_volume); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
513 gtk_widget_hide(equalizerwin_balance); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
514 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
515 else { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
516 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
|
517 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
|
518 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
|
519 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
|
520 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
521 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
522 gtk_window_present(GTK_WINDOW(equalizerwin)); |
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 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
526 equalizerwin_real_hide(void) |
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 /* |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
529 * 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
|
530 * main menu signal handler |
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 gtk_widget_hide(equalizerwin); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
533 cfg.equalizer_visible = FALSE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
534 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
|
535 gtk_widget_queue_draw(mainwin_eq); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
536 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
537 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
538 static EqualizerPreset * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
539 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
|
540 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
541 GList *node = list; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
542 EqualizerPreset *preset; |
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 while (node) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
545 preset = node->data; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
546 if (!strcasecmp(preset->name, name)) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
547 return preset; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
548 node = g_list_next(node); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
549 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
550 return NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
551 } |
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 static gboolean |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
554 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
|
555 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
556 EqualizerPreset *preset; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
557 gint i; |
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 if ((preset = equalizerwin_find_preset(list, name)) != NULL) { |
4718 | 560 equalizerwin_set_preamp(preset->preamp); |
561 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) | |
562 equalizerwin_set_band(i, preset->bands[i]); | |
563 | |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
564 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
565 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
566 return FALSE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
567 } |
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 static GList * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
570 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
|
571 const gchar * filename) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
572 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
573 gint i; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
574 EqualizerPreset *preset; |
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 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
|
577 preset = g_new0(EqualizerPreset, 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
578 preset->name = g_strdup(name); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
579 list = g_list_append(list, preset); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
580 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
581 |
4718 | 582 preset->preamp = equalizerwin_get_preamp(); |
583 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) | |
584 preset->bands[i] = equalizerwin_get_band(i); | |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
585 |
4703
49ea99d333e9
begin seperating equalizer preset from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4700
diff
changeset
|
586 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
|
587 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
588 return list; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
589 } |
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 static GList * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
592 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
|
593 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
594 EqualizerPreset *preset; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
595 GList *node; |
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 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
|
598 return list; |
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 (!(node = g_list_find(list, preset))) |
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 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
|
604 equalizer_preset_free(preset); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
605 g_list_free_1(node); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
606 |
4703
49ea99d333e9
begin seperating equalizer preset from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4700
diff
changeset
|
607 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
|
608 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
609 return list; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
610 } |
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 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
613 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
|
614 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
615 gchar *text; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
616 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
617 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
|
618 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
|
619 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
620 /* |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
621 * 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
|
622 * 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
|
623 * 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
|
624 * 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
|
625 * 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
|
626 */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
627 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
628 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
|
629 GList *rrefs = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
630 GList *litr; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
631 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
632 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
|
633 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
634 GtkTreePath *path = litr->data; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
635 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
|
636 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
637 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
638 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
|
639 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
640 GtkTreeRowReference *ref = litr->data; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
641 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
|
642 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
643 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
|
644 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
645 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
|
646 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
647 if (!strcmp(filename, "eq.preset")) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
648 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
|
649 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
|
650 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
|
651 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
652 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
|
653 } |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
656 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
657 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
|
658 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
659 equalizer_preset_free((EqualizerPreset*)data); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
660 } |
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 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
663 equalizerwin_read_winamp_eqf(VFSFile * file) |
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 GList *presets; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
666 gint i; |
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 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
|
669 return; |
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 /* just get the first preset --asphyx */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
672 EqualizerPreset *preset = (EqualizerPreset*)presets->data; |
4718 | 673 equalizerwin_set_preamp(preset->preamp); |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
674 |
4718 | 675 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
676 equalizerwin_set_band(i, preset->bands[i]); | |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
677 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
678 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
|
679 g_list_free(presets); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
680 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
681 equalizerwin_eq_changed(); |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
684 static void |
4711
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
685 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
|
686 { |
4711
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
687 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
|
688 if (preset) { |
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
689 equalizerwin_apply_preset(preset); |
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
690 equalizer_preset_free(preset); |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
691 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
692 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
693 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
694 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
695 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
|
696 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
697 const gchar *text; |
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 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
|
700 if (strlen(text) != 0) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
701 equalizer_presets = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
702 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
|
703 gtk_widget_destroy(equalizerwin_save_window); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
704 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
705 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
706 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
707 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
|
708 GtkTreeViewColumn *col, gpointer data) |
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 gchar *text; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
711 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
712 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
|
713 GtkTreeModel *model; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
714 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
715 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
716 if (selection) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
717 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
718 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
|
719 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
720 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
|
721 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
|
722 equalizerwin_save_ok(NULL, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
723 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
724 g_free(text); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
725 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
726 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
727 } |
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 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
730 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
|
731 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
732 gchar *text; |
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 GtkTreeView* view = GTK_TREE_VIEW(data); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
735 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
|
736 GtkTreeModel *model; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
737 GtkTreeIter iter; |
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 if (selection) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
740 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
741 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
|
742 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
743 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
|
744 equalizerwin_load_preset(equalizer_presets, text); |
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 g_free(text); |
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 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
749 gtk_widget_destroy(equalizerwin_load_window); |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
752 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
753 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
|
754 GtkTreeViewColumn *col, gpointer data) |
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 equalizerwin_load_ok(NULL, treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
757 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
758 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
759 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
760 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
|
761 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
762 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
|
763 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
764 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
765 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
766 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
|
767 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
768 const gchar *text; |
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 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
|
771 if (strlen(text) != 0) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
772 equalizer_auto_presets = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
773 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
|
774 "eq.auto_preset"); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
775 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
|
776 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
777 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
778 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
779 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
|
780 GtkTreeViewColumn *col, gpointer data) |
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 gchar *text; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
783 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
784 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
|
785 GtkTreeModel *model; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
786 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
787 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
788 if (selection) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
789 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
790 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
|
791 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
792 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
|
793 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
|
794 equalizerwin_save_auto_ok(NULL, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
795 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
796 g_free(text); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
797 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
798 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
799 } |
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 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
802 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
|
803 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
804 gchar *text; |
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 GtkTreeView *view = GTK_TREE_VIEW(data); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
807 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
|
808 GtkTreeModel *model; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
809 GtkTreeIter iter; |
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 if (selection) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
812 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
813 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
|
814 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
815 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
|
816 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
|
817 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
818 g_free(text); |
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 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
821 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
|
822 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
823 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
824 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
825 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
|
826 GtkTreeViewColumn *col, gpointer data) |
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 equalizerwin_load_auto_ok(NULL, treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
829 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
830 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
831 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
832 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
|
833 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
834 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
|
835 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
836 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
837 static VFSFile * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
838 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
|
839 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
840 VFSFile *file; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
841 GtkWidget *dialog; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
842 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
843 if (!(file = vfs_fopen(filename, mode))) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
844 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
|
845 GTK_DIALOG_DESTROY_WITH_PARENT, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
846 GTK_MESSAGE_ERROR, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
847 GTK_BUTTONS_CLOSE, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
848 "Error loading file '%s'", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
849 filename); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
850 gtk_dialog_run (GTK_DIALOG (dialog)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
851 gtk_widget_destroy (dialog); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
852 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
853 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
854 return file; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
855 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
856 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
857 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
858 load_winamp_file(const gchar * filename) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
859 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
860 VFSFile *file; |
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 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
|
863 return; |
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 equalizerwin_read_winamp_eqf(file); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
866 vfs_fclose(file); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
867 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
868 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
869 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
870 import_winamp_file(const gchar * filename) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
871 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
872 VFSFile *file; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
873 GList *list; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
874 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
875 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
|
876 !(list = import_winamp_eqf(file))) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
877 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
878 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
879 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
|
880 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
|
881 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
882 vfs_fclose(file); |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
885 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
886 save_winamp_file(const gchar * filename) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
887 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
888 VFSFile *file; |
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 gchar name[257]; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
891 gint i; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
892 guchar bands[11]; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
893 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
894 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
|
895 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
896 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
897 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
|
898 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
899 memset(name, 0, 257); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
900 g_strlcpy(name, "Entry1", 257); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
901 vfs_fwrite(name, 1, 257, file); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
902 |
4718 | 903 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) |
904 bands[i] = 63 - (((equalizerwin_get_band(i) + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); | |
905 | |
906 bands[AUD_EQUALIZER_NBANDS] = 63 - (((equalizerwin_get_preamp() + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); | |
907 | |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
908 vfs_fwrite(bands, 1, 11, file); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
909 vfs_fclose(file); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
910 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
911 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
912 static GtkWidget * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
913 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
|
914 const gchar *title, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
915 GtkWidget **window, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
916 GtkSelectionMode sel_mode, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
917 GtkWidget **entry, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
918 const gchar *action_name, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
919 GCallback action_func, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
920 GCallback select_row_func) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
921 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
922 GtkWidget *vbox, *scrolled_window, *bbox, *view; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
923 GtkWidget *button_cancel, *button_action; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
924 GList *node; |
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 GtkListStore *store; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
927 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
928 GtkTreeModel *model; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
929 GtkCellRenderer *renderer; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
930 GtkTreeSelection *selection; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
931 GtkTreeSortable *sortable; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
932 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
933 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
934 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
935 *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
|
936 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
|
937 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
|
938 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
|
939 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
|
940 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
|
941 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
|
942 GTK_WINDOW(equalizerwin)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
943 g_signal_connect(*window, "destroy", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
944 G_CALLBACK(gtk_widget_destroyed), window); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
945 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
946 vbox = gtk_vbox_new(FALSE, 10); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
947 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
|
948 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
949 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
|
950 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
|
951 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
954 /* 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
|
955 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
|
956 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
|
957 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
958 gtk_list_store_append(store, &iter); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
959 gtk_list_store_set(store, &iter, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
960 0, ((EqualizerPreset*)node->data)->name, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
961 -1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
962 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
963 model = GTK_TREE_MODEL(store); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
964 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
965 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
966 sortable = GTK_TREE_SORTABLE(store); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
967 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
|
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 view = gtk_tree_view_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
971 renderer = gtk_cell_renderer_text_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
972 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
|
973 _("Presets"), renderer, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
974 "text", 0, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
975 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
|
976 g_object_unref(model); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
977 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
978 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
|
979 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
|
980 |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
983 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
984 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
|
985 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
|
986 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
987 if (entry) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
988 *entry = gtk_entry_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
989 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
|
990 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
|
991 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
992 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
993 bbox = gtk_hbutton_box_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
994 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
|
995 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
|
996 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
|
997 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
998 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
|
999 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
|
1000 G_CALLBACK(gtk_widget_destroy), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1001 GTK_OBJECT(*window)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1002 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
|
1003 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1004 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
|
1005 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
|
1006 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
|
1007 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1008 if (select_row_func) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1009 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
|
1010 |
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 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
|
1013 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1014 gtk_widget_grab_default(button_action); |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1017 gtk_widget_show_all(*window); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1018 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1019 return *window; |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1022 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1023 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
|
1024 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1025 gchar *presetfilename, *directory; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1026 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1027 g_return_if_fail(filename != NULL); |
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 if (!cfg.equalizer_autoload) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1030 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1031 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1032 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
|
1033 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1034 /* 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
|
1035 if (strlen(cfg.eqpreset_extension) > 0) { |
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
1036 equalizerwin_read_aud_preset(presetfilename); |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1037 g_free(presetfilename); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1038 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1039 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1040 |
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1043 directory = g_path_get_dirname(filename); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1044 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
|
1045 NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1046 g_free(directory); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1047 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1048 /* 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
|
1049 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
|
1050 equalizerwin_read_aud_preset(presetfilename); |
4700
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 else if (!equalizerwin_load_preset |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1053 (equalizer_auto_presets, g_basename(filename))) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1054 /* 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
|
1055 equalizerwin_load_preset(equalizer_presets, "Default"); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1056 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1057 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1058 g_free(presetfilename); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1059 } |
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 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1062 equalizerwin_set_preamp(gfloat preamp) |
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 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
|
1065 equalizerwin_eq_changed(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1066 } |
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 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1069 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
|
1070 { |
4718 | 1071 g_return_if_fail(band >= 0 && band < AUD_EQUALIZER_NBANDS); |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1072 ui_skinned_equalizer_slider_set_position(equalizerwin_bands[band], value); |
4718 | 1073 equalizerwin_eq_changed(); |
4700
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 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1076 gfloat |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1077 equalizerwin_get_preamp(void) |
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 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
|
1080 } |
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 gfloat |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1083 equalizerwin_get_band(gint band) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1084 { |
4718 | 1085 g_return_val_if_fail(band >= 0 && band < AUD_EQUALIZER_NBANDS, 0.0); |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1086 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
|
1087 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1088 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1089 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1090 action_equ_load_preset(void) |
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 if (equalizerwin_load_window) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1093 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
|
1094 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1095 } |
4711
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
1096 |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1097 equalizerwin_create_list_window(equalizer_presets, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1098 Q_("Load preset"), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1099 &equalizerwin_load_window, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1100 GTK_SELECTION_SINGLE, NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1101 GTK_STOCK_OK, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1102 G_CALLBACK(equalizerwin_load_ok), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1103 G_CALLBACK(equalizerwin_load_select)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1104 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1105 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1106 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1107 action_equ_load_auto_preset(void) |
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 if (equalizerwin_load_auto_window) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1110 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
|
1111 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1112 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1113 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1114 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
|
1115 Q_("Load auto-preset"), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1116 &equalizerwin_load_auto_window, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1117 GTK_SELECTION_SINGLE, NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1118 GTK_STOCK_OK, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1119 G_CALLBACK(equalizerwin_load_auto_ok), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1120 G_CALLBACK(equalizerwin_load_auto_select)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1121 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1122 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1123 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1124 action_equ_load_default_preset(void) |
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 equalizerwin_load_preset(equalizer_presets, "Default"); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1127 } |
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 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1130 action_equ_zero_preset(void) |
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 gint i; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1133 |
4718 | 1134 equalizerwin_set_preamp(0); |
1135 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) | |
1136 equalizerwin_set_band(i, 0); | |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1137 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1138 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1139 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1140 action_equ_load_preset_file(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1141 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1142 GtkWidget *dialog; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1143 gchar *file_uri; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1144 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1145 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
|
1146 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
|
1147 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1148 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
|
1149 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
|
1150 equalizerwin_apply_preset(preset); |
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
1151 equalizer_preset_free(preset); |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1152 g_free(file_uri); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1153 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1154 gtk_widget_destroy(dialog); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1155 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1156 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1157 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1158 action_equ_load_preset_eqf(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1159 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1160 GtkWidget *dialog; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1161 gchar *file_uri; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1162 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1163 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
|
1164 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
|
1165 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1166 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
|
1167 load_winamp_file(file_uri); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1168 g_free(file_uri); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1169 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1170 gtk_widget_destroy(dialog); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1171 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1172 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1173 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1174 action_equ_import_winamp_presets(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1175 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1176 GtkWidget *dialog; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1177 gchar *file_uri; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1178 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1179 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
|
1180 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
|
1181 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1182 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
|
1183 import_winamp_file(file_uri); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1184 g_free(file_uri); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1185 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1186 gtk_widget_destroy(dialog); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1187 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1188 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1189 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1190 action_equ_save_preset(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1191 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1192 if (equalizerwin_save_window) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1193 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
|
1194 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1195 } |
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 equalizerwin_create_list_window(equalizer_presets, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1198 Q_("Save preset"), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1199 &equalizerwin_save_window, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1200 GTK_SELECTION_SINGLE, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1201 &equalizerwin_save_entry, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1202 GTK_STOCK_OK, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1203 G_CALLBACK(equalizerwin_save_ok), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1204 G_CALLBACK(equalizerwin_save_select)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1205 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1206 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1207 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1208 action_equ_save_auto_preset(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1209 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1210 gchar *name; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1211 Playlist *playlist = playlist_get_active(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1212 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1213 if (equalizerwin_save_auto_window) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1214 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
|
1215 else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1216 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
|
1217 Q_("Save auto-preset"), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1218 &equalizerwin_save_auto_window, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1219 GTK_SELECTION_SINGLE, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1220 &equalizerwin_save_auto_entry, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1221 GTK_STOCK_OK, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1222 G_CALLBACK(equalizerwin_save_auto_ok), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1223 G_CALLBACK(equalizerwin_save_auto_select)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1224 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1225 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
|
1226 if (name) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1227 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
|
1228 g_basename(name)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1229 g_free(name); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1230 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1231 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1232 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1233 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1234 action_equ_save_default_preset(void) |
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 equalizer_presets = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1237 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
|
1238 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1239 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1240 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1241 action_equ_save_preset_file(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1242 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1243 GtkWidget *dialog; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1244 gchar *file_uri; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1245 gchar *songname; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1246 Playlist *playlist = playlist_get_active(); |
4711
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
1247 int i; |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1248 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1249 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
|
1250 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
|
1251 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1252 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
|
1253 EqualizerPreset *preset = g_new0(EqualizerPreset, 1); |
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
1254 preset->name = g_strdup(file_uri); |
4718 | 1255 preset->preamp = equalizerwin_get_preamp(); |
1256 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) | |
1257 preset->bands[i] = equalizerwin_get_band(i); | |
4711
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
1258 save_preset_file(preset, file_uri); |
a33facf19590
more work on seperating presets from legacy ui
Tomasz Mon <desowin@gmail.com>
parents:
4706
diff
changeset
|
1259 equalizer_preset_free(preset); |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1260 g_free(file_uri); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1261 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1262 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1263 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
|
1264 if (songname) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1265 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
|
1266 cfg.eqpreset_extension); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1267 g_free(songname); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1268 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
|
1269 eqname); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1270 g_free(eqname); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1271 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1272 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1273 gtk_widget_destroy(dialog); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1274 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1275 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1276 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1277 action_equ_save_preset_eqf(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1278 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1279 GtkWidget *dialog; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1280 gchar *file_uri; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1281 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1282 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
|
1283 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
|
1284 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1285 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
|
1286 save_winamp_file(file_uri); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1287 g_free(file_uri); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1288 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1289 gtk_widget_destroy(dialog); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1290 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1291 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1292 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1293 action_equ_delete_preset(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1294 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1295 if (equalizerwin_delete_window) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1296 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
|
1297 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1298 } |
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 equalizerwin_create_list_window(equalizer_presets, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1301 Q_("Delete preset"), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1302 &equalizerwin_delete_window, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1303 GTK_SELECTION_EXTENDED, NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1304 GTK_STOCK_DELETE, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1305 G_CALLBACK(equalizerwin_delete_delete), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1306 NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1307 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1308 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1309 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1310 action_equ_delete_auto_preset(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1311 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1312 if (equalizerwin_delete_auto_window) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1313 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
|
1314 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1315 } |
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 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
|
1318 Q_("Delete auto-preset"), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1319 &equalizerwin_delete_auto_window, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1320 GTK_SELECTION_EXTENDED, NULL, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1321 GTK_STOCK_DELETE, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1322 G_CALLBACK(equalizerwin_delete_auto_delete), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1323 NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1324 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1325 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1326 void |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
4703
diff
changeset
|
1327 equalizerwin_activate(gboolean active) |
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1328 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1329 cfg.equalizer_active = active; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1330 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
|
1331 gtk_widget_queue_draw(equalizerwin_on); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1332 equalizerwin_eq_changed(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1333 } |