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