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