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