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