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