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