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