Mercurial > audlegacy
annotate src/audacious/ui_main.c @ 4554:961906c766e4
introduce ui_skinned_window_button_press and ui_skinned_window_button_release
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Sun, 18 May 2008 16:54:22 +0200 |
parents | d4c5719d30d1 |
children | 7f8a87023730 |
rev | line source |
---|---|
2313 | 1 /* Audacious - Cross-platform multimedia player |
2 * Copyright (C) 2005-2006 Audacious development team. | |
3 * | |
4 * BMP - Cross-platform multimedia player | |
5 * Copyright (C) 2003-2004 BMP development team. | |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2003 XMMS development team. | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3108
diff
changeset
|
12 * the Free Software Foundation; under version 3 of the License. |
2313 | 13 * |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3108
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3123
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
21 * |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
22 * The Audacious team does not consider modular code linking to |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
23 * Audacious or using our public API to be a derived work. |
2313 | 24 */ |
25 | |
26 #ifdef HAVE_CONFIG_H | |
27 # include "config.h" | |
28 #endif | |
29 | |
30 #include <glib.h> | |
31 #include <glib/gi18n.h> | |
32 #include <glib/gprintf.h> | |
33 #include <gtk/gtk.h> | |
34 #include <gtk/gtkmessagedialog.h> | |
4505 | 35 #include <math.h> |
36 #include <stdlib.h> | |
37 #include <string.h> | |
38 #include <sys/types.h> | |
2313 | 39 |
40 /* GDK including */ | |
41 #include "platform/smartinclude.h" | |
42 | |
43 #if defined(USE_REGEX_ONIGURUMA) | |
4513 | 44 #include <onigposix.h> |
2313 | 45 #elif defined(USE_REGEX_PCRE) |
4513 | 46 #include <pcreposix.h> |
2313 | 47 #else |
4513 | 48 #include <regex.h> |
2313 | 49 #endif |
50 | |
51 #include "ui_main.h" | |
52 #include "icons-stock.h" | |
53 | |
54 #include "actions-mainwin.h" | |
2717 | 55 #include "configdb.h" |
2313 | 56 #include "dnd.h" |
57 #include "input.h" | |
4505 | 58 #include "main.h" |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
59 #include "playback.h" |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
60 #include "playlist.h" |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
61 #include "pluginenum.h" |
4505 | 62 #include "strings.h" |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
63 #include "ui_credits.h" |
4546 | 64 #include "ui_dock.h" |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
65 #include "ui_equalizer.h" |
4514
0fe46317167f
renamed playlist_fileinfo* to ui_fileinfo_show* and reworked those
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
66 #include "ui_fileinfo.h" |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
67 #include "ui_fileopener.h" |
4504
a47288ced5d5
- renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents:
4461
diff
changeset
|
68 #include "ui_hints.h" |
4505 | 69 #include "ui_jumptotrack.h" |
70 #include "ui_main_evlisteners.h" | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
71 #include "ui_manager.h" |
2313 | 72 #include "ui_playlist.h" |
73 #include "ui_preferences.h" | |
74 #include "ui_skinselector.h" | |
2422 | 75 #include "ui_urlopener.h" |
2313 | 76 #include "util.h" |
77 #include "visualization.h" | |
78 | |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
2485
diff
changeset
|
79 #include "ui_skinned_window.h" |
2842
c2622a939e9e
rename audacious_pbutton to ui_skinned_button
Tomasz Mon <desowin@gmail.com>
parents:
2840
diff
changeset
|
80 #include "ui_skinned_button.h" |
2911 | 81 #include "ui_skinned_textbox.h" |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
82 #include "ui_skinned_number.h" |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
83 #include "ui_skinned_horizontal_slider.h" |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
84 #include "ui_skinned_menurow.h" |
3072
84de3244aeaa
replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents:
3070
diff
changeset
|
85 #include "ui_skinned_playstatus.h" |
3073
da99b90d63d3
replace MonoStereo with UiSkinnedMonoStereo
Tomasz Mon <desowin@gmail.com>
parents:
3072
diff
changeset
|
86 #include "ui_skinned_monostereo.h" |
3217 | 87 #include "ui_skinned_playlist.h" |
3165
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
3157
diff
changeset
|
88 |
4326 | 89 static GTimeVal cb_time; |
90 static const int TRISTATE_THRESHOLD = 200; | |
2313 | 91 |
92 enum { | |
93 MAINWIN_SEEK_REV = -1, | |
94 MAINWIN_SEEK_NIL, | |
95 MAINWIN_SEEK_FWD | |
96 }; | |
97 | |
98 GtkWidget *mainwin = NULL; | |
99 | |
100 static gint balance; | |
101 | |
102 static GtkWidget *mainwin_jtt = NULL; | |
103 | |
4505 | 104 static gint seek_state = MAINWIN_SEEK_NIL; |
105 static gint seek_initial_pos = 0; | |
2313 | 106 |
2821 | 107 static GtkWidget *mainwin_menubtn; |
108 static GtkWidget *mainwin_minimize, *mainwin_shade, *mainwin_close; | |
109 | |
110 static GtkWidget *mainwin_rew, *mainwin_fwd; | |
111 static GtkWidget *mainwin_eject; | |
112 static GtkWidget *mainwin_play, *mainwin_pause, *mainwin_stop; | |
2313 | 113 |
2853
bec320cfcc12
use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents:
2844
diff
changeset
|
114 static GtkWidget *mainwin_shuffle, *mainwin_repeat; |
bec320cfcc12
use UiSkinnedButton instead of PButton in equalizerwin
Tomasz Mon <desowin@gmail.com>
parents:
2844
diff
changeset
|
115 GtkWidget *mainwin_eq, *mainwin_pl; |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
116 |
3664
9e4edc01a0e3
I don't quite have idea how to make everyone happy with this - reverting 23824a113182 as for now
Tomasz Mon <desowin@gmail.com>
parents:
3600
diff
changeset
|
117 GtkWidget *mainwin_info; |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
118 GtkWidget *mainwin_stime_min, *mainwin_stime_sec; |
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
119 |
4326 | 120 static GtkWidget *mainwin_rate_text, *mainwin_freq_text, *mainwin_othertext; |
2313 | 121 |
3072
84de3244aeaa
replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents:
3070
diff
changeset
|
122 GtkWidget *mainwin_playstatus; |
2313 | 123 |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
124 GtkWidget *mainwin_minus_num, *mainwin_10min_num, *mainwin_min_num; |
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
125 GtkWidget *mainwin_10sec_num, *mainwin_sec_num; |
2313 | 126 |
3020 | 127 GtkWidget *mainwin_vis; |
3054 | 128 GtkWidget *mainwin_svis; |
2313 | 129 |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
130 GtkWidget *mainwin_sposition = NULL; |
2313 | 131 |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
132 static GtkWidget *mainwin_menurow; |
3045
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
133 static GtkWidget *mainwin_volume, *mainwin_balance; |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
134 GtkWidget *mainwin_position; |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
135 |
3073
da99b90d63d3
replace MonoStereo with UiSkinnedMonoStereo
Tomasz Mon <desowin@gmail.com>
parents:
3072
diff
changeset
|
136 static GtkWidget *mainwin_monostereo; |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
137 static GtkWidget *mainwin_srew, *mainwin_splay, *mainwin_spause; |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
138 static GtkWidget *mainwin_sstop, *mainwin_sfwd, *mainwin_seject, *mainwin_about; |
2313 | 139 |
140 static gint mainwin_timeout_id; | |
141 | |
142 static gboolean mainwin_info_text_locked = FALSE; | |
3724
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3718
diff
changeset
|
143 static guint mainwin_volume_release_timeout = 0; |
2313 | 144 |
145 static int ab_position_a = -1; | |
146 static int ab_position_b = -1; | |
147 | |
3241 | 148 static void mainwin_refresh_visible(void); |
2313 | 149 static gint mainwin_idle_func(gpointer data); |
150 | |
151 static void set_timer_mode_menu_cb(TimerMode mode); | |
152 static void set_timer_mode(TimerMode mode); | |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
153 static void change_timer_mode(void); |
2313 | 154 |
4505 | 155 static void mainwin_position_motion_cb(GtkWidget *widget, gint pos); |
156 static void mainwin_position_release_cb(GtkWidget *widget, gint pos); | |
157 | |
158 static void set_scaled(gboolean scaled); | |
159 static void mainwin_eq_pushed(gboolean toggled); | |
160 static void mainwin_pl_pushed(gboolean toggled); | |
2313 | 161 |
162 static void | |
163 mainwin_set_title_scroll(gboolean scroll) | |
164 { | |
165 cfg.autoscroll = scroll; | |
2911 | 166 ui_skinned_textbox_set_scroll(mainwin_info, cfg.autoscroll); |
2313 | 167 } |
168 | |
169 | |
170 void | |
171 mainwin_set_always_on_top(gboolean always) | |
172 { | |
4513 | 173 GtkAction *action = gtk_action_group_get_action(toggleaction_group_others, |
174 "view always on top"); | |
2313 | 175 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , always ); |
176 } | |
177 | |
178 static void | |
179 mainwin_set_shade(gboolean shaded) | |
180 { | |
4513 | 181 GtkAction *action = gtk_action_group_get_action(toggleaction_group_others, |
182 "roll up player"); | |
2313 | 183 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , shaded ); |
184 } | |
185 | |
186 static void | |
187 mainwin_set_shade_menu_cb(gboolean shaded) | |
188 { | |
189 cfg.player_shaded = shaded; | |
190 | |
191 if (shaded) { | |
4517 | 192 dock_shade(get_dock_window_list(), GTK_WINDOW(mainwin), |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
193 MAINWIN_SHADED_HEIGHT * MAINWIN_SCALE_FACTOR); |
3241 | 194 } else { |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
195 gint height = !aud_active_skin->properties.mainwin_height ? MAINWIN_HEIGHT : |
4513 | 196 aud_active_skin->properties.mainwin_height; |
2313 | 197 |
4517 | 198 dock_shade(get_dock_window_list(), GTK_WINDOW(mainwin), height * MAINWIN_SCALE_FACTOR); |
2313 | 199 } |
200 | |
4123
ab59718d8704
- Update mainwin width when (un)shading the main window, as the mainwinWidth skin hint may be different from the proper shaded width.
George Averill <nhjm449@gmail.com>
parents:
4122
diff
changeset
|
201 mainwin_refresh_hints(); |
3006
3c4ed53a685f
use ui_skinned_set_push_button_data instead accessing values directly
Tomasz Mon <desowin@gmail.com>
parents:
3005
diff
changeset
|
202 ui_skinned_set_push_button_data(mainwin_shade, 0, cfg.player_shaded ? 27 : 18, 9, cfg.player_shaded ? 27 : 18); |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
203 gtk_widget_shape_combine_mask(mainwin, skin_get_mask(aud_active_skin, SKIN_MASK_MAIN + cfg.player_shaded), 0, 0); |
2313 | 204 } |
205 | |
206 static void | |
207 mainwin_vis_set_refresh(RefreshRate rate) | |
208 { | |
209 cfg.vis_refresh = rate; | |
210 } | |
211 | |
212 static void | |
213 mainwin_vis_set_afalloff(FalloffSpeed speed) | |
214 { | |
215 cfg.analyzer_falloff = speed; | |
216 } | |
217 | |
218 static void | |
219 mainwin_vis_set_pfalloff(FalloffSpeed speed) | |
220 { | |
221 cfg.peaks_falloff = speed; | |
222 } | |
223 | |
224 static void | |
225 mainwin_vis_set_analyzer_mode(AnalyzerMode mode) | |
226 { | |
227 cfg.analyzer_mode = mode; | |
228 } | |
229 | |
230 static void | |
231 mainwin_vis_set_analyzer_type(AnalyzerType mode) | |
232 { | |
233 cfg.analyzer_type = mode; | |
234 } | |
235 | |
236 void | |
237 mainwin_vis_set_type(VisType mode) | |
238 { | |
239 GtkAction *action; | |
240 | |
241 switch ( mode ) | |
242 { | |
243 case VIS_ANALYZER: | |
4513 | 244 action = gtk_action_group_get_action(radioaction_group_vismode, |
245 "vismode analyzer"); | |
2313 | 246 break; |
247 case VIS_SCOPE: | |
4513 | 248 action = gtk_action_group_get_action(radioaction_group_vismode, |
249 "vismode scope"); | |
2313 | 250 break; |
251 case VIS_VOICEPRINT: | |
4513 | 252 action = gtk_action_group_get_action(radioaction_group_vismode, |
253 "vismode voiceprint"); | |
2313 | 254 break; |
255 case VIS_OFF: | |
256 default: | |
4513 | 257 action = gtk_action_group_get_action(radioaction_group_vismode, |
258 "vismode off"); | |
2313 | 259 break; |
260 } | |
261 | |
262 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , TRUE ); | |
263 } | |
264 | |
265 static void | |
266 mainwin_vis_set_type_menu_cb(VisType mode) | |
267 { | |
268 cfg.vis_type = mode; | |
269 | |
270 if (mode == VIS_OFF) { | |
3054 | 271 if (cfg.player_shaded) { |
272 ui_svis_set_visible(mainwin_svis, FALSE); | |
273 ui_vis_set_visible(mainwin_vis, TRUE); | |
274 } else { | |
275 ui_svis_set_visible(mainwin_svis, TRUE); | |
3020 | 276 ui_vis_set_visible(mainwin_vis, FALSE); |
277 } | |
2313 | 278 } |
279 if (mode == VIS_ANALYZER || mode == VIS_SCOPE || mode == VIS_VOICEPRINT) { | |
3054 | 280 if (cfg.player_shaded) { |
281 ui_svis_clear_data(mainwin_svis); | |
282 ui_svis_set_visible(mainwin_svis, TRUE); | |
283 ui_vis_clear_data(mainwin_vis); | |
284 ui_vis_set_visible(mainwin_vis, FALSE); | |
285 } else { | |
286 ui_svis_clear_data(mainwin_svis); | |
287 ui_svis_set_visible(mainwin_svis, FALSE); | |
288 ui_vis_clear_data(mainwin_vis); | |
289 ui_vis_set_visible(mainwin_vis, TRUE); | |
290 } | |
2313 | 291 } |
292 } | |
293 | |
294 static void | |
295 mainwin_menubtn_cb(void) | |
296 { | |
297 gint x, y; | |
298 gtk_window_get_position(GTK_WINDOW(mainwin), &x, &y); | |
299 ui_manager_popup_menu_show(GTK_MENU(mainwin_general_menu), | |
4513 | 300 x + 6 * MAINWIN_SCALE_FACTOR , |
301 y + MAINWIN_SHADED_HEIGHT * MAINWIN_SCALE_FACTOR, | |
302 1, GDK_CURRENT_TIME); | |
2313 | 303 } |
304 | |
305 void | |
306 mainwin_minimize_cb(void) | |
307 { | |
308 if (!mainwin) | |
309 return; | |
310 | |
311 gtk_window_iconify(GTK_WINDOW(mainwin)); | |
312 } | |
313 | |
314 static void | |
315 mainwin_shade_toggle(void) | |
316 { | |
317 mainwin_set_shade(!cfg.player_shaded); | |
318 } | |
319 | |
320 void | |
321 mainwin_quit_cb(void) | |
322 { | |
3702
1c1d3d84f313
get rid of mainwin_timeout_id only if mainwin_timeout_id is non-zero
William Pitcock <nenolod@atheme.org>
parents:
3679
diff
changeset
|
323 if (mainwin_timeout_id) |
1c1d3d84f313
get rid of mainwin_timeout_id only if mainwin_timeout_id is non-zero
William Pitcock <nenolod@atheme.org>
parents:
3679
diff
changeset
|
324 g_source_remove(mainwin_timeout_id); |
2313 | 325 |
4449
19e3f3c5fe7f
introduce function aud_quit(), which is basically mainwin_quit_cb(), but
mf0102 <0102@gmx.at>
parents:
4413
diff
changeset
|
326 aud_quit(); |
2313 | 327 } |
328 | |
3024
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
329 gboolean |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
330 mainwin_vis_cb(GtkWidget *widget, GdkEventButton *event) |
3020 | 331 { |
3024
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
332 if (event->button == 1) { |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
333 cfg.vis_type++; |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
334 |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
335 if (cfg.vis_type > VIS_OFF) |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
336 cfg.vis_type = VIS_ANALYZER; |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
337 |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
338 mainwin_vis_set_type(cfg.vis_type); |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
339 } else if (event->button == 3) { |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
340 ui_manager_popup_menu_show(GTK_MENU(mainwin_visualization_menu), |
4134
3f1f84330007
one less gdk_window_get_pointer call
Tomasz Mon <desowin@gmail.com>
parents:
4133
diff
changeset
|
341 event->x_root, event->y_root, 3, |
3f1f84330007
one less gdk_window_get_pointer call
Tomasz Mon <desowin@gmail.com>
parents:
4133
diff
changeset
|
342 event->time); |
3024
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
343 } |
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
344 return TRUE; |
3020 | 345 } |
346 | |
2313 | 347 static void |
348 mainwin_destroy(GtkWidget * widget, gpointer data) | |
349 { | |
350 mainwin_quit_cb(); | |
351 } | |
352 | |
353 static gchar *mainwin_tb_old_text = NULL; | |
354 | |
355 void | |
356 mainwin_lock_info_text(const gchar * text) | |
357 { | |
358 if (mainwin_info_text_locked != TRUE) | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
359 mainwin_tb_old_text = g_strdup(aud_active_skin->properties.mainwin_othertext_is_status ? |
4513 | 360 UI_SKINNED_TEXTBOX(mainwin_othertext)->text : UI_SKINNED_TEXTBOX(mainwin_info)->text); |
2313 | 361 |
362 mainwin_info_text_locked = TRUE; | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
363 if (aud_active_skin->properties.mainwin_othertext_is_status) |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
364 ui_skinned_textbox_set_text(mainwin_othertext, text); |
2911 | 365 else |
366 ui_skinned_textbox_set_text(mainwin_info, text); | |
2313 | 367 } |
368 | |
369 void | |
370 mainwin_release_info_text(void) | |
371 { | |
372 mainwin_info_text_locked = FALSE; | |
373 | |
374 if (mainwin_tb_old_text != NULL) | |
375 { | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
376 if (aud_active_skin->properties.mainwin_othertext_is_status) |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
377 ui_skinned_textbox_set_text(mainwin_othertext, mainwin_tb_old_text); |
2911 | 378 else |
379 ui_skinned_textbox_set_text(mainwin_info, mainwin_tb_old_text); | |
2313 | 380 g_free(mainwin_tb_old_text); |
381 mainwin_tb_old_text = NULL; | |
382 } | |
383 } | |
384 | |
385 | |
386 static gchar * | |
387 make_mainwin_title(const gchar * title) | |
388 { | |
389 if (title) | |
390 return g_strdup_printf(_("%s - Audacious"), title); | |
391 else | |
392 return g_strdup(_("Audacious")); | |
393 } | |
394 | |
395 void | |
396 mainwin_set_song_title(const gchar * title) | |
397 { | |
3191
c44eb2f310f0
revive dsd's titlebar patch (r3083) due to it works fine with message passing UI update.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3190
diff
changeset
|
398 gchar *mainwin_title_text = make_mainwin_title(title); |
c44eb2f310f0
revive dsd's titlebar patch (r3083) due to it works fine with message passing UI update.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3190
diff
changeset
|
399 gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text); |
4096
e06261511a5d
Fix memory leaks when generating UI strings in ui_main.c (Bugzilla #18)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
4081
diff
changeset
|
400 g_free(mainwin_title_text); |
2313 | 401 } |
402 | |
3241 | 403 static void |
404 mainwin_refresh_visible(void) | |
405 { | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
406 if (!aud_active_skin || !cfg.player_visible) |
3241 | 407 return; |
408 | |
409 gtk_widget_show_all(mainwin); | |
410 | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
411 if (!aud_active_skin->properties.mainwin_text_visible) |
3241 | 412 gtk_widget_hide(mainwin_info); |
413 | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
414 if (!aud_active_skin->properties.mainwin_vis_visible) |
3241 | 415 gtk_widget_hide(mainwin_vis); |
416 | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
417 if (!aud_active_skin->properties.mainwin_menurow_visible) |
3241 | 418 gtk_widget_hide(mainwin_menurow); |
419 | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
420 if (aud_active_skin->properties.mainwin_othertext) { |
3241 | 421 gtk_widget_hide(mainwin_rate_text); |
422 gtk_widget_hide(mainwin_freq_text); | |
423 gtk_widget_hide(mainwin_monostereo); | |
424 | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
425 if (!aud_active_skin->properties.mainwin_othertext_visible) |
3241 | 426 gtk_widget_hide(mainwin_othertext); |
427 } else { | |
428 gtk_widget_hide(mainwin_othertext); | |
429 } | |
430 | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
431 if (!aud_active_skin->properties.mainwin_vis_visible) |
3241 | 432 gtk_widget_hide(mainwin_vis); |
433 | |
434 if (!playback_get_playing()) { | |
435 gtk_widget_hide(mainwin_minus_num); | |
436 gtk_widget_hide(mainwin_10min_num); | |
437 gtk_widget_hide(mainwin_min_num); | |
438 gtk_widget_hide(mainwin_10sec_num); | |
439 gtk_widget_hide(mainwin_sec_num); | |
440 | |
441 gtk_widget_hide(mainwin_stime_min); | |
442 gtk_widget_hide(mainwin_stime_sec); | |
443 | |
444 gtk_widget_hide(mainwin_position); | |
445 gtk_widget_hide(mainwin_sposition); | |
446 } | |
447 | |
448 if (cfg.player_shaded) { | |
449 ui_svis_clear_data(mainwin_svis); | |
450 if (cfg.vis_type != VIS_OFF) | |
451 ui_svis_set_visible(mainwin_svis, TRUE); | |
452 else | |
453 ui_svis_set_visible(mainwin_svis, FALSE); | |
454 | |
455 ui_skinned_textbox_set_scroll(mainwin_info, FALSE); | |
456 if (!playback_get_playing()) { | |
457 gtk_widget_hide(mainwin_sposition); | |
458 gtk_widget_hide(mainwin_stime_min); | |
459 gtk_widget_hide(mainwin_stime_sec); | |
460 } | |
461 } else { | |
462 gtk_widget_hide(mainwin_srew); | |
463 gtk_widget_hide(mainwin_splay); | |
464 gtk_widget_hide(mainwin_spause); | |
465 gtk_widget_hide(mainwin_sstop); | |
466 gtk_widget_hide(mainwin_sfwd); | |
467 gtk_widget_hide(mainwin_seject); | |
468 gtk_widget_hide(mainwin_stime_min); | |
469 gtk_widget_hide(mainwin_stime_sec); | |
470 gtk_widget_hide(mainwin_svis); | |
471 gtk_widget_hide(mainwin_sposition); | |
472 ui_vis_clear_data(mainwin_vis); | |
473 if (cfg.vis_type != VIS_OFF) | |
474 ui_vis_set_visible(mainwin_vis, TRUE); | |
475 else | |
476 ui_vis_set_visible(mainwin_vis, FALSE); | |
477 | |
478 ui_skinned_textbox_set_scroll(mainwin_info, cfg.autoscroll); | |
479 } | |
480 } | |
481 | |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
482 void |
2313 | 483 mainwin_refresh_hints(void) |
484 { | |
485 /* positioning and size attributes */ | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
486 if (aud_active_skin->properties.mainwin_vis_x && aud_active_skin->properties.mainwin_vis_y) |
4513 | 487 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_vis), aud_active_skin->properties.mainwin_vis_x, |
488 aud_active_skin->properties.mainwin_vis_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
489 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
490 if (aud_active_skin->properties.mainwin_vis_width) |
4513 | 491 gtk_widget_set_size_request(mainwin_vis, aud_active_skin->properties.mainwin_vis_width * MAINWIN_SCALE_FACTOR, |
492 UI_VIS(mainwin_vis)->height* MAINWIN_SCALE_FACTOR); | |
2313 | 493 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
494 if (aud_active_skin->properties.mainwin_text_x && aud_active_skin->properties.mainwin_text_y) |
4513 | 495 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_info), aud_active_skin->properties.mainwin_text_x, |
496 aud_active_skin->properties.mainwin_text_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
497 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
498 if (aud_active_skin->properties.mainwin_text_width) { |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
499 UI_SKINNED_TEXTBOX(mainwin_info)->width = aud_active_skin->properties.mainwin_text_width; |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
500 gtk_widget_set_size_request(mainwin_info, aud_active_skin->properties.mainwin_text_width * MAINWIN_SCALE_FACTOR, |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
501 UI_SKINNED_TEXTBOX(mainwin_info)->height * MAINWIN_SCALE_FACTOR ); |
3958
ad14a25a31fa
fix douebliesize for mainwin_info on startup; Closes Gentoo #199071
Tomasz Mon <desowin@gmail.com>
parents:
3908
diff
changeset
|
502 } |
2313 | 503 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
504 if (aud_active_skin->properties.mainwin_infobar_x && aud_active_skin->properties.mainwin_infobar_y) |
4513 | 505 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_othertext), aud_active_skin->properties.mainwin_infobar_x, |
506 aud_active_skin->properties.mainwin_infobar_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
507 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
508 if (aud_active_skin->properties.mainwin_number_0_x && aud_active_skin->properties.mainwin_number_0_y) |
4513 | 509 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_minus_num), aud_active_skin->properties.mainwin_number_0_x, |
510 aud_active_skin->properties.mainwin_number_0_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
511 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
512 if (aud_active_skin->properties.mainwin_number_1_x && aud_active_skin->properties.mainwin_number_1_y) |
4513 | 513 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_10min_num), aud_active_skin->properties.mainwin_number_1_x, |
514 aud_active_skin->properties.mainwin_number_1_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
515 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
516 if (aud_active_skin->properties.mainwin_number_2_x && aud_active_skin->properties.mainwin_number_2_y) |
4513 | 517 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_min_num), aud_active_skin->properties.mainwin_number_2_x, |
518 aud_active_skin->properties.mainwin_number_2_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
519 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
520 if (aud_active_skin->properties.mainwin_number_3_x && aud_active_skin->properties.mainwin_number_3_y) |
4513 | 521 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_10sec_num), aud_active_skin->properties.mainwin_number_3_x, |
522 aud_active_skin->properties.mainwin_number_3_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
523 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
524 if (aud_active_skin->properties.mainwin_number_4_x && aud_active_skin->properties.mainwin_number_4_y) |
4513 | 525 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_sec_num), aud_active_skin->properties.mainwin_number_4_x, |
526 aud_active_skin->properties.mainwin_number_4_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
527 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
528 if (aud_active_skin->properties.mainwin_playstatus_x && aud_active_skin->properties.mainwin_playstatus_y) |
4513 | 529 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), mainwin_playstatus, aud_active_skin->properties.mainwin_playstatus_x, |
530 aud_active_skin->properties.mainwin_playstatus_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
531 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
532 if (aud_active_skin->properties.mainwin_volume_x && aud_active_skin->properties.mainwin_volume_y) |
4513 | 533 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_volume), aud_active_skin->properties.mainwin_volume_x, |
534 aud_active_skin->properties.mainwin_volume_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
535 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
536 if (aud_active_skin->properties.mainwin_balance_x && aud_active_skin->properties.mainwin_balance_y) |
4513 | 537 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_balance), aud_active_skin->properties.mainwin_balance_x, |
538 aud_active_skin->properties.mainwin_balance_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
539 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
540 if (aud_active_skin->properties.mainwin_position_x && aud_active_skin->properties.mainwin_position_y) |
4513 | 541 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_position), aud_active_skin->properties.mainwin_position_x, |
542 aud_active_skin->properties.mainwin_position_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
543 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
544 if (aud_active_skin->properties.mainwin_previous_x && aud_active_skin->properties.mainwin_previous_y) |
4513 | 545 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), mainwin_rew, aud_active_skin->properties.mainwin_previous_x, |
546 aud_active_skin->properties.mainwin_previous_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
547 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
548 if (aud_active_skin->properties.mainwin_play_x && aud_active_skin->properties.mainwin_play_y) |
4513 | 549 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_play), aud_active_skin->properties.mainwin_play_x, |
550 aud_active_skin->properties.mainwin_play_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
551 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
552 if (aud_active_skin->properties.mainwin_pause_x && aud_active_skin->properties.mainwin_pause_y) |
4513 | 553 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_pause), aud_active_skin->properties.mainwin_pause_x, |
554 aud_active_skin->properties.mainwin_pause_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
555 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
556 if (aud_active_skin->properties.mainwin_stop_x && aud_active_skin->properties.mainwin_stop_y) |
4513 | 557 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_stop), aud_active_skin->properties.mainwin_stop_x, |
558 aud_active_skin->properties.mainwin_stop_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
559 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
560 if (aud_active_skin->properties.mainwin_next_x && aud_active_skin->properties.mainwin_next_y) |
4513 | 561 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_fwd), aud_active_skin->properties.mainwin_next_x, |
562 aud_active_skin->properties.mainwin_next_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
563 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
564 if (aud_active_skin->properties.mainwin_eject_x && aud_active_skin->properties.mainwin_eject_y) |
4513 | 565 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_eject), aud_active_skin->properties.mainwin_eject_x, |
566 aud_active_skin->properties.mainwin_eject_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
567 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
568 if (aud_active_skin->properties.mainwin_eqbutton_x && aud_active_skin->properties.mainwin_eqbutton_y) |
4513 | 569 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_eq), aud_active_skin->properties.mainwin_eqbutton_x, |
570 aud_active_skin->properties.mainwin_eqbutton_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
571 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
572 if (aud_active_skin->properties.mainwin_plbutton_x && aud_active_skin->properties.mainwin_plbutton_y) |
4513 | 573 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_pl), aud_active_skin->properties.mainwin_plbutton_x, |
574 aud_active_skin->properties.mainwin_plbutton_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
575 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
576 if (aud_active_skin->properties.mainwin_shuffle_x && aud_active_skin->properties.mainwin_shuffle_y) |
4513 | 577 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_shuffle), aud_active_skin->properties.mainwin_shuffle_x, |
578 aud_active_skin->properties.mainwin_shuffle_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
579 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
580 if (aud_active_skin->properties.mainwin_repeat_x && aud_active_skin->properties.mainwin_repeat_y) |
4513 | 581 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_repeat), aud_active_skin->properties.mainwin_repeat_x, |
582 aud_active_skin->properties.mainwin_repeat_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
583 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
584 if (aud_active_skin->properties.mainwin_about_x && aud_active_skin->properties.mainwin_about_y) |
4513 | 585 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_about), aud_active_skin->properties.mainwin_about_x, |
586 aud_active_skin->properties.mainwin_about_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
587 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
588 if (aud_active_skin->properties.mainwin_minimize_x && aud_active_skin->properties.mainwin_minimize_y) |
4513 | 589 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_minimize), cfg.player_shaded ? 244 : aud_active_skin->properties.mainwin_minimize_x, |
590 cfg.player_shaded ? 3 : aud_active_skin->properties.mainwin_minimize_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
591 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
592 if (aud_active_skin->properties.mainwin_shade_x && aud_active_skin->properties.mainwin_shade_y) |
4513 | 593 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_shade), cfg.player_shaded ? 254 : aud_active_skin->properties.mainwin_shade_x, |
594 cfg.player_shaded ? 3 : aud_active_skin->properties.mainwin_shade_y); | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
595 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
596 if (aud_active_skin->properties.mainwin_close_x && aud_active_skin->properties.mainwin_close_y) |
4513 | 597 gtk_fixed_move(GTK_FIXED(SKINNED_WINDOW(mainwin)->fixed), GTK_WIDGET(mainwin_close), cfg.player_shaded ? 264 : aud_active_skin->properties.mainwin_close_x, |
598 cfg.player_shaded ? 3 : aud_active_skin->properties.mainwin_close_y); | |
2313 | 599 |
3241 | 600 mainwin_refresh_visible(); |
3898
7f5a2fd9dcc0
Fix a skin size boundary issue.
William Pitcock <nenolod@atheme.org>
parents:
3765
diff
changeset
|
601 |
2313 | 602 /* window size, mainwinWidth && mainwinHeight properties */ |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
603 if (aud_active_skin->properties.mainwin_height && aud_active_skin->properties.mainwin_width) |
2313 | 604 { |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
605 dock_window_resize(GTK_WINDOW(mainwin), cfg.player_shaded ? MAINWIN_SHADED_WIDTH * MAINWIN_SCALE_FACTOR : aud_active_skin->properties.mainwin_width * MAINWIN_SCALE_FACTOR, |
4513 | 606 cfg.player_shaded ? MAINWIN_SHADED_HEIGHT * MAINWIN_SCALE_FACTOR : aud_active_skin->properties.mainwin_height * MAINWIN_SCALE_FACTOR, |
607 aud_active_skin->properties.mainwin_width * MAINWIN_SCALE_FACTOR, | |
608 aud_active_skin->properties.mainwin_height * MAINWIN_SCALE_FACTOR); | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
609 |
3898
7f5a2fd9dcc0
Fix a skin size boundary issue.
William Pitcock <nenolod@atheme.org>
parents:
3765
diff
changeset
|
610 gdk_flush(); |
2313 | 611 } |
612 } | |
613 | |
614 void | |
615 mainwin_set_song_info(gint bitrate, | |
616 gint frequency, | |
617 gint n_channels) | |
618 { | |
2949
7a88f6d9cd92
use g_strdup_printf instead of fixed-size gchar*
Tomasz Mon <desowin@gmail.com>
parents:
2947
diff
changeset
|
619 gchar *text; |
2313 | 620 gchar *title; |
621 Playlist *playlist = playlist_get_active(); | |
622 | |
623 playback_set_sample_params(bitrate, frequency, n_channels); | |
624 | |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
625 GDK_THREADS_ENTER(); |
2313 | 626 if (bitrate != -1) { |
627 bitrate /= 1000; | |
628 | |
629 if (bitrate < 1000) { | |
630 /* Show bitrate in 1000s */ | |
2949
7a88f6d9cd92
use g_strdup_printf instead of fixed-size gchar*
Tomasz Mon <desowin@gmail.com>
parents:
2947
diff
changeset
|
631 text = g_strdup_printf("%3d", bitrate); |
2313 | 632 } |
633 else { | |
634 /* Show bitrate in 100,000s */ | |
2949
7a88f6d9cd92
use g_strdup_printf instead of fixed-size gchar*
Tomasz Mon <desowin@gmail.com>
parents:
2947
diff
changeset
|
635 text = g_strdup_printf("%2dH", bitrate / 100); |
2313 | 636 } |
4096
e06261511a5d
Fix memory leaks when generating UI strings in ui_main.c (Bugzilla #18)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
4081
diff
changeset
|
637 ui_skinned_textbox_set_text(mainwin_rate_text, text); |
e06261511a5d
Fix memory leaks when generating UI strings in ui_main.c (Bugzilla #18)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
4081
diff
changeset
|
638 g_free(text); |
2313 | 639 } |
640 else | |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
641 ui_skinned_textbox_set_text(mainwin_rate_text, _("VBR")); |
2313 | 642 |
643 /* Show sampling frequency in kHz */ | |
2949
7a88f6d9cd92
use g_strdup_printf instead of fixed-size gchar*
Tomasz Mon <desowin@gmail.com>
parents:
2947
diff
changeset
|
644 text = g_strdup_printf("%2d", frequency / 1000); |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
645 ui_skinned_textbox_set_text(mainwin_freq_text, text); |
4096
e06261511a5d
Fix memory leaks when generating UI strings in ui_main.c (Bugzilla #18)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
4081
diff
changeset
|
646 g_free(text); |
2313 | 647 |
3073
da99b90d63d3
replace MonoStereo with UiSkinnedMonoStereo
Tomasz Mon <desowin@gmail.com>
parents:
3072
diff
changeset
|
648 ui_skinned_monostereo_set_num_channels(mainwin_monostereo, n_channels); |
2313 | 649 |
650 if (!playback_get_paused() && mainwin_playstatus != NULL) | |
3072
84de3244aeaa
replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents:
3070
diff
changeset
|
651 ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_PLAY); |
2313 | 652 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
653 if (aud_active_skin && aud_active_skin->properties.mainwin_othertext) |
2313 | 654 { |
655 if (bitrate != -1) | |
2949
7a88f6d9cd92
use g_strdup_printf instead of fixed-size gchar*
Tomasz Mon <desowin@gmail.com>
parents:
2947
diff
changeset
|
656 text = g_strdup_printf("%d kbps, %0.1f kHz, %s", |
4513 | 657 bitrate, |
658 (gfloat) frequency / 1000, | |
659 (n_channels > 1) ? _("stereo") : _("mono")); | |
2313 | 660 else |
2949
7a88f6d9cd92
use g_strdup_printf instead of fixed-size gchar*
Tomasz Mon <desowin@gmail.com>
parents:
2947
diff
changeset
|
661 text = g_strdup_printf("VBR, %0.1f kHz, %s", |
4513 | 662 (gfloat) frequency / 1000, |
663 (n_channels > 1) ? _("stereo") : _("mono")); | |
2313 | 664 |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
665 ui_skinned_textbox_set_text(mainwin_othertext, text); |
4096
e06261511a5d
Fix memory leaks when generating UI strings in ui_main.c (Bugzilla #18)
Jussi Judin <jjudin+audacious@iki.fi>
parents:
4081
diff
changeset
|
666 g_free(text); |
2313 | 667 } |
668 | |
669 title = playlist_get_info_text(playlist); | |
670 mainwin_set_song_title(title); | |
671 g_free(title); | |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
672 GDK_THREADS_LEAVE(); |
2313 | 673 } |
674 | |
675 void | |
676 mainwin_clear_song_info(void) | |
677 { | |
678 if (!mainwin) | |
679 return; | |
680 | |
681 /* clear title */ | |
3191
c44eb2f310f0
revive dsd's titlebar patch (r3083) due to it works fine with message passing UI update.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3190
diff
changeset
|
682 mainwin_set_song_title(NULL); |
2313 | 683 |
684 /* clear sampling parameters */ | |
685 playback_set_sample_params(0, 0, 0); | |
686 | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
687 UI_SKINNED_HORIZONTAL_SLIDER(mainwin_position)->pressed = FALSE; |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
688 UI_SKINNED_HORIZONTAL_SLIDER(mainwin_sposition)->pressed = FALSE; |
2313 | 689 |
690 /* clear sampling parameter displays */ | |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
691 ui_skinned_textbox_set_text(mainwin_rate_text, " "); |
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
692 ui_skinned_textbox_set_text(mainwin_freq_text, " "); |
3073
da99b90d63d3
replace MonoStereo with UiSkinnedMonoStereo
Tomasz Mon <desowin@gmail.com>
parents:
3072
diff
changeset
|
693 ui_skinned_monostereo_set_num_channels(mainwin_monostereo, 0); |
2313 | 694 |
695 if (mainwin_playstatus != NULL) | |
3072
84de3244aeaa
replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents:
3070
diff
changeset
|
696 ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_STOP); |
2313 | 697 |
3241 | 698 mainwin_refresh_visible(); |
2313 | 699 |
700 playlistwin_hide_timer(); | |
3026
e9e925c3adb5
we don't need ui_vis_clear, it only caused problem
Tomasz Mon <desowin@gmail.com>
parents:
3025
diff
changeset
|
701 ui_vis_clear_data(mainwin_vis); |
3054 | 702 ui_svis_clear_data(mainwin_svis); |
2313 | 703 } |
704 | |
705 void | |
706 mainwin_disable_seekbar(void) | |
707 { | |
708 if (!mainwin) | |
709 return; | |
710 | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
711 gtk_widget_hide(mainwin_position); |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
712 gtk_widget_hide(mainwin_sposition); |
2313 | 713 } |
714 | |
715 static gboolean | |
716 mainwin_mouse_button_release(GtkWidget * widget, | |
717 GdkEventButton * event, | |
718 gpointer callback_data) | |
719 { | |
720 if (dock_is_moving(GTK_WINDOW(mainwin))) { | |
721 dock_move_release(GTK_WINDOW(mainwin)); | |
722 } | |
723 | |
724 return FALSE; | |
725 } | |
726 | |
727 void | |
728 mainwin_scrolled(GtkWidget *widget, GdkEventScroll *event, | |
4513 | 729 gpointer callback_data) |
2313 | 730 { |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
731 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
732 |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
733 switch (event->direction) { |
4513 | 734 case GDK_SCROLL_UP: |
735 mainwin_set_volume_diff(cfg.mouse_change); | |
736 break; | |
737 case GDK_SCROLL_DOWN: | |
738 mainwin_set_volume_diff(-cfg.mouse_change); | |
739 break; | |
740 case GDK_SCROLL_LEFT: | |
741 if (playlist_get_current_length(playlist) != -1) | |
742 playback_seek(CLAMP(playback_get_time() - 1000, | |
743 0, playlist_get_current_length(playlist)) / 1000); | |
744 break; | |
745 case GDK_SCROLL_RIGHT: | |
746 if (playlist_get_current_length(playlist) != -1) | |
747 playback_seek(CLAMP(playback_get_time() + 1000, | |
748 0, playlist_get_current_length(playlist)) / 1000); | |
749 break; | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
750 } |
2313 | 751 } |
752 | |
753 static gboolean | |
3600
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
754 mainwin_widget_contained(GdkEventButton *event, int x, int y, int w, int h) |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
755 { |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
756 if ((event->x > x && event->y > y) && |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
757 (event->x < x+w && event->y < y+h)) |
4513 | 758 return TRUE; |
3600
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
759 |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
760 return FALSE; |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
761 } |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
762 |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
763 static gboolean |
2313 | 764 mainwin_mouse_button_press(GtkWidget * widget, |
765 GdkEventButton * event, | |
766 gpointer callback_data) | |
767 { | |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
768 if (cfg.scaled) { |
2313 | 769 /* |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
770 * A hack to make scaling transparent to callbacks. |
2313 | 771 * We should make a copy of this data instead of |
772 * tampering with the data we get from gtk+ | |
773 */ | |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
774 event->x /= cfg.scale_factor; |
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
775 event->y /= cfg.scale_factor; |
2313 | 776 } |
777 | |
4554
961906c766e4
introduce ui_skinned_window_button_press and ui_skinned_window_button_release
Tomasz Mon <desowin@gmail.com>
parents:
4546
diff
changeset
|
778 if (event->button == 1 && event->type == GDK_2BUTTON_PRESS && event->y < 14) { |
2313 | 779 mainwin_set_shade(!cfg.player_shaded); |
780 if (dock_is_moving(GTK_WINDOW(mainwin))) | |
781 dock_move_release(GTK_WINDOW(mainwin)); | |
4554
961906c766e4
introduce ui_skinned_window_button_press and ui_skinned_window_button_release
Tomasz Mon <desowin@gmail.com>
parents:
4546
diff
changeset
|
782 return TRUE; |
2313 | 783 } |
784 | |
785 if (event->button == 3) { | |
3600
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
786 /* Pop up playback menu if right clicked over playback-control widgets, |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
787 * otherwise popup general menu |
aba660a4a15d
Pop up playback menu if right clicked over playback-control widgets
Tomasz Mon <desowin@gmail.com>
parents:
3599
diff
changeset
|
788 */ |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
789 if (mainwin_widget_contained(event, aud_active_skin->properties.mainwin_position_x, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
790 aud_active_skin->properties.mainwin_position_y, 248, 10) || |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
791 mainwin_widget_contained(event, aud_active_skin->properties.mainwin_previous_x, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
792 aud_active_skin->properties.mainwin_previous_y, 23, 18) || |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
793 mainwin_widget_contained(event, aud_active_skin->properties.mainwin_play_x, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
794 aud_active_skin->properties.mainwin_play_y, 23, 18) || |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
795 mainwin_widget_contained(event, aud_active_skin->properties.mainwin_pause_x, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
796 aud_active_skin->properties.mainwin_pause_y, 23, 18) || |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
797 mainwin_widget_contained(event, aud_active_skin->properties.mainwin_stop_x, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
798 aud_active_skin->properties.mainwin_stop_y, 23, 18) || |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
799 mainwin_widget_contained(event, aud_active_skin->properties.mainwin_next_x, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
800 aud_active_skin->properties.mainwin_next_y, 23, 18)) |
2313 | 801 { |
802 | |
803 ui_manager_popup_menu_show(GTK_MENU(mainwin_playback_menu), | |
4513 | 804 event->x_root, |
805 event->y_root, 3, event->time); | |
2313 | 806 } else { |
807 /* | |
808 * Pop up the main menu a few pixels down. | |
809 * This will avoid that anything is selected | |
810 * if one right-clicks to focus the window | |
811 * without raising it. | |
812 * | |
813 ***MD I think the above is stupid, people don't expect this | |
814 * | |
815 */ | |
816 ui_manager_popup_menu_show(GTK_MENU(mainwin_general_menu), | |
4513 | 817 event->x_root, |
818 event->y_root, 3, event->time); | |
2313 | 819 } |
4554
961906c766e4
introduce ui_skinned_window_button_press and ui_skinned_window_button_release
Tomasz Mon <desowin@gmail.com>
parents:
4546
diff
changeset
|
820 return TRUE; |
2313 | 821 } |
822 | |
823 return FALSE; | |
824 } | |
825 | |
826 static gboolean | |
827 mainwin_keypress(GtkWidget * grab_widget, | |
828 GdkEventKey * event, | |
829 gpointer data) | |
830 { | |
831 Playlist *playlist = playlist_get_active(); | |
832 | |
833 switch (event->keyval) { | |
834 | |
4513 | 835 case GDK_Up: |
836 case GDK_KP_Up: | |
837 case GDK_KP_8: | |
838 mainwin_set_volume_diff(2); | |
839 break; | |
840 case GDK_Down: | |
841 case GDK_KP_Down: | |
842 case GDK_KP_2: | |
843 mainwin_set_volume_diff(-2); | |
844 break; | |
845 case GDK_Left: | |
846 case GDK_KP_Left: | |
847 case GDK_KP_7: | |
848 if (playlist_get_current_length(playlist) != -1) | |
849 playback_seek(CLAMP | |
2313 | 850 (playback_get_time() - 5000, 0, |
851 playlist_get_current_length(playlist)) / 1000); | |
4513 | 852 break; |
853 case GDK_Right: | |
854 case GDK_KP_Right: | |
855 case GDK_KP_9: | |
856 if (playlist_get_current_length(playlist) != -1) | |
857 playback_seek(CLAMP | |
2313 | 858 (playback_get_time() + 5000, 0, |
859 playlist_get_current_length(playlist)) / 1000); | |
4513 | 860 break; |
861 case GDK_KP_4: | |
862 playlist_prev(playlist); | |
863 break; | |
864 case GDK_KP_6: | |
865 playlist_next(playlist); | |
866 break; | |
867 case GDK_KP_Insert: | |
868 ui_jump_to_track(); | |
869 break; | |
870 case GDK_Return: | |
871 case GDK_KP_Enter: | |
872 case GDK_KP_5: | |
873 mainwin_play_pushed(); | |
874 break; | |
875 case GDK_space: | |
876 playback_pause(); | |
877 break; | |
878 case GDK_Escape: | |
879 mainwin_minimize_cb(); | |
880 break; | |
881 case GDK_Tab: | |
882 if (event->state & GDK_CONTROL_MASK) { | |
883 if (cfg.equalizer_visible) | |
884 gtk_window_present(GTK_WINDOW(equalizerwin)); | |
885 else if (cfg.playlist_visible) | |
886 gtk_window_present(GTK_WINDOW(playlistwin)); | |
887 } | |
888 break; | |
889 case GDK_c: | |
890 if (event->state & GDK_CONTROL_MASK) { | |
891 Playlist *playlist = playlist_get_active(); | |
892 gint pos = playlist_get_position(playlist); | |
893 gchar *title = playlist_get_songtitle(playlist, pos); | |
894 | |
895 if (title != NULL) { | |
896 GtkClipboard *clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); | |
897 gtk_clipboard_set_text(clip, title, -1); | |
898 gtk_clipboard_store(clip); | |
899 } | |
900 | |
901 return TRUE; | |
902 } | |
903 return FALSE; | |
904 default: | |
905 return FALSE; | |
2313 | 906 } |
907 | |
908 return TRUE; | |
909 } | |
910 | |
911 static void | |
912 mainwin_jump_to_time_cb(GtkWidget * widget, | |
913 GtkWidget * entry) | |
914 { | |
915 guint min = 0, sec = 0, params; | |
916 gint time; | |
917 Playlist *playlist = playlist_get_active(); | |
918 | |
919 params = sscanf(gtk_entry_get_text(GTK_ENTRY(entry)), "%u:%u", | |
920 &min, &sec); | |
921 if (params == 2) | |
922 time = (min * 60) + sec; | |
923 else if (params == 1) | |
924 time = min; | |
925 else | |
926 return; | |
927 | |
928 if (playlist_get_current_length(playlist) > -1 && | |
929 time <= (playlist_get_current_length(playlist) / 1000)) | |
930 { | |
931 playback_seek(time); | |
932 gtk_widget_destroy(mainwin_jtt); | |
933 } | |
934 } | |
935 | |
936 | |
937 void | |
938 mainwin_jump_to_time(void) | |
939 { | |
940 GtkWidget *vbox, *hbox_new, *hbox_total; | |
941 GtkWidget *time_entry, *label, *bbox, *jump, *cancel; | |
4325
309e8f970517
removed report_error() and reimplemented some error routines
mf0102 <0102@gmx.at>
parents:
4321
diff
changeset
|
942 GtkWidget *dialog; |
2313 | 943 guint tindex; |
944 gchar time_str[10]; | |
945 | |
946 if (!playback_get_playing()) { | |
4325
309e8f970517
removed report_error() and reimplemented some error routines
mf0102 <0102@gmx.at>
parents:
4321
diff
changeset
|
947 dialog = |
309e8f970517
removed report_error() and reimplemented some error routines
mf0102 <0102@gmx.at>
parents:
4321
diff
changeset
|
948 gtk_message_dialog_new (GTK_WINDOW (mainwin), |
309e8f970517
removed report_error() and reimplemented some error routines
mf0102 <0102@gmx.at>
parents:
4321
diff
changeset
|
949 GTK_DIALOG_DESTROY_WITH_PARENT, |
309e8f970517
removed report_error() and reimplemented some error routines
mf0102 <0102@gmx.at>
parents:
4321
diff
changeset
|
950 GTK_MESSAGE_ERROR, |
309e8f970517
removed report_error() and reimplemented some error routines
mf0102 <0102@gmx.at>
parents:
4321
diff
changeset
|
951 GTK_BUTTONS_CLOSE, |
309e8f970517
removed report_error() and reimplemented some error routines
mf0102 <0102@gmx.at>
parents:
4321
diff
changeset
|
952 _("Can't jump to time when no track is being played.\n")); |
309e8f970517
removed report_error() and reimplemented some error routines
mf0102 <0102@gmx.at>
parents:
4321
diff
changeset
|
953 gtk_dialog_run (GTK_DIALOG (dialog)); |
309e8f970517
removed report_error() and reimplemented some error routines
mf0102 <0102@gmx.at>
parents:
4321
diff
changeset
|
954 gtk_widget_destroy (dialog); |
2313 | 955 return; |
956 } | |
957 | |
958 if (mainwin_jtt) { | |
959 gtk_window_present(GTK_WINDOW(mainwin_jtt)); | |
960 return; | |
961 } | |
962 | |
963 mainwin_jtt = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
964 gtk_window_set_type_hint(GTK_WINDOW(mainwin_jtt), | |
965 GDK_WINDOW_TYPE_HINT_DIALOG); | |
966 | |
967 gtk_window_set_title(GTK_WINDOW(mainwin_jtt), _("Jump to Time")); | |
968 gtk_window_set_position(GTK_WINDOW(mainwin_jtt), GTK_WIN_POS_CENTER); | |
969 gtk_window_set_transient_for(GTK_WINDOW(mainwin_jtt), | |
970 GTK_WINDOW(mainwin)); | |
971 | |
972 g_signal_connect(mainwin_jtt, "destroy", | |
973 G_CALLBACK(gtk_widget_destroyed), &mainwin_jtt); | |
974 gtk_container_border_width(GTK_CONTAINER(mainwin_jtt), 10); | |
975 | |
976 vbox = gtk_vbox_new(FALSE, 5); | |
977 gtk_container_add(GTK_CONTAINER(mainwin_jtt), vbox); | |
978 | |
979 hbox_new = gtk_hbox_new(FALSE, 0); | |
980 gtk_box_pack_start(GTK_BOX(vbox), hbox_new, TRUE, TRUE, 5); | |
981 | |
982 time_entry = gtk_entry_new(); | |
983 gtk_box_pack_start(GTK_BOX(hbox_new), time_entry, FALSE, FALSE, 5); | |
984 g_signal_connect(time_entry, "activate", | |
985 G_CALLBACK(mainwin_jump_to_time_cb), time_entry); | |
986 | |
987 gtk_widget_set_size_request(time_entry, 70, -1); | |
988 label = gtk_label_new(_("minutes:seconds")); | |
989 gtk_box_pack_start(GTK_BOX(hbox_new), label, FALSE, FALSE, 5); | |
990 | |
991 hbox_total = gtk_hbox_new(FALSE, 0); | |
992 gtk_box_pack_start(GTK_BOX(vbox), hbox_total, TRUE, TRUE, 5); | |
993 gtk_widget_show(hbox_total); | |
994 | |
995 /* FIXME: Disable display of current track length. It's not | |
996 updated when track changes */ | |
997 #if 0 | |
998 label = gtk_label_new(_("Track length:")); | |
999 gtk_box_pack_start(GTK_BOX(hbox_total), label, FALSE, FALSE, 5); | |
1000 | |
1001 len = playlist_get_current_length() / 1000; | |
1002 g_snprintf(time_str, sizeof(time_str), "%u:%2.2u", len / 60, len % 60); | |
1003 label = gtk_label_new(time_str); | |
1004 | |
1005 gtk_box_pack_start(GTK_BOX(hbox_total), label, FALSE, FALSE, 10); | |
1006 #endif | |
1007 | |
1008 bbox = gtk_hbutton_box_new(); | |
1009 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 0); | |
1010 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
1011 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); | |
1012 | |
1013 cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL); | |
1014 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); | |
1015 gtk_container_add(GTK_CONTAINER(bbox), cancel); | |
1016 g_signal_connect_swapped(cancel, "clicked", | |
1017 G_CALLBACK(gtk_widget_destroy), mainwin_jtt); | |
1018 | |
1019 jump = gtk_button_new_from_stock(GTK_STOCK_JUMP_TO); | |
1020 GTK_WIDGET_SET_FLAGS(jump, GTK_CAN_DEFAULT); | |
1021 gtk_container_add(GTK_CONTAINER(bbox), jump); | |
1022 g_signal_connect(jump, "clicked", | |
1023 G_CALLBACK(mainwin_jump_to_time_cb), time_entry); | |
1024 | |
1025 tindex = playback_get_time() / 1000; | |
1026 g_snprintf(time_str, sizeof(time_str), "%u:%2.2u", tindex / 60, | |
1027 tindex % 60); | |
1028 gtk_entry_set_text(GTK_ENTRY(time_entry), time_str); | |
1029 | |
1030 gtk_entry_select_region(GTK_ENTRY(time_entry), 0, strlen(time_str)); | |
1031 | |
1032 gtk_widget_show_all(mainwin_jtt); | |
1033 | |
1034 gtk_widget_grab_focus(time_entry); | |
1035 gtk_widget_grab_default(jump); | |
1036 } | |
1037 | |
1038 /* | |
1039 * Rewritten 09/13/06: | |
1040 * | |
1041 * Remove all of this flaky iter/sourcelist/strsplit stuff. | |
1042 * All we care about is the filepath. | |
1043 * | |
2974
b93bd39923bf
Rework DnD received data function to use g_filename_from_uri().
William Pitcock <nenolod@atheme-project.org>
parents:
2964
diff
changeset
|
1044 * We can figure this out and easily pass it to g_filename_from_uri(). |
2313 | 1045 * - nenolod |
1046 */ | |
1047 void | |
1048 mainwin_drag_data_received(GtkWidget * widget, | |
1049 GdkDragContext * context, | |
1050 gint x, | |
1051 gint y, | |
1052 GtkSelectionData * selection_data, | |
1053 guint info, | |
1054 guint time, | |
1055 gpointer user_data) | |
1056 { | |
1057 Playlist *playlist = playlist_get_active(); | |
1058 | |
1059 g_return_if_fail(selection_data != NULL); | |
1060 g_return_if_fail(selection_data->data != NULL); | |
1061 | |
1062 if (str_has_prefix_nocase((gchar *) selection_data->data, "fonts:///")) | |
1063 { | |
2974
b93bd39923bf
Rework DnD received data function to use g_filename_from_uri().
William Pitcock <nenolod@atheme-project.org>
parents:
2964
diff
changeset
|
1064 gchar *path = (gchar *) selection_data->data; |
b93bd39923bf
Rework DnD received data function to use g_filename_from_uri().
William Pitcock <nenolod@atheme-project.org>
parents:
2964
diff
changeset
|
1065 gchar *decoded = g_filename_from_uri(path, NULL, NULL); |
b93bd39923bf
Rework DnD received data function to use g_filename_from_uri().
William Pitcock <nenolod@atheme-project.org>
parents:
2964
diff
changeset
|
1066 |
b93bd39923bf
Rework DnD received data function to use g_filename_from_uri().
William Pitcock <nenolod@atheme-project.org>
parents:
2964
diff
changeset
|
1067 if (decoded == NULL) |
b93bd39923bf
Rework DnD received data function to use g_filename_from_uri().
William Pitcock <nenolod@atheme-project.org>
parents:
2964
diff
changeset
|
1068 return; |
2313 | 1069 |
1070 cfg.playlist_font = g_strconcat(decoded, strrchr(cfg.playlist_font, ' '), NULL); | |
3217 | 1071 ui_skinned_playlist_set_font(cfg.playlist_font); |
2313 | 1072 playlistwin_update_list(playlist); |
1073 | |
1074 g_free(decoded); | |
1075 | |
1076 return; | |
1077 } | |
1078 | |
4081
05140463a43e
install skin if user drag'n'drops it on mainwin
Tomasz Mon <desowin@gmail.com>
parents:
4080
diff
changeset
|
1079 /* perhaps make suffix check case-insensitive -- desowin */ |
05140463a43e
install skin if user drag'n'drops it on mainwin
Tomasz Mon <desowin@gmail.com>
parents:
4080
diff
changeset
|
1080 if (str_has_prefix_nocase((char*)selection_data->data, "file:///")) { |
05140463a43e
install skin if user drag'n'drops it on mainwin
Tomasz Mon <desowin@gmail.com>
parents:
4080
diff
changeset
|
1081 if (str_has_suffix_nocase((char*)selection_data->data, ".wsz\r\n") || |
05140463a43e
install skin if user drag'n'drops it on mainwin
Tomasz Mon <desowin@gmail.com>
parents:
4080
diff
changeset
|
1082 str_has_suffix_nocase((char*)selection_data->data, ".zip\r\n")) { |
4513 | 1083 on_skin_view_drag_data_received(GTK_WIDGET(user_data), context, x, y, selection_data, info, time, NULL); |
1084 return; | |
4081
05140463a43e
install skin if user drag'n'drops it on mainwin
Tomasz Mon <desowin@gmail.com>
parents:
4080
diff
changeset
|
1085 } |
05140463a43e
install skin if user drag'n'drops it on mainwin
Tomasz Mon <desowin@gmail.com>
parents:
4080
diff
changeset
|
1086 } |
05140463a43e
install skin if user drag'n'drops it on mainwin
Tomasz Mon <desowin@gmail.com>
parents:
4080
diff
changeset
|
1087 |
2313 | 1088 playlist_clear(playlist); |
1089 playlist_add_url(playlist, (gchar *) selection_data->data); | |
1090 playback_initiate(); | |
1091 } | |
1092 | |
1093 static void | |
1094 on_add_url_add_clicked(GtkWidget * widget, | |
1095 GtkWidget * entry) | |
1096 { | |
1097 const gchar *text = gtk_entry_get_text(GTK_ENTRY(entry)); | |
1098 if (text && *text) | |
1099 playlist_add_url(playlist_get_active(), text); | |
1100 } | |
1101 | |
1102 static void | |
1103 on_add_url_ok_clicked(GtkWidget * widget, | |
1104 GtkWidget * entry) | |
1105 { | |
1106 Playlist *playlist = playlist_get_active(); | |
1107 | |
1108 const gchar *text = gtk_entry_get_text(GTK_ENTRY(entry)); | |
1109 if (text && *text) | |
1110 { | |
1111 playlist_clear(playlist); | |
1112 playlist_add_url(playlist, text); | |
1113 playback_initiate(); | |
1114 } | |
1115 } | |
1116 | |
2651
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1117 static void |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1118 on_visibility_warning_toggle(GtkToggleButton *tbt, gpointer unused) |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1119 { |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1120 cfg.warn_about_win_visibility = !gtk_toggle_button_get_active(tbt); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1121 } |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1122 |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1123 static void |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1124 on_visibility_warning_response(GtkDialog *dlg, gint r_id, gpointer unused) |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1125 { |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1126 switch (r_id) |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1127 { |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1128 case GTK_RESPONSE_OK: |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1129 mainwin_show(TRUE); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1130 break; |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1131 case GTK_RESPONSE_CANCEL: |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1132 default: |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1133 break; |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1134 } |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1135 gtk_widget_destroy(GTK_WIDGET(dlg)); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1136 } |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1137 |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1138 void |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1139 mainwin_show_visibility_warning(void) |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1140 { |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1141 if (cfg.warn_about_win_visibility) |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1142 { |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1143 GtkWidget *label, *checkbt, *vbox; |
4513 | 1144 GtkWidget *warning_dlg = |
1145 gtk_dialog_new_with_buttons( _("Audacious - visibility warning") , | |
1146 GTK_WINDOW(mainwin) , | |
1147 GTK_DIALOG_DESTROY_WITH_PARENT , | |
1148 _("Show main player window") , | |
1149 GTK_RESPONSE_OK , _("Ignore") , | |
1150 GTK_RESPONSE_CANCEL , NULL ); | |
1151 | |
2651
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1152 vbox = gtk_vbox_new( FALSE , 4 ); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1153 gtk_container_set_border_width( GTK_CONTAINER(vbox) , 4 ); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1154 gtk_box_pack_start( GTK_BOX(GTK_DIALOG(warning_dlg)->vbox) , vbox , TRUE , TRUE , 0 ); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1155 label = gtk_label_new( _("Audacious has been started with all of its windows hidden.\n" |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1156 "You may want to show the player window again to control Audacious; " |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1157 "otherwise, you'll have to control it remotely via audtool or " |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1158 "enabled plugins (such as the statusicon plugin).") ); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1159 gtk_label_set_line_wrap( GTK_LABEL(label) , TRUE ); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1160 gtk_misc_set_alignment( GTK_MISC(label) , 0.0 , 0.0 ); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1161 checkbt = gtk_check_button_new_with_label( _("Always ignore, show/hide is controlled remotely") ); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1162 gtk_box_pack_start( GTK_BOX(vbox) , label , TRUE , TRUE , 0 ); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1163 gtk_box_pack_start( GTK_BOX(vbox) , checkbt , TRUE , TRUE , 0 ); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1164 g_signal_connect( G_OBJECT(checkbt) , "toggled" , |
4513 | 1165 G_CALLBACK(on_visibility_warning_toggle) , NULL ); |
2651
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1166 g_signal_connect( G_OBJECT(warning_dlg) , "response" , |
4513 | 1167 G_CALLBACK(on_visibility_warning_response) , NULL ); |
2651
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1168 gtk_widget_show_all(warning_dlg); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1169 } |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1170 } |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1171 |
3965
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1172 static void |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1173 on_broken_gtk_engine_warning_toggle(GtkToggleButton *tbt, gpointer unused) |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1174 { |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1175 cfg.warn_about_broken_gtk_engines = !gtk_toggle_button_get_active(tbt); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1176 } |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1177 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1178 void |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1179 ui_main_check_theme_engine(void) |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1180 { |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1181 GtkSettings *settings; |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1182 GtkWidget *widget; |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1183 gchar *theme = NULL; |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1184 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1185 widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1186 gtk_widget_ensure_style(widget); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1187 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1188 settings = gtk_settings_get_default(); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1189 g_object_get(G_OBJECT(settings), "gtk-theme-name", &theme, NULL); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1190 gtk_widget_destroy(widget); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1191 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1192 if (theme == NULL) |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1193 return; |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1194 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1195 if (g_ascii_strcasecmp(theme, "Qt")) |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1196 { |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1197 g_free(theme); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1198 return; |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1199 } |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1200 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1201 if (cfg.warn_about_broken_gtk_engines) |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1202 { |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1203 gchar *msg; |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1204 GtkWidget *label, *checkbt, *vbox; |
3976
608590ec4548
- first update-po after a long time -> update of German translation
mf0102 <0102@gmx.at>
parents:
3965
diff
changeset
|
1205 GtkWidget *warning_dlg = |
608590ec4548
- first update-po after a long time -> update of German translation
mf0102 <0102@gmx.at>
parents:
3965
diff
changeset
|
1206 gtk_dialog_new_with_buttons( _("Audacious - broken GTK engine usage warning") , |
4513 | 1207 GTK_WINDOW(mainwin) , GTK_DIALOG_DESTROY_WITH_PARENT , |
1208 GTK_STOCK_CLOSE, GTK_RESPONSE_OK, NULL ); | |
3965
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1209 vbox = gtk_vbox_new( FALSE , 4 ); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1210 gtk_container_set_border_width( GTK_CONTAINER(vbox) , 4 ); |
3976
608590ec4548
- first update-po after a long time -> update of German translation
mf0102 <0102@gmx.at>
parents:
3965
diff
changeset
|
1211 gtk_box_pack_start( GTK_BOX(GTK_DIALOG(warning_dlg)->vbox) , vbox , |
608590ec4548
- first update-po after a long time -> update of German translation
mf0102 <0102@gmx.at>
parents:
3965
diff
changeset
|
1212 TRUE , TRUE , 0 ); |
3965
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1213 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1214 msg = g_strdup_printf(_("<big><b>Broken GTK engine in use</b></big>\n\n" |
4513 | 1215 "Audacious has detected that you are using a broken GTK engine.\n\n" |
1216 "The theme engine you are using, <i>%s</i>, is incompatible with some of the features " | |
1217 "used by modern skins. The incompatible features have been disabled for this session.\n\n" | |
1218 "To use these features, please consider using a different GTK theme engine."), theme); | |
3965
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1219 label = gtk_label_new(msg); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1220 gtk_label_set_use_markup(GTK_LABEL(label), TRUE); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1221 g_free(msg); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1222 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1223 gtk_label_set_line_wrap( GTK_LABEL(label) , TRUE ); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1224 gtk_misc_set_alignment( GTK_MISC(label) , 0.0 , 0.0 ); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1225 checkbt = gtk_check_button_new_with_label( _("Do not display this warning again") ); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1226 gtk_box_pack_start( GTK_BOX(vbox) , label , TRUE , TRUE , 0 ); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1227 gtk_box_pack_start( GTK_BOX(vbox) , checkbt , TRUE , TRUE , 0 ); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1228 g_signal_connect( G_OBJECT(checkbt) , "toggled" , |
4513 | 1229 G_CALLBACK(on_broken_gtk_engine_warning_toggle) , NULL ); |
3965
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1230 g_signal_connect( G_OBJECT(warning_dlg) , "response" , |
4513 | 1231 G_CALLBACK(gtk_widget_destroy) , NULL ); |
3965
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1232 gtk_widget_show_all(warning_dlg); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1233 gtk_window_stick(GTK_WINDOW(warning_dlg)); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1234 } |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1235 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1236 cfg.disable_inline_gtk = TRUE; |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1237 |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1238 g_free(theme); |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1239 } |
aea8b763b134
Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents:
3958
diff
changeset
|
1240 |
2313 | 1241 void |
1242 mainwin_show_add_url_window(void) | |
1243 { | |
1244 static GtkWidget *url_window = NULL; | |
1245 | |
1246 if (!url_window) { | |
1247 url_window = | |
1248 util_add_url_dialog_new(_("Enter location to play:"), | |
4513 | 1249 G_CALLBACK(on_add_url_ok_clicked), |
2313 | 1250 G_CALLBACK(on_add_url_add_clicked)); |
1251 gtk_window_set_transient_for(GTK_WINDOW(url_window), | |
1252 GTK_WINDOW(mainwin)); | |
1253 g_signal_connect(url_window, "destroy", | |
1254 G_CALLBACK(gtk_widget_destroyed), | |
1255 &url_window); | |
1256 } | |
1257 | |
1258 gtk_window_present(GTK_WINDOW(url_window)); | |
1259 } | |
1260 | |
1261 static void | |
1262 check_set( GtkActionGroup * action_group , | |
1263 const gchar * action_name , | |
1264 gboolean is_on ) | |
1265 { | |
1266 /* check_set noew uses gtkaction */ | |
1267 GtkAction *action = gtk_action_group_get_action( action_group , action_name ); | |
1268 if ( action != NULL ) | |
1269 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , is_on ); | |
1270 return; | |
1271 } | |
1272 | |
1273 void | |
1274 mainwin_eject_pushed(void) | |
1275 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
1276 run_filebrowser(PLAY_BUTTON); |
2313 | 1277 } |
1278 | |
1279 void | |
1280 mainwin_rev_pushed(void) | |
1281 { | |
1282 g_get_current_time(&cb_time); | |
1283 | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1284 seek_initial_pos = ui_skinned_horizontal_slider_get_position(mainwin_position); |
2313 | 1285 seek_state = MAINWIN_SEEK_REV; |
3679
eadc001add02
Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
William Pitcock <nenolod@atheme.org>
parents:
3678
diff
changeset
|
1286 mainwin_timeout_id = g_timeout_add(MAINWIN_UPDATE_INTERVAL, |
4513 | 1287 (GSourceFunc) mainwin_idle_func, NULL); |
2313 | 1288 } |
1289 | |
1290 void | |
1291 mainwin_rev_release(void) | |
1292 { | |
1293 GTimeVal now_time; | |
1294 GTimeVal delta_time; | |
1295 gulong now_dur; | |
1296 | |
1297 g_get_current_time(&now_time); | |
1298 | |
1299 delta_time.tv_usec = now_time.tv_usec - cb_time.tv_usec; | |
1300 delta_time.tv_sec = now_time.tv_sec - cb_time.tv_sec; | |
1301 | |
1302 now_dur = labs((delta_time.tv_sec * 1000) + (glong) (delta_time.tv_usec / 1000)); | |
1303 | |
1304 if ( now_dur <= TRISTATE_THRESHOLD ) | |
1305 { | |
1306 /* interpret as 'skip to previous song' */ | |
1307 playlist_prev(playlist_get_active()); | |
1308 } | |
1309 else | |
1310 { | |
1311 /* interpret as 'seek' */ | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1312 mainwin_position_release_cb( mainwin_position, ui_skinned_horizontal_slider_get_position(mainwin_position) ); |
2313 | 1313 } |
1314 | |
1315 seek_state = MAINWIN_SEEK_NIL; | |
3679
eadc001add02
Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
William Pitcock <nenolod@atheme.org>
parents:
3678
diff
changeset
|
1316 |
eadc001add02
Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
William Pitcock <nenolod@atheme.org>
parents:
3678
diff
changeset
|
1317 g_source_remove(mainwin_timeout_id); |
eadc001add02
Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
William Pitcock <nenolod@atheme.org>
parents:
3678
diff
changeset
|
1318 mainwin_timeout_id = 0; |
2313 | 1319 } |
1320 | |
1321 void | |
1322 mainwin_fwd_pushed(void) | |
1323 { | |
1324 g_get_current_time(&cb_time); | |
3679
eadc001add02
Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
William Pitcock <nenolod@atheme.org>
parents:
3678
diff
changeset
|
1325 |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1326 seek_initial_pos = ui_skinned_horizontal_slider_get_position(mainwin_position); |
2313 | 1327 seek_state = MAINWIN_SEEK_FWD; |
3679
eadc001add02
Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
William Pitcock <nenolod@atheme.org>
parents:
3678
diff
changeset
|
1328 mainwin_timeout_id = g_timeout_add(MAINWIN_UPDATE_INTERVAL, |
4513 | 1329 (GSourceFunc) mainwin_idle_func, NULL); |
2313 | 1330 } |
1331 | |
1332 void | |
1333 mainwin_fwd_release(void) | |
1334 { | |
1335 GTimeVal now_time; | |
1336 GTimeVal delta_time; | |
1337 gulong now_dur; | |
1338 | |
1339 g_get_current_time(&now_time); | |
1340 | |
1341 delta_time.tv_usec = now_time.tv_usec - cb_time.tv_usec; | |
1342 delta_time.tv_sec = now_time.tv_sec - cb_time.tv_sec; | |
1343 | |
1344 now_dur = labs((delta_time.tv_sec * 1000) + (glong) (delta_time.tv_usec / 1000)); | |
1345 | |
1346 if ( now_dur <= TRISTATE_THRESHOLD ) | |
1347 { | |
2480
bb2f191895ce
[svn] - fixed crash when skipping to next song with an empty playlist
marvin
parents:
2478
diff
changeset
|
1348 /* interpret as 'skip to next song' */ |
2313 | 1349 playlist_next(playlist_get_active()); |
1350 } | |
1351 else | |
1352 { | |
1353 /* interpret as 'seek' */ | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1354 mainwin_position_release_cb( mainwin_position, ui_skinned_horizontal_slider_get_position(mainwin_position) ); |
2313 | 1355 } |
1356 | |
1357 seek_state = MAINWIN_SEEK_NIL; | |
3679
eadc001add02
Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
William Pitcock <nenolod@atheme.org>
parents:
3678
diff
changeset
|
1358 |
eadc001add02
Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
William Pitcock <nenolod@atheme.org>
parents:
3678
diff
changeset
|
1359 g_source_remove(mainwin_timeout_id); |
eadc001add02
Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
William Pitcock <nenolod@atheme.org>
parents:
3678
diff
changeset
|
1360 mainwin_timeout_id = 0; |
2313 | 1361 } |
1362 | |
1363 void | |
1364 mainwin_play_pushed(void) | |
1365 { | |
1366 if (ab_position_a != -1) | |
1367 playback_seek(ab_position_a / 1000); | |
1368 if (playback_get_paused()) { | |
1369 playback_pause(); | |
1370 return; | |
1371 } | |
1372 | |
1373 if (playlist_get_length(playlist_get_active())) | |
1374 playback_initiate(); | |
1375 else | |
1376 mainwin_eject_pushed(); | |
1377 } | |
1378 | |
1379 void | |
1380 mainwin_stop_pushed(void) | |
1381 { | |
1382 ip_data.stop = TRUE; | |
3241 | 1383 playback_stop(); |
2313 | 1384 mainwin_clear_song_info(); |
3082
91df04ec5ef7
From: Daniel Drake <dsd@gentoo.org>
William Pitcock <nenolod@atheme-project.org>
parents:
3042
diff
changeset
|
1385 ab_position_a = ab_position_b = -1; |
2313 | 1386 ip_data.stop = FALSE; |
1387 } | |
1388 | |
1389 void | |
1390 mainwin_shuffle_pushed(gboolean toggled) | |
1391 { | |
1392 check_set( toggleaction_group_others , "playback shuffle" , toggled ); | |
1393 } | |
1394 | |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1395 void mainwin_shuffle_pushed_cb(void) { |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1396 mainwin_shuffle_pushed(UI_SKINNED_BUTTON(mainwin_shuffle)->inside); |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1397 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1398 |
2313 | 1399 void |
1400 mainwin_repeat_pushed(gboolean toggled) | |
1401 { | |
1402 check_set( toggleaction_group_others , "playback repeat" , toggled ); | |
1403 } | |
1404 | |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1405 void mainwin_repeat_pushed_cb(void) { |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1406 mainwin_repeat_pushed(UI_SKINNED_BUTTON(mainwin_repeat)->inside); |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1407 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1408 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1409 void mainwin_equalizer_pushed_cb(void) { |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1410 mainwin_eq_pushed(UI_SKINNED_BUTTON(mainwin_eq)->inside); |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1411 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1412 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1413 void mainwin_playlist_pushed_cb(void) { |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1414 mainwin_pl_pushed(UI_SKINNED_BUTTON(mainwin_pl)->inside); |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1415 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1416 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1417 void |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1418 mainwin_eq_pushed(gboolean toggled) |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1419 { |
4513 | 1420 equalizerwin_show(toggled); |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1421 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1422 |
2313 | 1423 void |
1424 mainwin_pl_pushed(gboolean toggled) | |
1425 { | |
1426 if (toggled) | |
1427 playlistwin_show(); | |
1428 else | |
1429 playlistwin_hide(); | |
1430 } | |
1431 | |
1432 gint | |
1433 mainwin_spos_frame_cb(gint pos) | |
1434 { | |
1435 if (mainwin_sposition) { | |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1436 gint x = 0; |
2313 | 1437 if (pos < 6) |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1438 x = 17; |
2313 | 1439 else if (pos < 9) |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1440 x = 20; |
2313 | 1441 else |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1442 x = 23; |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1443 |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1444 UI_SKINNED_HORIZONTAL_SLIDER(mainwin_sposition)->knob_nx = x; |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1445 UI_SKINNED_HORIZONTAL_SLIDER(mainwin_sposition)->knob_px = x; |
2313 | 1446 } |
1447 return 1; | |
1448 } | |
1449 | |
1450 void | |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1451 mainwin_spos_motion_cb(GtkWidget *widget, gint pos) |
2313 | 1452 { |
1453 gint time; | |
1454 gchar *time_msg; | |
1455 Playlist *playlist = playlist_get_active(); | |
1456 | |
1457 pos--; | |
1458 | |
1459 time = ((playlist_get_current_length(playlist) / 1000) * pos) / 12; | |
1460 | |
1461 if (cfg.timer_mode == TIMER_REMAINING) { | |
1462 time = (playlist_get_current_length(playlist) / 1000) - time; | |
1463 time_msg = g_strdup_printf("-%2.2d", time / 60); | |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
1464 ui_skinned_textbox_set_text(mainwin_stime_min, time_msg); |
2313 | 1465 g_free(time_msg); |
1466 } | |
1467 else { | |
1468 time_msg = g_strdup_printf(" %2.2d", time / 60); | |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
1469 ui_skinned_textbox_set_text(mainwin_stime_min, time_msg); |
2313 | 1470 g_free(time_msg); |
1471 } | |
1472 | |
1473 time_msg = g_strdup_printf("%2.2d", time % 60); | |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
1474 ui_skinned_textbox_set_text(mainwin_stime_sec, time_msg); |
2313 | 1475 g_free(time_msg); |
1476 } | |
1477 | |
1478 void | |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1479 mainwin_spos_release_cb(GtkWidget *widget, gint pos) |
2313 | 1480 { |
1481 playback_seek(((playlist_get_current_length(playlist_get_active()) / 1000) * | |
4513 | 1482 (pos - 1)) / 12); |
2313 | 1483 } |
1484 | |
1485 void | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1486 mainwin_position_motion_cb(GtkWidget *widget, gint pos) |
2313 | 1487 { |
1488 gint length, time; | |
1489 gchar *seek_msg; | |
1490 | |
1491 length = playlist_get_current_length(playlist_get_active()) / 1000; | |
1492 time = (length * pos) / 219; | |
3108
710b3aca4d64
Lower-case letters are more convenient, aren't they ? (anyhow bitmap fonts option is still available)
Stany HENRY <StrassBoy@gmail.com>
parents:
3095
diff
changeset
|
1493 seek_msg = g_strdup_printf(_("Seek to: %d:%-2.2d/%d:%-2.2d (%d%%)"), |
2313 | 1494 time / 60, time % 60, |
1495 length / 60, length % 60, | |
1496 (length != 0) ? (time * 100) / length : 0); | |
1497 mainwin_lock_info_text(seek_msg); | |
1498 g_free(seek_msg); | |
1499 } | |
1500 | |
1501 void | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1502 mainwin_position_release_cb(GtkWidget *widget, gint pos) |
2313 | 1503 { |
1504 gint length, time; | |
1505 | |
1506 length = playlist_get_current_length(playlist_get_active()) / 1000; | |
1507 time = (length * pos) / 219; | |
1508 playback_seek(time); | |
1509 mainwin_release_info_text(); | |
1510 } | |
1511 | |
1512 gint | |
1513 mainwin_volume_frame_cb(gint pos) | |
1514 { | |
1515 return (gint) rint((pos / 52.0) * 28); | |
1516 } | |
1517 | |
1518 void | |
1519 mainwin_adjust_volume_motion(gint v) | |
1520 { | |
1521 gchar *volume_msg; | |
1522 | |
3108
710b3aca4d64
Lower-case letters are more convenient, aren't they ? (anyhow bitmap fonts option is still available)
Stany HENRY <StrassBoy@gmail.com>
parents:
3095
diff
changeset
|
1523 volume_msg = g_strdup_printf(_("Volume: %d%%"), v); |
2313 | 1524 mainwin_lock_info_text(volume_msg); |
1525 g_free(volume_msg); | |
1526 | |
1527 if (balance < 0) | |
1528 input_set_volume(v, (v * (100 - abs(balance))) / 100); | |
1529 else if (balance > 0) | |
1530 input_set_volume((v * (100 - abs(balance))) / 100, v); | |
1531 else | |
1532 input_set_volume(v, v); | |
1533 } | |
1534 | |
1535 void | |
1536 mainwin_adjust_volume_release(void) | |
1537 { | |
1538 mainwin_release_info_text(); | |
1539 } | |
1540 | |
1541 void | |
1542 mainwin_adjust_balance_motion(gint b) | |
1543 { | |
1544 gchar *balance_msg; | |
1545 gint v, pvl, pvr; | |
1546 | |
1547 balance = b; | |
1548 input_get_volume(&pvl, &pvr); | |
1549 v = MAX(pvl, pvr); | |
1550 if (b < 0) { | |
3108
710b3aca4d64
Lower-case letters are more convenient, aren't they ? (anyhow bitmap fonts option is still available)
Stany HENRY <StrassBoy@gmail.com>
parents:
3095
diff
changeset
|
1551 balance_msg = g_strdup_printf(_("Balance: %d%% left"), -b); |
2313 | 1552 input_set_volume(v, (gint) rint(((100 + b) / 100.0) * v)); |
1553 } | |
1554 else if (b == 0) { | |
3108
710b3aca4d64
Lower-case letters are more convenient, aren't they ? (anyhow bitmap fonts option is still available)
Stany HENRY <StrassBoy@gmail.com>
parents:
3095
diff
changeset
|
1555 balance_msg = g_strdup_printf(_("Balance: center")); |
2313 | 1556 input_set_volume(v, v); |
1557 } | |
1558 else { /* b > 0 */ | |
3108
710b3aca4d64
Lower-case letters are more convenient, aren't they ? (anyhow bitmap fonts option is still available)
Stany HENRY <StrassBoy@gmail.com>
parents:
3095
diff
changeset
|
1559 balance_msg = g_strdup_printf(_("Balance: %d%% right"), b); |
2313 | 1560 input_set_volume((gint) rint(((100 - b) / 100.0) * v), v); |
1561 } | |
1562 mainwin_lock_info_text(balance_msg); | |
1563 g_free(balance_msg); | |
1564 } | |
1565 | |
1566 void | |
1567 mainwin_adjust_balance_release(void) | |
1568 { | |
1569 mainwin_release_info_text(); | |
1570 } | |
1571 | |
1572 void | |
1573 mainwin_set_volume_slider(gint percent) | |
1574 { | |
3045
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
1575 ui_skinned_horizontal_slider_set_position(mainwin_volume, (gint) rint((percent * 51) / 100.0)); |
2313 | 1576 } |
1577 | |
1578 void | |
1579 mainwin_set_balance_slider(gint percent) | |
1580 { | |
3045
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
1581 ui_skinned_horizontal_slider_set_position(mainwin_balance, (gint) rint(((percent * 12) / 100.0) + 12)); |
2313 | 1582 } |
1583 | |
1584 void | |
3045
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
1585 mainwin_volume_motion_cb(GtkWidget *widget, gint pos) |
2313 | 1586 { |
1587 gint vol = (pos * 100) / 51; | |
1588 mainwin_adjust_volume_motion(vol); | |
1589 equalizerwin_set_volume_slider(vol); | |
1590 } | |
1591 | |
3724
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3718
diff
changeset
|
1592 gboolean |
3045
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
1593 mainwin_volume_release_cb(GtkWidget *widget, gint pos) |
2313 | 1594 { |
1595 mainwin_adjust_volume_release(); | |
3724
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3718
diff
changeset
|
1596 return FALSE; |
2313 | 1597 } |
1598 | |
1599 gint | |
1600 mainwin_balance_frame_cb(gint pos) | |
1601 { | |
1602 return ((abs(pos - 12) * 28) / 13); | |
1603 } | |
1604 | |
1605 void | |
3045
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
1606 mainwin_balance_motion_cb(GtkWidget *widget, gint pos) |
2313 | 1607 { |
1608 gint bal = ((pos - 12) * 100) / 12; | |
1609 mainwin_adjust_balance_motion(bal); | |
1610 equalizerwin_set_balance_slider(bal); | |
1611 } | |
1612 | |
1613 void | |
3045
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
1614 mainwin_balance_release_cb(GtkWidget *widget, gint pos) |
2313 | 1615 { |
1616 mainwin_adjust_volume_release(); | |
1617 } | |
1618 | |
1619 void | |
1620 mainwin_set_volume_diff(gint diff) | |
1621 { | |
1622 gint vl, vr, vol; | |
1623 | |
1624 input_get_volume(&vl, &vr); | |
1625 vol = MAX(vl, vr); | |
1626 vol = CLAMP(vol + diff, 0, 100); | |
1627 | |
1628 mainwin_adjust_volume_motion(vol); | |
1629 mainwin_set_volume_slider(vol); | |
1630 equalizerwin_set_volume_slider(vol); | |
3724
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3718
diff
changeset
|
1631 |
9a8e54ffdd76
prevent info text being stuck after changing volume
Tomasz Mon <desowin@gmail.com>
parents:
3718
diff
changeset
|
1632 if (mainwin_volume_release_timeout) |
4513 | 1633 g_source_remove(mainwin_volume_release_timeout); |
1634 mainwin_volume_release_timeout = | |
1635 g_timeout_add(700, (GSourceFunc)(mainwin_volume_release_cb), NULL); | |
2313 | 1636 } |
1637 | |
1638 void | |
1639 mainwin_set_balance_diff(gint diff) | |
1640 { | |
1641 gint b; | |
1642 b = CLAMP(balance + diff, -100, 100); | |
1643 mainwin_adjust_balance_motion(b); | |
1644 mainwin_set_balance_slider(b); | |
1645 equalizerwin_set_balance_slider(b); | |
1646 } | |
1647 | |
1648 void | |
1649 mainwin_show(gboolean show) | |
1650 { | |
1651 if (show) | |
1652 mainwin_real_show(); | |
1653 else | |
1654 mainwin_real_hide(); | |
1655 } | |
1656 | |
1657 void | |
1658 mainwin_real_show(void) | |
1659 { | |
1660 cfg.player_visible = TRUE; | |
1661 | |
1662 check_set( toggleaction_group_others , "show player" , TRUE ); | |
1663 | |
1664 if (cfg.player_shaded) | |
3020 | 1665 ui_vis_clear_data(mainwin_vis); |
2947 | 1666 |
2313 | 1667 if (cfg.show_wm_decorations) { |
2906
68f3b7ff4333
Remove pposition_broken global variable.
William Pitcock <nenolod@atheme.org>
parents:
2853
diff
changeset
|
1668 if (cfg.player_x != -1 && cfg.save_window_position) |
2313 | 1669 gtk_window_move(GTK_WINDOW(mainwin), cfg.player_x, cfg.player_y); |
1670 | |
1671 gtk_widget_show(mainwin); | |
1672 return; | |
1673 } | |
1674 | |
2651
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1675 if (cfg.player_x != -1 && cfg.save_window_position) |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1676 gtk_window_move(GTK_WINDOW(mainwin), cfg.player_x, cfg.player_y); |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1677 |
3908 | 1678 mainwin_refresh_hints(); |
2313 | 1679 gtk_window_present(GTK_WINDOW(mainwin)); |
1680 } | |
1681 | |
1682 void | |
1683 mainwin_real_hide(void) | |
1684 { | |
1685 check_set( toggleaction_group_others , "show player", FALSE); | |
1686 | |
1687 if (cfg.player_shaded) | |
3054 | 1688 ui_svis_clear_data(mainwin_svis); |
2313 | 1689 |
1690 gtk_widget_hide(mainwin); | |
1691 | |
1692 cfg.player_visible = FALSE; | |
1693 } | |
1694 | |
1695 | |
1696 void | |
1697 mainwin_set_stopaftersong(gboolean stop) | |
1698 { | |
1699 cfg.stopaftersong = stop; | |
1700 check_set(toggleaction_group_others, "stop after current song", cfg.stopaftersong); | |
1701 } | |
1702 | |
2769
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2717
diff
changeset
|
1703 void |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2717
diff
changeset
|
1704 mainwin_set_noplaylistadvance(gboolean no_advance) |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2717
diff
changeset
|
1705 { |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2717
diff
changeset
|
1706 cfg.no_playlist_advance = no_advance; |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2717
diff
changeset
|
1707 check_set(toggleaction_group_others, "playback no playlist advance", cfg.no_playlist_advance); |
bf2d80abf76e
[svn] Implemented CMD_IS_ADVANCE and CMD_TOGGLE_ADVANCE. Added partial MPRIS support. Root is complete, Player is partially implemented, and TrackList has not been started.
magma
parents:
2717
diff
changeset
|
1708 } |
2313 | 1709 |
1710 static void | |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
1711 mainwin_set_scaled(gboolean scaled) |
2313 | 1712 { |
1713 gint height; | |
1714 | |
1715 if (cfg.player_shaded) | |
1716 height = MAINWIN_SHADED_HEIGHT; | |
1717 else | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
1718 height = aud_active_skin->properties.mainwin_height; |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
1719 |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
1720 dock_window_resize(GTK_WINDOW(mainwin), cfg.player_shaded ? MAINWIN_SHADED_WIDTH : aud_active_skin->properties.mainwin_width, |
4513 | 1721 cfg.player_shaded ? MAINWIN_SHADED_HEIGHT : aud_active_skin->properties.mainwin_height, |
1722 aud_active_skin->properties.mainwin_width * cfg.scale_factor , aud_active_skin->properties.mainwin_height * cfg.scale_factor); | |
2313 | 1723 |
2821 | 1724 GList *iter; |
1725 for (iter = GTK_FIXED (SKINNED_WINDOW(mainwin)->fixed)->children; iter; iter = g_list_next (iter)) { | |
1726 GtkFixedChild *child_data = (GtkFixedChild *) iter->data; | |
1727 GtkWidget *child = child_data->widget; | |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
1728 g_signal_emit_by_name(child, "toggle-scaled"); |
2821 | 1729 } |
1730 | |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3218
diff
changeset
|
1731 mainwin_refresh_hints(); |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
1732 gtk_widget_shape_combine_mask(mainwin, skin_get_mask(aud_active_skin, SKIN_MASK_MAIN + cfg.player_shaded), 0, 0); |
2313 | 1733 } |
1734 | |
1735 void | |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
1736 set_scaled(gboolean scaled) |
2313 | 1737 { |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
1738 cfg.scaled = scaled; |
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
1739 |
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
1740 mainwin_set_scaled(scaled); |
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
1741 |
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
1742 if (cfg.eq_scaled_linked) |
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
1743 equalizerwin_set_scaled(scaled); |
2313 | 1744 } |
1745 | |
1746 | |
1747 | |
1748 void | |
1749 mainwin_general_menu_callback(gpointer data, | |
1750 guint action, | |
1751 GtkWidget * item) | |
1752 { | |
1753 Playlist *playlist = playlist_get_active(); | |
1754 | |
1755 switch (action) { | |
4513 | 1756 case MAINWIN_GENERAL_PREFS: |
1757 show_prefs_window(); | |
1758 break; | |
1759 case MAINWIN_GENERAL_ABOUT: | |
1760 show_about_window(); | |
1761 break; | |
1762 case MAINWIN_GENERAL_PLAYFILE: | |
1763 run_filebrowser(NO_PLAY_BUTTON); | |
1764 break; | |
1765 case MAINWIN_GENERAL_PLAYLOCATION: | |
1766 mainwin_show_add_url_window(); | |
1767 break; | |
1768 case MAINWIN_GENERAL_FILEINFO: | |
4514
0fe46317167f
renamed playlist_fileinfo* to ui_fileinfo_show* and reworked those
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
1769 ui_fileinfo_show_current(playlist); |
4513 | 1770 break; |
1771 case MAINWIN_GENERAL_FOCUSPLWIN: | |
1772 gtk_window_present(GTK_WINDOW(playlistwin)); | |
1773 break; | |
1774 case MAINWIN_GENERAL_SHOWMWIN: | |
1775 mainwin_show(GTK_CHECK_MENU_ITEM(item)->active); | |
1776 break; | |
1777 case MAINWIN_GENERAL_SHOWPLWIN: | |
1778 if (GTK_CHECK_MENU_ITEM(item)->active) | |
1779 playlistwin_show(); | |
1780 else | |
1781 playlistwin_hide(); | |
1782 break; | |
1783 case MAINWIN_GENERAL_SHOWEQWIN: | |
1784 if (GTK_CHECK_MENU_ITEM(item)->active) | |
1785 equalizerwin_real_show(); | |
1786 else | |
1787 equalizerwin_real_hide(); | |
1788 break; | |
1789 case MAINWIN_GENERAL_PREV: | |
1790 playlist_prev(playlist); | |
1791 break; | |
1792 case MAINWIN_GENERAL_PLAY: | |
1793 mainwin_play_pushed(); | |
1794 break; | |
1795 case MAINWIN_GENERAL_PAUSE: | |
1796 playback_pause(); | |
1797 break; | |
1798 case MAINWIN_GENERAL_STOP: | |
1799 mainwin_stop_pushed(); | |
1800 break; | |
1801 case MAINWIN_GENERAL_NEXT: | |
1802 playlist_next(playlist); | |
1803 break; | |
1804 case MAINWIN_GENERAL_BACK5SEC: | |
1805 if (playback_get_playing() | |
1806 && playlist_get_current_length(playlist) != -1) | |
1807 playback_seek_relative(-5); | |
1808 break; | |
1809 case MAINWIN_GENERAL_FWD5SEC: | |
1810 if (playback_get_playing() | |
1811 && playlist_get_current_length(playlist) != -1) | |
1812 playback_seek_relative(5); | |
1813 break; | |
1814 case MAINWIN_GENERAL_START: | |
1815 playlist_set_position(playlist, 0); | |
1816 break; | |
1817 case MAINWIN_GENERAL_JTT: | |
1818 mainwin_jump_to_time(); | |
1819 break; | |
1820 case MAINWIN_GENERAL_JTF: | |
1821 ui_jump_to_track(); | |
1822 break; | |
1823 case MAINWIN_GENERAL_EXIT: | |
1824 mainwin_quit_cb(); | |
1825 break; | |
1826 case MAINWIN_GENERAL_SETAB: | |
1827 if (playlist_get_current_length(playlist) != -1) { | |
1828 if (ab_position_a == -1) { | |
1829 ab_position_a = playback_get_time(); | |
1830 ab_position_b = -1; | |
1831 mainwin_lock_info_text("'Loop-Point A Position' set."); | |
1832 } else if (ab_position_b == -1) { | |
1833 int time = playback_get_time(); | |
1834 if (time > ab_position_a) | |
1835 ab_position_b = time; | |
1836 mainwin_release_info_text(); | |
1837 } else { | |
1838 ab_position_a = playback_get_time(); | |
1839 ab_position_b = -1; | |
1840 mainwin_lock_info_text("'Loop-Point A Position' reset."); | |
1841 } | |
2313 | 1842 } |
4513 | 1843 break; |
1844 case MAINWIN_GENERAL_CLEARAB: | |
1845 if (playlist_get_current_length(playlist) != -1) { | |
1846 ab_position_a = ab_position_b = -1; | |
1847 mainwin_release_info_text(); | |
1848 } | |
1849 break; | |
1850 case MAINWIN_GENERAL_NEW_PL: | |
1851 { | |
1852 Playlist *new_pl = playlist_new(); | |
1853 playlist_add_playlist(new_pl); | |
1854 playlist_select_playlist(new_pl); | |
1855 } | |
1856 break; | |
1857 case MAINWIN_GENERAL_PREV_PL: | |
1858 playlist_select_prev(); | |
1859 break; | |
1860 case MAINWIN_GENERAL_NEXT_PL: | |
1861 playlist_select_next(); | |
1862 break; | |
2313 | 1863 } |
1864 } | |
1865 | |
1866 static void | |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
1867 mainwin_mr_change(GtkWidget *widget, MenuRowItem i) |
2313 | 1868 { |
1869 switch (i) { | |
4513 | 1870 case MENUROW_OPTIONS: |
1871 mainwin_lock_info_text(_("Options Menu")); | |
1872 break; | |
1873 case MENUROW_ALWAYS: | |
1874 if (UI_SKINNED_MENUROW(mainwin_menurow)->always_selected) | |
1875 mainwin_lock_info_text(_("Disable 'Always On Top'")); | |
1876 else | |
1877 mainwin_lock_info_text(_("Enable 'Always On Top'")); | |
1878 break; | |
1879 case MENUROW_FILEINFOBOX: | |
1880 mainwin_lock_info_text(_("File Info Box")); | |
1881 break; | |
1882 case MENUROW_SCALE: | |
1883 if (UI_SKINNED_MENUROW(mainwin_menurow)->scale_selected) | |
1884 mainwin_lock_info_text(_("Disable 'GUI Scaling'")); | |
1885 else | |
1886 mainwin_lock_info_text(_("Enable 'GUI Scaling'")); | |
1887 break; | |
1888 case MENUROW_VISUALIZATION: | |
1889 mainwin_lock_info_text(_("Visualization Menu")); | |
1890 break; | |
1891 case MENUROW_NONE: | |
1892 break; | |
2313 | 1893 } |
1894 } | |
1895 | |
1896 static void | |
4135
07c1639b110b
the less calls to gdk_window_get_pointer the better
Tomasz Mon <desowin@gmail.com>
parents:
4134
diff
changeset
|
1897 mainwin_mr_release(GtkWidget *widget, MenuRowItem i, GdkEventButton *event) |
2313 | 1898 { |
1899 switch (i) { | |
4513 | 1900 case MENUROW_OPTIONS: |
1901 ui_manager_popup_menu_show(GTK_MENU(mainwin_view_menu), | |
1902 event->x_root, event->y_root, 1, | |
1903 event->time); | |
1904 break; | |
1905 case MENUROW_ALWAYS: | |
1906 gtk_toggle_action_set_active( | |
1907 GTK_TOGGLE_ACTION(gtk_action_group_get_action( | |
1908 toggleaction_group_others , "view always on top" )) , | |
1909 UI_SKINNED_MENUROW(mainwin_menurow)->always_selected ); | |
1910 break; | |
1911 case MENUROW_FILEINFOBOX: | |
4514
0fe46317167f
renamed playlist_fileinfo* to ui_fileinfo_show* and reworked those
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
1912 ui_fileinfo_show_current(playlist_get_active()); |
4513 | 1913 break; |
1914 case MENUROW_SCALE: | |
1915 gtk_toggle_action_set_active( | |
1916 GTK_TOGGLE_ACTION(gtk_action_group_get_action( | |
1917 toggleaction_group_others , "view scaled" )) , | |
1918 UI_SKINNED_MENUROW(mainwin_menurow)->scale_selected ); | |
1919 break; | |
1920 case MENUROW_VISUALIZATION: | |
1921 ui_manager_popup_menu_show(GTK_MENU(mainwin_visualization_menu), | |
1922 event->x_root, event->y_root, 1, | |
1923 event->time); | |
1924 break; | |
1925 case MENUROW_NONE: | |
1926 break; | |
2313 | 1927 } |
1928 mainwin_release_info_text(); | |
1929 } | |
1930 | |
3157
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
1931 void |
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
1932 run_no_output_device_dialog(gpointer hook_data, gpointer user_data) |
2313 | 1933 { |
1934 const gchar *markup = | |
1935 N_("<b><big>Couldn't open audio.</big></b>\n\n" | |
1936 "Please check that:\n" | |
1937 "1. You have the correct output plugin selected.\n" | |
1938 "2. No other programs is blocking the soundcard.\n" | |
1939 "3. Your soundcard is configured properly.\n"); | |
1940 | |
3157
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
1941 GDK_THREADS_ENTER(); |
2313 | 1942 GtkWidget *dialog = |
1943 gtk_message_dialog_new_with_markup(GTK_WINDOW(mainwin), | |
1944 GTK_DIALOG_DESTROY_WITH_PARENT, | |
1945 GTK_MESSAGE_ERROR, | |
1946 GTK_BUTTONS_OK, | |
1947 _(markup)); | |
1948 gtk_dialog_run(GTK_DIALOG(dialog)); | |
1949 gtk_widget_destroy(dialog); | |
3157
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
1950 GDK_THREADS_LEAVE(); |
2313 | 1951 } |
1952 | |
1953 void | |
3678
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1954 ui_main_set_initial_volume(void) |
2313 | 1955 { |
1956 gint vl, vr, b, v; | |
1957 | |
1958 input_get_volume(&vl, &vr); | |
1959 | |
3678
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1960 vl = CLAMP(vl, 0, 100); |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1961 vr = CLAMP(vr, 0, 100); |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1962 v = MAX(vl, vr); |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1963 if (vl > vr) |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1964 b = (gint) rint(((gdouble) vr / vl) * 100) - 100; |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1965 else if (vl < vr) |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1966 b = 100 - (gint) rint(((gdouble) vl / vr) * 100); |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1967 else |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1968 b = 0; |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1969 |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1970 mainwin_set_volume_slider(v); |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1971 equalizerwin_set_volume_slider(v); |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1972 mainwin_set_balance_slider(b); |
e82ad057d1db
Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents:
3677
diff
changeset
|
1973 equalizerwin_set_balance_slider(b); |
2313 | 1974 } |
1975 | |
1976 static void | |
1977 set_timer_mode(TimerMode mode) | |
1978 { | |
1979 if (mode == TIMER_ELAPSED) | |
1980 check_set(radioaction_group_viewtime, "view time elapsed", TRUE); | |
1981 else | |
1982 check_set(radioaction_group_viewtime, "view time remaining", TRUE); | |
1983 } | |
1984 | |
1985 static void | |
1986 set_timer_mode_menu_cb(TimerMode mode) | |
1987 { | |
1988 cfg.timer_mode = mode; | |
1989 } | |
1990 | |
3366
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
1991 gboolean |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
1992 change_timer_mode_cb(GtkWidget *widget, GdkEventButton *event) |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
1993 { |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
1994 if (event->button == 1) { |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
1995 change_timer_mode(); |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
1996 } else if (event->button == 3) |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
1997 return FALSE; |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
1998 |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
1999 return TRUE; |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
2000 } |
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
2001 |
4513 | 2002 static void change_timer_mode(void) { |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
2003 if (cfg.timer_mode == TIMER_ELAPSED) |
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
2004 set_timer_mode(TIMER_REMAINING); |
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
2005 else |
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
2006 set_timer_mode(TIMER_ELAPSED); |
3367
b47e36a480b3
don't call mainwin_update_song_info if track isn't played
Tomasz Mon <desowin@gmail.com>
parents:
3366
diff
changeset
|
2007 if (playback_get_playing()) |
b47e36a480b3
don't call mainwin_update_song_info if track isn't played
Tomasz Mon <desowin@gmail.com>
parents:
3366
diff
changeset
|
2008 mainwin_update_song_info(); |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
2009 } |
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
2010 |
2313 | 2011 static void |
2012 mainwin_playlist_prev(void) | |
2013 { | |
2014 playlist_prev(playlist_get_active()); | |
2015 } | |
2016 | |
2017 static void | |
2018 mainwin_playlist_next(void) | |
2019 { | |
2020 playlist_next(playlist_get_active()); | |
2021 } | |
2022 | |
2023 void | |
2024 mainwin_setup_menus(void) | |
2025 { | |
2026 set_timer_mode(cfg.timer_mode); | |
2027 | |
2028 /* View menu */ | |
2029 | |
2030 check_set(toggleaction_group_others, "view always on top", cfg.always_on_top); | |
2031 check_set(toggleaction_group_others, "view put on all workspaces", cfg.sticky); | |
2032 check_set(toggleaction_group_others, "roll up player", cfg.player_shaded); | |
2033 check_set(toggleaction_group_others, "roll up playlist editor", cfg.playlist_shaded); | |
2034 check_set(toggleaction_group_others, "roll up equalizer", cfg.equalizer_shaded); | |
2035 check_set(toggleaction_group_others, "view easy move", cfg.easy_move); | |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
2036 check_set(toggleaction_group_others, "view scaled", cfg.scaled); |
2313 | 2037 |
2038 /* Songname menu */ | |
2039 | |
2040 check_set(toggleaction_group_others, "autoscroll songname", cfg.autoscroll); | |
2041 check_set(toggleaction_group_others, "stop after current song", cfg.stopaftersong); | |
2042 | |
2043 /* Playback menu */ | |
2044 | |
2045 check_set(toggleaction_group_others, "playback repeat", cfg.repeat); | |
2046 check_set(toggleaction_group_others, "playback shuffle", cfg.shuffle); | |
2047 check_set(toggleaction_group_others, "playback no playlist advance", cfg.no_playlist_advance); | |
2048 | |
2049 /* Visualization menu */ | |
2050 | |
2051 switch ( cfg.vis_type ) | |
2052 { | |
4513 | 2053 case VIS_ANALYZER: |
2054 check_set(radioaction_group_vismode, "vismode analyzer", TRUE); | |
2055 break; | |
2056 case VIS_SCOPE: | |
2057 check_set(radioaction_group_vismode, "vismode scope", TRUE); | |
2058 break; | |
2059 case VIS_VOICEPRINT: | |
2060 check_set(radioaction_group_vismode, "vismode voiceprint", TRUE); | |
2061 break; | |
2062 case VIS_OFF: | |
2063 default: | |
2064 check_set(radioaction_group_vismode, "vismode off", TRUE); | |
2065 break; | |
2313 | 2066 } |
2067 | |
2068 switch ( cfg.analyzer_mode ) | |
2069 { | |
4513 | 2070 case ANALYZER_FIRE: |
2071 check_set(radioaction_group_anamode, "anamode fire", TRUE); | |
2072 break; | |
2073 case ANALYZER_VLINES: | |
2074 check_set(radioaction_group_anamode, "anamode vertical lines", TRUE); | |
2075 break; | |
2076 case ANALYZER_NORMAL: | |
2077 default: | |
2078 check_set(radioaction_group_anamode, "anamode normal", TRUE); | |
2079 break; | |
2313 | 2080 } |
2081 | |
2082 switch ( cfg.analyzer_type ) | |
2083 { | |
4513 | 2084 case ANALYZER_BARS: |
2085 check_set(radioaction_group_anatype, "anatype bars", TRUE); | |
2086 break; | |
2087 case ANALYZER_LINES: | |
2088 default: | |
2089 check_set(radioaction_group_anatype, "anatype lines", TRUE); | |
2090 break; | |
2313 | 2091 } |
2092 | |
2093 check_set(toggleaction_group_others, "anamode peaks", cfg.analyzer_peaks ); | |
2094 | |
2095 switch ( cfg.scope_mode ) | |
2096 { | |
4513 | 2097 case SCOPE_LINE: |
2098 check_set(radioaction_group_scomode, "scomode line", TRUE); | |
2099 break; | |
2100 case SCOPE_SOLID: | |
2101 check_set(radioaction_group_scomode, "scomode solid", TRUE); | |
2102 break; | |
2103 case SCOPE_DOT: | |
2104 default: | |
2105 check_set(radioaction_group_scomode, "scomode dot", TRUE); | |
2106 break; | |
2313 | 2107 } |
2108 | |
2109 switch ( cfg.voiceprint_mode ) | |
2110 { | |
4513 | 2111 case VOICEPRINT_FIRE: |
2112 check_set(radioaction_group_vprmode, "vprmode fire", TRUE); | |
2113 break; | |
2114 case VOICEPRINT_ICE: | |
2115 check_set(radioaction_group_vprmode, "vprmode ice", TRUE); | |
2116 break; | |
2117 case VOICEPRINT_NORMAL: | |
2118 default: | |
2119 check_set(radioaction_group_vprmode, "vprmode normal", TRUE); | |
2120 break; | |
2313 | 2121 } |
2122 | |
2123 switch ( cfg.vu_mode ) | |
2124 { | |
4513 | 2125 case VU_SMOOTH: |
2126 check_set(radioaction_group_wshmode, "wshmode smooth", TRUE); | |
2127 break; | |
2128 case VU_NORMAL: | |
2129 default: | |
2130 check_set(radioaction_group_wshmode, "wshmode normal", TRUE); | |
2131 break; | |
2313 | 2132 } |
2133 | |
2134 switch ( cfg.vis_refresh ) | |
2135 { | |
4513 | 2136 case REFRESH_HALF: |
2137 check_set(radioaction_group_refrate, "refrate half", TRUE); | |
2138 break; | |
2139 case REFRESH_QUARTER: | |
2140 check_set(radioaction_group_refrate, "refrate quarter", TRUE); | |
2141 break; | |
2142 case REFRESH_EIGTH: | |
2143 check_set(radioaction_group_refrate, "refrate eighth", TRUE); | |
2144 break; | |
2145 case REFRESH_FULL: | |
2146 default: | |
2147 check_set(radioaction_group_refrate, "refrate full", TRUE); | |
2148 break; | |
2313 | 2149 } |
2150 | |
2151 switch ( cfg.analyzer_falloff ) | |
2152 { | |
4513 | 2153 case FALLOFF_SLOW: |
2154 check_set(radioaction_group_anafoff, "anafoff slow", TRUE); | |
2155 break; | |
2156 case FALLOFF_MEDIUM: | |
2157 check_set(radioaction_group_anafoff, "anafoff medium", TRUE); | |
2158 break; | |
2159 case FALLOFF_FAST: | |
2160 check_set(radioaction_group_anafoff, "anafoff fast", TRUE); | |
2161 break; | |
2162 case FALLOFF_FASTEST: | |
2163 check_set(radioaction_group_anafoff, "anafoff fastest", TRUE); | |
2164 break; | |
2165 case FALLOFF_SLOWEST: | |
2166 default: | |
2167 check_set(radioaction_group_anafoff, "anafoff slowest", TRUE); | |
2168 break; | |
2313 | 2169 } |
2170 | |
2171 switch ( cfg.peaks_falloff ) | |
2172 { | |
4513 | 2173 case FALLOFF_SLOW: |
2174 check_set(radioaction_group_peafoff, "peafoff slow", TRUE); | |
2175 break; | |
2176 case FALLOFF_MEDIUM: | |
2177 check_set(radioaction_group_peafoff, "peafoff medium", TRUE); | |
2178 break; | |
2179 case FALLOFF_FAST: | |
2180 check_set(radioaction_group_peafoff, "peafoff fast", TRUE); | |
2181 break; | |
2182 case FALLOFF_FASTEST: | |
2183 check_set(radioaction_group_peafoff, "peafoff fastest", TRUE); | |
2184 break; | |
2185 case FALLOFF_SLOWEST: | |
2186 default: | |
2187 check_set(radioaction_group_peafoff, "peafoff slowest", TRUE); | |
2188 break; | |
2313 | 2189 } |
2190 | |
2191 } | |
2192 | |
2911 | 2193 static void mainwin_info_double_clicked_cb(void) { |
4514
0fe46317167f
renamed playlist_fileinfo* to ui_fileinfo_show* and reworked those
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
2194 ui_fileinfo_show_current(playlist_get_active()); |
2911 | 2195 } |
2196 | |
4513 | 2197 static void |
2198 mainwin_info_right_clicked_cb(GtkWidget *widget, GdkEventButton *event) | |
2199 { | |
2200 ui_manager_popup_menu_show(GTK_MENU(mainwin_songname_menu), | |
2201 event->x_root, event->y_root, 3, event->time); | |
2911 | 2202 } |
2203 | |
2313 | 2204 static void |
2205 mainwin_create_widgets(void) | |
2206 { | |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2207 mainwin_menubtn = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2208 ui_skinned_push_button_setup(mainwin_menubtn, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2209 6, 3, 9, 9, 0, 0, 0, 9, SKIN_TITLEBAR); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2210 g_signal_connect(mainwin_menubtn, "clicked", mainwin_menubtn_cb, NULL ); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2211 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2212 mainwin_minimize = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2213 ui_skinned_push_button_setup(mainwin_minimize, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2214 244, 3, 9, 9, 9, 0, 9, 9, SKIN_TITLEBAR); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2215 g_signal_connect(mainwin_minimize, "clicked", mainwin_minimize_cb, NULL ); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2216 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2217 mainwin_shade = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2218 ui_skinned_push_button_setup(mainwin_shade, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2219 254, 3, 9, 9, 0, |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2220 cfg.player_shaded ? 27 : 18, 9, cfg.player_shaded ? 27 : 18, SKIN_TITLEBAR); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2221 g_signal_connect(mainwin_shade, "clicked", mainwin_shade_toggle, NULL ); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2222 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2223 mainwin_close = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2224 ui_skinned_push_button_setup(mainwin_close, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2225 264, 3, 9, 9, 18, 0, 18, 9, SKIN_TITLEBAR); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2226 g_signal_connect(mainwin_close, "clicked", mainwin_quit_cb, NULL ); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2227 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2228 mainwin_rew = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2229 ui_skinned_push_button_setup(mainwin_rew, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2230 16, 88, 23, 18, 0, 0, 0, 18, SKIN_CBUTTONS); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2231 g_signal_connect(mainwin_rew, "pressed", mainwin_rev_pushed, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2232 g_signal_connect(mainwin_rew, "released", mainwin_rev_release, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2233 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2234 mainwin_fwd = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2235 ui_skinned_push_button_setup(mainwin_fwd, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2236 108, 88, 22, 18, 92, 0, 92, 18, SKIN_CBUTTONS); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2237 g_signal_connect(mainwin_fwd, "pressed", mainwin_fwd_pushed, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2238 g_signal_connect(mainwin_fwd, "released", mainwin_fwd_release, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2239 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2240 mainwin_play = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2241 ui_skinned_push_button_setup(mainwin_play, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2242 39, 88, 23, 18, 23, 0, 23, 18, SKIN_CBUTTONS); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2243 g_signal_connect(mainwin_play, "clicked", mainwin_play_pushed, NULL ); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2244 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2245 mainwin_pause = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2246 ui_skinned_push_button_setup(mainwin_pause, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2247 62, 88, 23, 18, 46, 0, 46, 18, SKIN_CBUTTONS); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2248 g_signal_connect(mainwin_pause, "clicked", playback_pause, NULL ); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2249 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2250 mainwin_stop = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2251 ui_skinned_push_button_setup(mainwin_stop, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2252 85, 88, 23, 18, 69, 0, 69, 18, SKIN_CBUTTONS); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2253 g_signal_connect(mainwin_stop, "clicked", mainwin_stop_pushed, NULL ); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2254 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2255 mainwin_eject = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2256 ui_skinned_push_button_setup(mainwin_eject, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2257 136, 89, 22, 16, 114, 0, 114, 16, SKIN_CBUTTONS); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2258 g_signal_connect(mainwin_eject, "clicked", mainwin_eject_pushed, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2259 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2260 mainwin_srew = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2261 ui_skinned_small_button_setup(mainwin_srew, SKINNED_WINDOW(mainwin)->fixed, 169, 4, 8, 7); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2262 g_signal_connect(mainwin_srew, "clicked", mainwin_playlist_prev, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2263 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2264 mainwin_splay = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2265 ui_skinned_small_button_setup(mainwin_splay, SKINNED_WINDOW(mainwin)->fixed, 177, 4, 10, 7); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2266 g_signal_connect(mainwin_splay, "clicked", mainwin_play_pushed, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2267 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2268 mainwin_spause = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2269 ui_skinned_small_button_setup(mainwin_spause, SKINNED_WINDOW(mainwin)->fixed, 187, 4, 10, 7); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2270 g_signal_connect(mainwin_spause, "clicked", playback_pause, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2271 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2272 mainwin_sstop = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2273 ui_skinned_small_button_setup(mainwin_sstop, SKINNED_WINDOW(mainwin)->fixed, 197, 4, 9, 7); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2274 g_signal_connect(mainwin_sstop, "clicked", mainwin_stop_pushed, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2275 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2276 mainwin_sfwd = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2277 ui_skinned_small_button_setup(mainwin_sfwd, SKINNED_WINDOW(mainwin)->fixed, 206, 4, 8, 7); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2278 g_signal_connect(mainwin_sfwd, "clicked", mainwin_playlist_next, NULL); |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2279 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2280 mainwin_seject = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2281 ui_skinned_small_button_setup(mainwin_seject, SKINNED_WINDOW(mainwin)->fixed, 216, 4, 9, 7); |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2282 g_signal_connect(mainwin_seject, "clicked", mainwin_eject_pushed, NULL); |
2313 | 2283 |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2284 mainwin_shuffle = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2285 ui_skinned_toggle_button_setup(mainwin_shuffle, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2286 164, 89, 46, 15, 28, 0, 28, 15, 28, 30, 28, 45, SKIN_SHUFREP); |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2287 g_signal_connect(mainwin_shuffle, "clicked", mainwin_shuffle_pushed_cb, NULL); |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2288 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2289 mainwin_repeat = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2290 ui_skinned_toggle_button_setup(mainwin_repeat, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2291 210, 89, 28, 15, 0, 0, 0, 15, 0, 30, 0, 45, SKIN_SHUFREP); |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2292 g_signal_connect(mainwin_repeat, "clicked", mainwin_repeat_pushed_cb, NULL); |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2293 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2294 mainwin_eq = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2295 ui_skinned_toggle_button_setup(mainwin_eq, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2296 219, 58, 23, 12, 0, 61, 46, 61, 0, 73, 46, 73, SKIN_SHUFREP); |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2297 g_signal_connect(mainwin_eq, "clicked", mainwin_equalizer_pushed_cb, NULL); |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2298 UI_SKINNED_BUTTON(mainwin_eq)->inside = cfg.equalizer_visible; |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2299 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2300 mainwin_pl = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2301 ui_skinned_toggle_button_setup(mainwin_pl, SKINNED_WINDOW(mainwin)->fixed, |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2302 242, 58, 23, 12, 23, 61, 69, 61, 23, 73, 69, 73, SKIN_SHUFREP); |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2303 g_signal_connect(mainwin_pl, "clicked", mainwin_playlist_pushed_cb, NULL); |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2304 UI_SKINNED_BUTTON(mainwin_pl)->inside = cfg.playlist_visible; |
2313 | 2305 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2306 mainwin_info = ui_skinned_textbox_new(SKINNED_WINDOW(mainwin)->fixed, 112, 27, 153, 1, SKIN_TEXT); |
2911 | 2307 ui_skinned_textbox_set_scroll(mainwin_info, cfg.autoscroll); |
4080 | 2308 ui_skinned_textbox_set_xfont(mainwin_info, !cfg.mainwin_use_bitmapfont, cfg.mainwin_font); |
2911 | 2309 g_signal_connect(mainwin_info, "double-clicked", mainwin_info_double_clicked_cb, NULL); |
4135
07c1639b110b
the less calls to gdk_window_get_pointer the better
Tomasz Mon <desowin@gmail.com>
parents:
4134
diff
changeset
|
2310 g_signal_connect(mainwin_info, "right-clicked", G_CALLBACK(mainwin_info_right_clicked_cb), NULL); |
2313 | 2311 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2312 mainwin_othertext = ui_skinned_textbox_new(SKINNED_WINDOW(mainwin)->fixed, 112, 43, 153, 1, SKIN_TEXT); |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2313 |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2314 mainwin_rate_text = ui_skinned_textbox_new(SKINNED_WINDOW(mainwin)->fixed, 111, 43, 15, 0, SKIN_TEXT); |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2315 |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2316 mainwin_freq_text = ui_skinned_textbox_new(SKINNED_WINDOW(mainwin)->fixed, 156, 43, 10, 0, SKIN_TEXT); |
2313 | 2317 |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2318 mainwin_menurow = ui_skinned_menurow_new(SKINNED_WINDOW(mainwin)->fixed, 10, 22, 304, 0, 304, 44, SKIN_TITLEBAR); |
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2319 g_signal_connect(mainwin_menurow, "change", G_CALLBACK(mainwin_mr_change), NULL); |
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2320 g_signal_connect(mainwin_menurow, "release", G_CALLBACK(mainwin_mr_release), NULL); |
2313 | 2321 |
3045
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2322 mainwin_volume = ui_skinned_horizontal_slider_new(SKINNED_WINDOW(mainwin)->fixed, 107, 57, 68, |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2323 13, 15, 422, 0, 422, 14, 11, 15, 0, 0, 51, |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2324 mainwin_volume_frame_cb, SKIN_VOLUME); |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2325 g_signal_connect(mainwin_volume, "motion", G_CALLBACK(mainwin_volume_motion_cb), NULL); |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2326 g_signal_connect(mainwin_volume, "release", G_CALLBACK(mainwin_volume_release_cb), NULL); |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2327 |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2328 mainwin_balance = ui_skinned_horizontal_slider_new(SKINNED_WINDOW(mainwin)->fixed, 177, 57, 38, |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2329 13, 15, 422, 0, 422, 14, 11, 15, 9, 0, 24, |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2330 mainwin_balance_frame_cb, SKIN_BALANCE); |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2331 g_signal_connect(mainwin_balance, "motion", G_CALLBACK(mainwin_balance_motion_cb), NULL); |
464ae313343c
mainwin_volume and mainwin_balance are UiSkinnedHorizontalSliders now; add workaround for skins with too strait SKIN_VOLUME
Tomasz Mon <desowin@gmail.com>
parents:
3042
diff
changeset
|
2332 g_signal_connect(mainwin_balance, "release", G_CALLBACK(mainwin_balance_release_cb), NULL); |
2313 | 2333 |
3073
da99b90d63d3
replace MonoStereo with UiSkinnedMonoStereo
Tomasz Mon <desowin@gmail.com>
parents:
3072
diff
changeset
|
2334 mainwin_monostereo = ui_skinned_monostereo_new(SKINNED_WINDOW(mainwin)->fixed, 212, 41, SKIN_MONOSTEREO); |
2313 | 2335 |
3072
84de3244aeaa
replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents:
3070
diff
changeset
|
2336 mainwin_playstatus = ui_skinned_playstatus_new(SKINNED_WINDOW(mainwin)->fixed, 24, 28); |
2313 | 2337 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2338 mainwin_minus_num = ui_skinned_number_new(SKINNED_WINDOW(mainwin)->fixed, 36, 26, SKIN_NUMBERS); |
3366
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
2339 g_signal_connect(mainwin_minus_num, "button-press-event", G_CALLBACK(change_timer_mode_cb), NULL); |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2340 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2341 mainwin_10min_num = ui_skinned_number_new(SKINNED_WINDOW(mainwin)->fixed, 48, 26, SKIN_NUMBERS); |
3366
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
2342 g_signal_connect(mainwin_10min_num, "button-press-event", G_CALLBACK(change_timer_mode_cb), NULL); |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2343 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2344 mainwin_min_num = ui_skinned_number_new(SKINNED_WINDOW(mainwin)->fixed, 60, 26, SKIN_NUMBERS); |
3366
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
2345 g_signal_connect(mainwin_min_num, "button-press-event", G_CALLBACK(change_timer_mode_cb), NULL); |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2346 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2347 mainwin_10sec_num = ui_skinned_number_new(SKINNED_WINDOW(mainwin)->fixed, 78, 26, SKIN_NUMBERS); |
3366
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
2348 g_signal_connect(mainwin_10sec_num, "button-press-event", G_CALLBACK(change_timer_mode_cb), NULL); |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2349 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2350 mainwin_sec_num = ui_skinned_number_new(SKINNED_WINDOW(mainwin)->fixed, 90, 26, SKIN_NUMBERS); |
3366
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
2351 g_signal_connect(mainwin_sec_num, "button-press-event", G_CALLBACK(change_timer_mode_cb), NULL); |
2313 | 2352 |
2964
7926d46872c8
right click on mainwin_about brings menu
Tomasz Mon <desowin@gmail.com>
parents:
2959
diff
changeset
|
2353 mainwin_about = ui_skinned_button_new(); |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2354 ui_skinned_small_button_setup(mainwin_about, SKINNED_WINDOW(mainwin)->fixed, 247, 83, 20, 25); |
2964
7926d46872c8
right click on mainwin_about brings menu
Tomasz Mon <desowin@gmail.com>
parents:
2959
diff
changeset
|
2355 g_signal_connect(mainwin_about, "clicked", show_about_window, NULL); |
2313 | 2356 |
3020 | 2357 mainwin_vis = ui_vis_new(SKINNED_WINDOW(mainwin)->fixed, 24, 43, 76); |
3024
883713b145f8
use button-press-event signals
Tomasz Mon <desowin@gmail.com>
parents:
3023
diff
changeset
|
2358 g_signal_connect(mainwin_vis, "button-press-event", G_CALLBACK(mainwin_vis_cb), NULL); |
3054 | 2359 mainwin_svis = ui_svis_new(SKINNED_WINDOW(mainwin)->fixed, 79, 5); |
2360 g_signal_connect(mainwin_svis, "button-press-event", G_CALLBACK(mainwin_vis_cb), NULL); | |
2313 | 2361 |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2362 mainwin_position = ui_skinned_horizontal_slider_new(SKINNED_WINDOW(mainwin)->fixed, 16, 72, 248, |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2363 10, 248, 0, 278, 0, 29, 10, 10, 0, 0, 219, |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2364 NULL, SKIN_POSBAR); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2365 g_signal_connect(mainwin_position, "motion", G_CALLBACK(mainwin_position_motion_cb), NULL); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2366 g_signal_connect(mainwin_position, "release", G_CALLBACK(mainwin_position_release_cb), NULL); |
2313 | 2367 |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2368 mainwin_sposition = ui_skinned_horizontal_slider_new(SKINNED_WINDOW(mainwin)->fixed, 226, 4, 17, |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2369 7, 17, 36, 17, 36, 3, 7, 36, 0, 1, 13, |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2370 mainwin_spos_frame_cb, SKIN_TITLEBAR); |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2371 g_signal_connect(mainwin_sposition, "motion", G_CALLBACK(mainwin_spos_motion_cb), NULL); |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2372 g_signal_connect(mainwin_sposition, "release", G_CALLBACK(mainwin_spos_release_cb), NULL); |
2313 | 2373 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2374 mainwin_stime_min = ui_skinned_textbox_new(SKINNED_WINDOW(mainwin)->fixed, 130, 4, 15, FALSE, SKIN_TEXT); |
3366
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
2375 g_signal_connect(mainwin_stime_min, "button-press-event", G_CALLBACK(change_timer_mode_cb), NULL); |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
2376 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2377 mainwin_stime_sec = ui_skinned_textbox_new(SKINNED_WINDOW(mainwin)->fixed, 147, 4, 10, FALSE, SKIN_TEXT); |
3366
ac752b5db631
introduce change_timer_mode_cb
Tomasz Mon <desowin@gmail.com>
parents:
3351
diff
changeset
|
2378 g_signal_connect(mainwin_stime_sec, "button-press-event", G_CALLBACK(change_timer_mode_cb), NULL); |
2313 | 2379 |
3157
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
2380 |
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
2381 hook_associate("playback audio error", (void *) mainwin_stop_pushed, NULL); |
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
2382 hook_associate("playback audio error", (void *) run_no_output_device_dialog, NULL); |
3718
a98b1189777b
add new hook, playback seek, and subscribe mainwin_update_song_info() to it.
William Pitcock <nenolod@atheme.org>
parents:
3716
diff
changeset
|
2383 |
a98b1189777b
add new hook, playback seek, and subscribe mainwin_update_song_info() to it.
William Pitcock <nenolod@atheme.org>
parents:
3716
diff
changeset
|
2384 hook_associate("playback seek", (HookFunction) mainwin_update_song_info, NULL); |
2313 | 2385 } |
2386 | |
2387 static void | |
2388 mainwin_create_window(void) | |
2389 { | |
2390 gint width, height; | |
2391 | |
3068
c5189bc4100b
Refactor skinned window code.
William Pitcock <nenolod@atheme-project.org>
parents:
3065
diff
changeset
|
2392 mainwin = ui_skinned_window_new("player"); |
2313 | 2393 gtk_window_set_title(GTK_WINDOW(mainwin), _("Audacious")); |
2394 gtk_window_set_role(GTK_WINDOW(mainwin), "player"); | |
2395 gtk_window_set_resizable(GTK_WINDOW(mainwin), FALSE); | |
2396 | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
2397 width = cfg.player_shaded ? MAINWIN_SHADED_WIDTH : aud_active_skin->properties.mainwin_width; |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
2398 height = cfg.player_shaded ? MAINWIN_SHADED_HEIGHT : aud_active_skin->properties.mainwin_height; |
2313 | 2399 |
4216
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
2400 if (cfg.scaled) { |
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
2401 width *= cfg.scale_factor; |
75d99359357b
doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents:
4198
diff
changeset
|
2402 height *= cfg.scale_factor; |
2313 | 2403 } |
2404 | |
2405 gtk_widget_set_size_request(mainwin, width, height); | |
2406 | |
2407 if (cfg.player_x != -1 && cfg.save_window_position) | |
2408 gtk_window_move(GTK_WINDOW(mainwin), cfg.player_x, cfg.player_y); | |
2409 | |
2410 g_signal_connect(mainwin, "destroy", G_CALLBACK(mainwin_destroy), NULL); | |
2411 g_signal_connect(mainwin, "button_press_event", | |
2412 G_CALLBACK(mainwin_mouse_button_press), NULL); | |
2413 g_signal_connect(mainwin, "scroll_event", | |
2414 G_CALLBACK(mainwin_scrolled), NULL); | |
2415 g_signal_connect(mainwin, "button_release_event", | |
2416 G_CALLBACK(mainwin_mouse_button_release), NULL); | |
2417 | |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
2418 aud_drag_dest_set(mainwin); |
2313 | 2419 |
2420 g_signal_connect(mainwin, "key_press_event", | |
2421 G_CALLBACK(mainwin_keypress), NULL); | |
3165
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
3157
diff
changeset
|
2422 |
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
3157
diff
changeset
|
2423 ui_main_evlistener_init(); |
2313 | 2424 } |
2425 | |
2426 void | |
2427 mainwin_create(void) | |
2428 { | |
2429 mainwin_create_window(); | |
2430 | |
2431 gtk_window_add_accel_group( GTK_WINDOW(mainwin) , ui_manager_get_accel_group() ); | |
2432 | |
2433 mainwin_create_widgets(); | |
2434 } | |
2435 | |
3018
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2436 gboolean |
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2437 mainwin_update_song_info(void) |
2313 | 2438 { |
3192
9f9b46506892
mainwin_update_song_info() should not return FALSE when time < 0 otherwise neither playtime display nor hide seekbar on streaming work.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3191
diff
changeset
|
2439 if (!playback_get_playing()) |
3018
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2440 return FALSE; |
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2441 |
4461
42559dad8f8f
- remove some now-unneeded configuration properties
mf0102 <0102@gmx.at>
parents:
4449
diff
changeset
|
2442 gint time = playback_get_time(); |
42559dad8f8f
- remove some now-unneeded configuration properties
mf0102 <0102@gmx.at>
parents:
4449
diff
changeset
|
2443 gint length = playback_get_length(); |
42559dad8f8f
- remove some now-unneeded configuration properties
mf0102 <0102@gmx.at>
parents:
4449
diff
changeset
|
2444 gint t; |
42559dad8f8f
- remove some now-unneeded configuration properties
mf0102 <0102@gmx.at>
parents:
4449
diff
changeset
|
2445 gchar stime_prefix; |
42559dad8f8f
- remove some now-unneeded configuration properties
mf0102 <0102@gmx.at>
parents:
4449
diff
changeset
|
2446 |
2313 | 2447 if (ab_position_a != -1 && ab_position_b != -1 && time > ab_position_b) |
2448 playback_seek(ab_position_a/1000); | |
2449 | |
3716
9489aae0d872
introduce playback_get_length()
Tomasz Mon <desowin@gmail.com>
parents:
3702
diff
changeset
|
2450 if (length == -1 && cfg.timer_mode == TIMER_REMAINING) |
9489aae0d872
introduce playback_get_length()
Tomasz Mon <desowin@gmail.com>
parents:
3702
diff
changeset
|
2451 cfg.timer_mode = TIMER_ELAPSED; |
9489aae0d872
introduce playback_get_length()
Tomasz Mon <desowin@gmail.com>
parents:
3702
diff
changeset
|
2452 |
3018
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2453 playlistwin_set_time(time, length, cfg.timer_mode); |
2313 | 2454 |
2455 if (cfg.timer_mode == TIMER_REMAINING) { | |
2456 if (length != -1) { | |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2457 ui_skinned_number_set_number(mainwin_minus_num, 11); |
2313 | 2458 t = length - time; |
2459 stime_prefix = '-'; | |
2460 } | |
2461 else { | |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2462 ui_skinned_number_set_number(mainwin_minus_num, 10); |
2313 | 2463 t = time; |
2464 stime_prefix = ' '; | |
2465 } | |
2466 } | |
2467 else { | |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2468 ui_skinned_number_set_number(mainwin_minus_num, 10); |
2313 | 2469 t = time; |
2470 stime_prefix = ' '; | |
2471 } | |
2472 t /= 1000; | |
2473 | |
2474 /* Show the time in the format HH:MM when we have more than 100 | |
2475 * minutes. */ | |
2476 if (t >= 100 * 60) | |
2477 t /= 60; | |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2478 ui_skinned_number_set_number(mainwin_10min_num, t / 600); |
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2479 ui_skinned_number_set_number(mainwin_min_num, (t / 60) % 10); |
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2480 ui_skinned_number_set_number(mainwin_10sec_num, (t / 10) % 6); |
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2481 ui_skinned_number_set_number(mainwin_sec_num, t % 10); |
2313 | 2482 |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2483 if (!UI_SKINNED_HORIZONTAL_SLIDER(mainwin_sposition)->pressed) { |
2313 | 2484 gchar *time_str; |
2485 | |
2486 time_str = g_strdup_printf("%c%2.2d", stime_prefix, t / 60); | |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
2487 ui_skinned_textbox_set_text(mainwin_stime_min, time_str); |
2313 | 2488 g_free(time_str); |
2489 | |
2490 time_str = g_strdup_printf("%2.2d", t % 60); | |
2942
1a59a0ced6a8
make scrolling stop for second when it reaches end, replace remaining mainwin TextBox with UiSkinnedTextbox
Tomasz Mon <desowin@gmail.com>
parents:
2911
diff
changeset
|
2491 ui_skinned_textbox_set_text(mainwin_stime_sec, time_str); |
2313 | 2492 g_free(time_str); |
2493 } | |
2494 | |
2495 time /= 1000; | |
2496 length /= 1000; | |
2497 if (length > 0) { | |
2498 if (time > length) { | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2499 ui_skinned_horizontal_slider_set_position(mainwin_position, 219); |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2500 ui_skinned_horizontal_slider_set_position(mainwin_sposition, 13); |
2313 | 2501 } |
2502 /* update the slider position ONLY if there is not a seek in progress */ | |
2503 else if (seek_state == MAINWIN_SEEK_NIL) { | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2504 ui_skinned_horizontal_slider_set_position(mainwin_position, (time * 219) / length); |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2505 ui_skinned_horizontal_slider_set_position(mainwin_sposition, |
4513 | 2506 ((time * 12) / length) + 1); |
2313 | 2507 } |
2508 } | |
2509 else { | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2510 ui_skinned_horizontal_slider_set_position(mainwin_position, 0); |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2511 ui_skinned_horizontal_slider_set_position(mainwin_sposition, 1); |
2313 | 2512 } |
3018
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2513 |
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2514 return TRUE; |
2313 | 2515 } |
2516 | |
2517 static gboolean | |
2518 mainwin_idle_func(gpointer data) | |
2519 { | |
2520 GDK_THREADS_ENTER(); | |
2521 | |
2522 /* tristate buttons seek */ | |
2523 if ( seek_state != MAINWIN_SEEK_NIL ) | |
2524 { | |
4513 | 2525 GTimeVal now_time; |
2526 GTimeVal delta_time; | |
2527 gulong now_dur; | |
2528 g_get_current_time(&now_time); | |
2529 | |
2530 delta_time.tv_usec = now_time.tv_usec - cb_time.tv_usec; | |
2531 delta_time.tv_sec = now_time.tv_sec - cb_time.tv_sec; | |
2532 | |
2533 now_dur = labs((delta_time.tv_sec * 1000) + (glong) (delta_time.tv_usec / 1000)); | |
2534 | |
2535 if ( now_dur > TRISTATE_THRESHOLD ) | |
2536 { | |
2537 gint np; | |
2538 if (seek_state == MAINWIN_SEEK_REV) | |
2539 np = seek_initial_pos - labs((gulong)(now_dur/100)); /* seek back */ | |
2540 else | |
2541 np = seek_initial_pos + labs((gulong)(now_dur/100)); /* seek forward */ | |
2542 | |
2543 /* boundaries check */ | |
2544 if (np < 0 ) | |
2545 np = 0; | |
2546 else if ( np > 219 ) | |
2547 np = 219; | |
2548 | |
2549 ui_skinned_horizontal_slider_set_position( mainwin_position , np ); | |
2550 mainwin_position_motion_cb( mainwin_position, np ); | |
2551 } | |
2313 | 2552 } |
2553 | |
2554 GDK_THREADS_LEAVE(); | |
2555 return TRUE; | |
2556 } | |
2557 | |
2558 | |
2559 /* toggleactionentries actions */ | |
2560 | |
2561 void | |
2562 action_anamode_peaks( GtkToggleAction * action ) | |
2563 { | |
4513 | 2564 cfg.analyzer_peaks = gtk_toggle_action_get_active( action ); |
2313 | 2565 } |
2566 | |
2567 void | |
2568 action_autoscroll_songname( GtkToggleAction * action ) | |
2569 { | |
4513 | 2570 mainwin_set_title_scroll(gtk_toggle_action_get_active(action)); |
2571 playlistwin_set_sinfo_scroll(cfg.autoscroll); /* propagate scroll setting to playlistwin_sinfo */ | |
2313 | 2572 } |
2573 | |
2574 void | |
2575 action_playback_noplaylistadvance( GtkToggleAction * action ) | |
2576 { | |
4513 | 2577 cfg.no_playlist_advance = gtk_toggle_action_get_active( action ); |
2313 | 2578 } |
2579 | |
2580 void | |
2581 action_playback_repeat( GtkToggleAction * action ) | |
2582 { | |
4513 | 2583 cfg.repeat = gtk_toggle_action_get_active( action ); |
2584 UI_SKINNED_BUTTON(mainwin_repeat)->inside = cfg.repeat; | |
2585 gtk_widget_queue_draw(mainwin_repeat); | |
2313 | 2586 } |
2587 | |
2588 void | |
2589 action_playback_shuffle( GtkToggleAction * action ) | |
2590 { | |
4513 | 2591 cfg.shuffle = gtk_toggle_action_get_active( action ); |
2592 playlist_set_shuffle(cfg.shuffle); | |
2593 UI_SKINNED_BUTTON(mainwin_shuffle)->inside = cfg.shuffle; | |
2594 gtk_widget_queue_draw(mainwin_shuffle); | |
2313 | 2595 } |
2596 | |
2597 void | |
2598 action_stop_after_current_song( GtkToggleAction * action ) | |
2599 { | |
4513 | 2600 cfg.stopaftersong = gtk_toggle_action_get_active( action ); |
2313 | 2601 } |
2602 | |
2603 void | |
2604 action_view_always_on_top( GtkToggleAction * action ) | |
2605 { | |
4513 | 2606 UI_SKINNED_MENUROW(mainwin_menurow)->always_selected = gtk_toggle_action_get_active( action ); |
2607 cfg.always_on_top = UI_SKINNED_MENUROW(mainwin_menurow)->always_selected; | |
2608 gtk_widget_queue_draw(mainwin_menurow); | |
2609 hint_set_always(cfg.always_on_top); | |
2313 | 2610 } |
2611 | |
2612 void | |
4218
f1074a07ec09
mostly works, but the VIS is broken, and the eq window is too large...more bugs
Cristi Magherusan <majeru@atheme.org>
parents:
4216
diff
changeset
|
2613 action_view_scaled( GtkToggleAction * action ) |
2313 | 2614 { |
4513 | 2615 UI_SKINNED_MENUROW(mainwin_menurow)->scale_selected = gtk_toggle_action_get_active( action ); |
2616 gtk_widget_queue_draw(mainwin_menurow); | |
2617 set_scaled(UI_SKINNED_MENUROW(mainwin_menurow)->scale_selected); | |
2618 gdk_flush(); | |
2313 | 2619 } |
2620 | |
2621 void | |
2622 action_view_easymove( GtkToggleAction * action ) | |
2623 { | |
4513 | 2624 cfg.easy_move = gtk_toggle_action_get_active( action ); |
2313 | 2625 } |
2626 | |
2627 void | |
2628 action_view_on_all_workspaces( GtkToggleAction * action ) | |
2629 { | |
4513 | 2630 cfg.sticky = gtk_toggle_action_get_active( action ); |
2631 hint_set_sticky(cfg.sticky); | |
2313 | 2632 } |
2633 | |
2634 void | |
2635 action_roll_up_equalizer( GtkToggleAction * action ) | |
2636 { | |
4513 | 2637 equalizerwin_set_shade_menu_cb(gtk_toggle_action_get_active(action)); |
2313 | 2638 } |
2639 | |
2640 void | |
2641 action_roll_up_player( GtkToggleAction * action ) | |
2642 { | |
4513 | 2643 mainwin_set_shade_menu_cb(gtk_toggle_action_get_active(action)); |
2313 | 2644 } |
2645 | |
2646 void | |
2647 action_roll_up_playlist_editor( GtkToggleAction * action ) | |
2648 { | |
4513 | 2649 playlistwin_set_shade(gtk_toggle_action_get_active(action)); |
2313 | 2650 } |
2651 | |
2652 void | |
2653 action_show_equalizer( GtkToggleAction * action ) | |
2654 { | |
4513 | 2655 if (gtk_toggle_action_get_active(action)) |
2656 equalizerwin_real_show(); | |
2657 else | |
2658 equalizerwin_real_hide(); | |
2313 | 2659 } |
2660 | |
2661 void | |
2662 action_show_playlist_editor( GtkToggleAction * action ) | |
2663 { | |
4513 | 2664 if (gtk_toggle_action_get_active(action)) |
2665 playlistwin_show(); | |
2666 else | |
2667 playlistwin_hide(); | |
2313 | 2668 } |
2669 | |
2670 void | |
2671 action_show_player( GtkToggleAction * action ) | |
2672 { | |
4513 | 2673 mainwin_show(gtk_toggle_action_get_active(action)); |
2313 | 2674 } |
2675 | |
2676 | |
2677 /* radioactionentries actions (one callback for each radio group) */ | |
2678 | |
2679 void | |
2680 action_anafoff( GtkAction *action, GtkRadioAction *current ) | |
2681 { | |
4513 | 2682 mainwin_vis_set_afalloff(gtk_radio_action_get_current_value(current)); |
2313 | 2683 } |
2684 | |
2685 void | |
2686 action_anamode( GtkAction *action, GtkRadioAction *current ) | |
2687 { | |
4513 | 2688 mainwin_vis_set_analyzer_mode(gtk_radio_action_get_current_value(current)); |
2313 | 2689 } |
2690 | |
2691 void | |
2692 action_anatype( GtkAction *action, GtkRadioAction *current ) | |
2693 { | |
4513 | 2694 mainwin_vis_set_analyzer_type(gtk_radio_action_get_current_value(current)); |
2313 | 2695 } |
2696 | |
2697 void | |
2698 action_peafoff( GtkAction *action, GtkRadioAction *current ) | |
2699 { | |
4513 | 2700 mainwin_vis_set_pfalloff(gtk_radio_action_get_current_value(current)); |
2313 | 2701 } |
2702 | |
2703 void | |
2704 action_refrate( GtkAction *action, GtkRadioAction *current ) | |
2705 { | |
4513 | 2706 mainwin_vis_set_refresh(gtk_radio_action_get_current_value(current)); |
2313 | 2707 } |
2708 | |
2709 void | |
2710 action_scomode( GtkAction *action, GtkRadioAction *current ) | |
2711 { | |
4513 | 2712 cfg.scope_mode = gtk_radio_action_get_current_value(current); |
2313 | 2713 } |
2714 | |
2715 void | |
2716 action_vismode( GtkAction *action, GtkRadioAction *current ) | |
2717 { | |
4513 | 2718 mainwin_vis_set_type_menu_cb(gtk_radio_action_get_current_value(current)); |
2313 | 2719 } |
2720 | |
2721 void | |
2722 action_vprmode( GtkAction *action, GtkRadioAction *current ) | |
2723 { | |
4513 | 2724 cfg.voiceprint_mode = gtk_radio_action_get_current_value(current); |
2313 | 2725 } |
2726 | |
2727 void | |
2728 action_wshmode( GtkAction *action, GtkRadioAction *current ) | |
2729 { | |
4513 | 2730 cfg.vu_mode = gtk_radio_action_get_current_value(current); |
2313 | 2731 } |
2732 | |
2733 void | |
2734 action_viewtime( GtkAction *action, GtkRadioAction *current ) | |
2735 { | |
4513 | 2736 set_timer_mode_menu_cb(gtk_radio_action_get_current_value(current)); |
2313 | 2737 } |
2738 | |
2739 | |
2740 /* actionentries actions */ | |
2741 | |
2742 void | |
2743 action_about_audacious( void ) | |
2744 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2745 show_about_window(); |
2313 | 2746 } |
2747 | |
2748 void | |
2749 action_play_file( void ) | |
2750 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2751 run_filebrowser(PLAY_BUTTON); |
2313 | 2752 } |
2753 | |
2754 void | |
2755 action_play_location( void ) | |
2756 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2757 mainwin_show_add_url_window(); |
2313 | 2758 } |
2759 | |
2760 void | |
2761 action_ab_set( void ) | |
2762 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2763 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2764 if (playlist_get_current_length(playlist) != -1) |
2313 | 2765 { |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2766 if (ab_position_a == -1) |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2767 { |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2768 ab_position_a = playback_get_time(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2769 ab_position_b = -1; |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2770 mainwin_lock_info_text("LOOP-POINT A POSITION SET."); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2771 } |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2772 else if (ab_position_b == -1) |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2773 { |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2774 int time = playback_get_time(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2775 if (time > ab_position_a) |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2776 ab_position_b = time; |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2777 mainwin_release_info_text(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2778 } |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2779 else |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2780 { |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2781 ab_position_a = playback_get_time(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2782 ab_position_b = -1; |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2783 mainwin_lock_info_text("LOOP-POINT A POSITION RESET."); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2784 } |
2313 | 2785 } |
2786 } | |
2787 | |
2788 void | |
2789 action_ab_clear( void ) | |
2790 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2791 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2792 if (playlist_get_current_length(playlist) != -1) |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2793 { |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2794 ab_position_a = ab_position_b = -1; |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2795 mainwin_release_info_text(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2796 } |
2313 | 2797 } |
2798 | |
2799 void | |
2800 action_current_track_info( void ) | |
2801 { | |
4514
0fe46317167f
renamed playlist_fileinfo* to ui_fileinfo_show* and reworked those
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
2802 ui_fileinfo_show_current(playlist_get_active()); |
2313 | 2803 } |
2804 | |
2805 void | |
2806 action_jump_to_file( void ) | |
2807 { | |
2500 | 2808 ui_jump_to_track(); |
2313 | 2809 } |
2810 | |
2811 void | |
2812 action_jump_to_playlist_start( void ) | |
2813 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2814 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2815 playlist_set_position(playlist, 0); |
2313 | 2816 } |
2817 | |
2818 void | |
2819 action_jump_to_time( void ) | |
2820 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2821 mainwin_jump_to_time(); |
2313 | 2822 } |
2823 | |
2824 void | |
2825 action_playback_next( void ) | |
2826 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2827 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2828 playlist_next(playlist); |
2313 | 2829 } |
2830 | |
2831 void | |
2832 action_playback_previous( void ) | |
2833 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2834 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2835 playlist_prev(playlist); |
2313 | 2836 } |
2837 | |
2838 void | |
2839 action_playback_play( void ) | |
2840 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2841 mainwin_play_pushed(); |
2313 | 2842 } |
2843 | |
2844 void | |
2845 action_playback_pause( void ) | |
2846 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2847 playback_pause(); |
2313 | 2848 } |
2849 | |
2850 void | |
2851 action_playback_stop( void ) | |
2852 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2853 mainwin_stop_pushed(); |
2313 | 2854 } |
2855 | |
2856 void | |
2857 action_preferences( void ) | |
2858 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2859 show_prefs_window(); |
2313 | 2860 } |
2861 | |
2862 void | |
2863 action_quit( void ) | |
2864 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2865 mainwin_quit_cb(); |
2313 | 2866 } |
4528
2638175099e0
Restore util_menu_main_show() for plugins - thanks go to ccr for the first
mf0102 <0102@gmx.at>
parents:
4517
diff
changeset
|
2867 |
2638175099e0
Restore util_menu_main_show() for plugins - thanks go to ccr for the first
mf0102 <0102@gmx.at>
parents:
4517
diff
changeset
|
2868 void |
2638175099e0
Restore util_menu_main_show() for plugins - thanks go to ccr for the first
mf0102 <0102@gmx.at>
parents:
4517
diff
changeset
|
2869 util_menu_main_show( gint x , gint y , guint button , guint time ) |
2638175099e0
Restore util_menu_main_show() for plugins - thanks go to ccr for the first
mf0102 <0102@gmx.at>
parents:
4517
diff
changeset
|
2870 { |
2638175099e0
Restore util_menu_main_show() for plugins - thanks go to ccr for the first
mf0102 <0102@gmx.at>
parents:
4517
diff
changeset
|
2871 /* convenience function that shows the main popup menu wherever requested */ |
2638175099e0
Restore util_menu_main_show() for plugins - thanks go to ccr for the first
mf0102 <0102@gmx.at>
parents:
4517
diff
changeset
|
2872 ui_manager_popup_menu_show( GTK_MENU(mainwin_general_menu), |
2638175099e0
Restore util_menu_main_show() for plugins - thanks go to ccr for the first
mf0102 <0102@gmx.at>
parents:
4517
diff
changeset
|
2873 x , y , button , time ); |
2638175099e0
Restore util_menu_main_show() for plugins - thanks go to ccr for the first
mf0102 <0102@gmx.at>
parents:
4517
diff
changeset
|
2874 return; |
2638175099e0
Restore util_menu_main_show() for plugins - thanks go to ccr for the first
mf0102 <0102@gmx.at>
parents:
4517
diff
changeset
|
2875 } |