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