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