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