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