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