Mercurial > audlegacy
annotate src/audacious/ui_main.c @ 3217:764e8f87c186 trunk
port PlayList_List to gtk2
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Thu, 02 Aug 2007 14:14:32 +0200 |
parents | 5dd8bc77a590 |
children | 018b37cf0730 |
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 && | |
2496
71bee08db1c6
[svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents:
2495
diff
changeset
|
1040 !ui_skinned_window_widgetlist_contained(mainwin, event->x, event->y) && |
2313 | 1041 (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
|
1042 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
|
1043 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
|
1044 TRUE); |
2313 | 1045 } |
1046 else if (event->button == 1 && event->type == GDK_2BUTTON_PRESS && | |
2496
71bee08db1c6
[svn] - widgetlist -> SkinnedWindow class + basic conversion in ui_main, other skinned windows remain
nenolod
parents:
2495
diff
changeset
|
1047 event->y < 14 && !ui_skinned_window_widgetlist_contained(mainwin, event->x, event->y)) { |
2313 | 1048 mainwin_set_shade(!cfg.player_shaded); |
1049 if (dock_is_moving(GTK_WINDOW(mainwin))) | |
1050 dock_move_release(GTK_WINDOW(mainwin)); | |
1051 } | |
1052 else { | |
1053 draw_main_window(FALSE); | |
1054 } | |
1055 | |
1056 if (event->button == 3) { | |
3054 | 1057 if ( (event->y > 70) && (event->x < 128) ) |
2313 | 1058 { |
1059 | |
1060 ui_manager_popup_menu_show(GTK_MENU(mainwin_playback_menu), | |
1061 event->x_root, | |
1062 event->y_root, 3, event->time); | |
1063 grab = FALSE; | |
1064 } else { | |
1065 /* | |
1066 * Pop up the main menu a few pixels down. | |
1067 * This will avoid that anything is selected | |
1068 * if one right-clicks to focus the window | |
1069 * without raising it. | |
1070 * | |
1071 ***MD I think the above is stupid, people don't expect this | |
1072 * | |
1073 */ | |
1074 ui_manager_popup_menu_show(GTK_MENU(mainwin_general_menu), | |
1075 event->x_root, | |
1076 event->y_root, 3, event->time); | |
1077 grab = FALSE; | |
1078 } | |
1079 } | |
1080 | |
1081 if (grab) | |
1082 gdk_pointer_grab(mainwin->window, FALSE, | |
1083 GDK_BUTTON_MOTION_MASK | | |
1084 GDK_BUTTON_RELEASE_MASK, | |
1085 GDK_WINDOW(GDK_NONE), NULL, GDK_CURRENT_TIME); | |
1086 | |
1087 return FALSE; | |
1088 } | |
1089 | |
1090 static gboolean | |
1091 mainwin_keypress(GtkWidget * grab_widget, | |
1092 GdkEventKey * event, | |
1093 gpointer data) | |
1094 { | |
1095 Playlist *playlist = playlist_get_active(); | |
1096 | |
1097 switch (event->keyval) { | |
1098 | |
1099 case GDK_Up: | |
1100 case GDK_KP_Up: | |
1101 case GDK_KP_8: | |
1102 mainwin_set_volume_diff(2); | |
1103 break; | |
1104 case GDK_Down: | |
1105 case GDK_KP_Down: | |
1106 case GDK_KP_2: | |
1107 mainwin_set_volume_diff(-2); | |
1108 break; | |
1109 case GDK_Left: | |
1110 case GDK_KP_Left: | |
1111 case GDK_KP_7: | |
1112 if (playlist_get_current_length(playlist) != -1) | |
1113 playback_seek(CLAMP | |
1114 (playback_get_time() - 5000, 0, | |
1115 playlist_get_current_length(playlist)) / 1000); | |
1116 break; | |
1117 case GDK_Right: | |
1118 case GDK_KP_Right: | |
1119 case GDK_KP_9: | |
1120 if (playlist_get_current_length(playlist) != -1) | |
1121 playback_seek(CLAMP | |
1122 (playback_get_time() + 5000, 0, | |
1123 playlist_get_current_length(playlist)) / 1000); | |
1124 break; | |
1125 case GDK_KP_4: | |
1126 playlist_prev(playlist); | |
1127 break; | |
1128 case GDK_KP_6: | |
1129 playlist_next(playlist); | |
1130 break; | |
1131 case GDK_KP_Insert: | |
2500 | 1132 ui_jump_to_track(); |
2313 | 1133 break; |
3184
564359ff9304
bound the Enter key to the play button
Cristi Magherusan <majeru@atheme-project.org>
parents:
3177
diff
changeset
|
1134 case GDK_Return: |
564359ff9304
bound the Enter key to the play button
Cristi Magherusan <majeru@atheme-project.org>
parents:
3177
diff
changeset
|
1135 case GDK_KP_Enter: |
2313 | 1136 case GDK_KP_5: |
1137 mainwin_play_pushed(); | |
1138 break; | |
2693
b47f5577bea0
[svn] - Made the Space key pause/unpause playback (like e.g. mplayer)
mf0102
parents:
2651
diff
changeset
|
1139 case GDK_space: |
b47f5577bea0
[svn] - Made the Space key pause/unpause playback (like e.g. mplayer)
mf0102
parents:
2651
diff
changeset
|
1140 playback_pause(); |
b47f5577bea0
[svn] - Made the Space key pause/unpause playback (like e.g. mplayer)
mf0102
parents:
2651
diff
changeset
|
1141 break; |
2313 | 1142 case GDK_Escape: |
1143 mainwin_minimize_cb(); | |
1144 break; | |
1145 default: | |
1146 return FALSE; | |
1147 } | |
1148 | |
1149 return TRUE; | |
1150 } | |
1151 | |
1152 static void | |
1153 mainwin_jump_to_time_cb(GtkWidget * widget, | |
1154 GtkWidget * entry) | |
1155 { | |
1156 guint min = 0, sec = 0, params; | |
1157 gint time; | |
1158 Playlist *playlist = playlist_get_active(); | |
1159 | |
1160 params = sscanf(gtk_entry_get_text(GTK_ENTRY(entry)), "%u:%u", | |
1161 &min, &sec); | |
1162 if (params == 2) | |
1163 time = (min * 60) + sec; | |
1164 else if (params == 1) | |
1165 time = min; | |
1166 else | |
1167 return; | |
1168 | |
1169 if (playlist_get_current_length(playlist) > -1 && | |
1170 time <= (playlist_get_current_length(playlist) / 1000)) | |
1171 { | |
1172 playback_seek(time); | |
1173 gtk_widget_destroy(mainwin_jtt); | |
1174 } | |
1175 } | |
1176 | |
1177 | |
1178 void | |
1179 mainwin_jump_to_time(void) | |
1180 { | |
1181 GtkWidget *vbox, *hbox_new, *hbox_total; | |
1182 GtkWidget *time_entry, *label, *bbox, *jump, *cancel; | |
1183 guint tindex; | |
1184 gchar time_str[10]; | |
1185 | |
1186 if (!playback_get_playing()) { | |
1187 report_error("JIT can't be launched when no track is being played.\n"); | |
1188 return; | |
1189 } | |
1190 | |
1191 if (mainwin_jtt) { | |
1192 gtk_window_present(GTK_WINDOW(mainwin_jtt)); | |
1193 return; | |
1194 } | |
1195 | |
1196 mainwin_jtt = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
1197 gtk_window_set_type_hint(GTK_WINDOW(mainwin_jtt), | |
1198 GDK_WINDOW_TYPE_HINT_DIALOG); | |
1199 | |
1200 gtk_window_set_title(GTK_WINDOW(mainwin_jtt), _("Jump to Time")); | |
1201 gtk_window_set_position(GTK_WINDOW(mainwin_jtt), GTK_WIN_POS_CENTER); | |
1202 gtk_window_set_transient_for(GTK_WINDOW(mainwin_jtt), | |
1203 GTK_WINDOW(mainwin)); | |
1204 | |
1205 g_signal_connect(mainwin_jtt, "destroy", | |
1206 G_CALLBACK(gtk_widget_destroyed), &mainwin_jtt); | |
1207 gtk_container_border_width(GTK_CONTAINER(mainwin_jtt), 10); | |
1208 | |
1209 vbox = gtk_vbox_new(FALSE, 5); | |
1210 gtk_container_add(GTK_CONTAINER(mainwin_jtt), vbox); | |
1211 | |
1212 hbox_new = gtk_hbox_new(FALSE, 0); | |
1213 gtk_box_pack_start(GTK_BOX(vbox), hbox_new, TRUE, TRUE, 5); | |
1214 | |
1215 time_entry = gtk_entry_new(); | |
1216 gtk_box_pack_start(GTK_BOX(hbox_new), time_entry, FALSE, FALSE, 5); | |
1217 g_signal_connect(time_entry, "activate", | |
1218 G_CALLBACK(mainwin_jump_to_time_cb), time_entry); | |
1219 | |
1220 gtk_widget_set_size_request(time_entry, 70, -1); | |
1221 label = gtk_label_new(_("minutes:seconds")); | |
1222 gtk_box_pack_start(GTK_BOX(hbox_new), label, FALSE, FALSE, 5); | |
1223 | |
1224 hbox_total = gtk_hbox_new(FALSE, 0); | |
1225 gtk_box_pack_start(GTK_BOX(vbox), hbox_total, TRUE, TRUE, 5); | |
1226 gtk_widget_show(hbox_total); | |
1227 | |
1228 /* FIXME: Disable display of current track length. It's not | |
1229 updated when track changes */ | |
1230 #if 0 | |
1231 label = gtk_label_new(_("Track length:")); | |
1232 gtk_box_pack_start(GTK_BOX(hbox_total), label, FALSE, FALSE, 5); | |
1233 | |
1234 len = playlist_get_current_length() / 1000; | |
1235 g_snprintf(time_str, sizeof(time_str), "%u:%2.2u", len / 60, len % 60); | |
1236 label = gtk_label_new(time_str); | |
1237 | |
1238 gtk_box_pack_start(GTK_BOX(hbox_total), label, FALSE, FALSE, 10); | |
1239 #endif | |
1240 | |
1241 bbox = gtk_hbutton_box_new(); | |
1242 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 0); | |
1243 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
1244 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); | |
1245 | |
1246 cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL); | |
1247 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); | |
1248 gtk_container_add(GTK_CONTAINER(bbox), cancel); | |
1249 g_signal_connect_swapped(cancel, "clicked", | |
1250 G_CALLBACK(gtk_widget_destroy), mainwin_jtt); | |
1251 | |
1252 jump = gtk_button_new_from_stock(GTK_STOCK_JUMP_TO); | |
1253 GTK_WIDGET_SET_FLAGS(jump, GTK_CAN_DEFAULT); | |
1254 gtk_container_add(GTK_CONTAINER(bbox), jump); | |
1255 g_signal_connect(jump, "clicked", | |
1256 G_CALLBACK(mainwin_jump_to_time_cb), time_entry); | |
1257 | |
1258 tindex = playback_get_time() / 1000; | |
1259 g_snprintf(time_str, sizeof(time_str), "%u:%2.2u", tindex / 60, | |
1260 tindex % 60); | |
1261 gtk_entry_set_text(GTK_ENTRY(time_entry), time_str); | |
1262 | |
1263 gtk_entry_select_region(GTK_ENTRY(time_entry), 0, strlen(time_str)); | |
1264 | |
1265 gtk_widget_show_all(mainwin_jtt); | |
1266 | |
1267 gtk_widget_grab_focus(time_entry); | |
1268 gtk_widget_grab_default(jump); | |
1269 } | |
1270 | |
1271 static gboolean | |
1272 mainwin_configure(GtkWidget * window, | |
1273 GdkEventConfigure * event, | |
1274 gpointer data) | |
1275 { | |
1276 if (!GTK_WIDGET_VISIBLE(window)) | |
1277 return FALSE; | |
1278 | |
1279 if (cfg.show_wm_decorations) | |
1280 gdk_window_get_root_origin(window->window, | |
1281 &cfg.player_x, &cfg.player_y); | |
1282 else | |
1283 gdk_window_get_deskrelative_origin(window->window, | |
1284 &cfg.player_x, &cfg.player_y); | |
1285 return FALSE; | |
1286 } | |
1287 | |
1288 void | |
1289 mainwin_set_back_pixmap(void) | |
1290 { | |
1291 if (cfg.doublesize) | |
1292 gdk_window_set_back_pixmap(mainwin->window, mainwin_bg_x2, 0); | |
1293 else | |
1294 gdk_window_set_back_pixmap(mainwin->window, mainwin_bg, 0); | |
1295 gdk_window_clear(mainwin->window); | |
1296 } | |
1297 | |
1298 /* | |
1299 * Rewritten 09/13/06: | |
1300 * | |
1301 * Remove all of this flaky iter/sourcelist/strsplit stuff. | |
1302 * All we care about is the filepath. | |
1303 * | |
2974
b93bd39923bf
Rework DnD received data function to use g_filename_from_uri().
William Pitcock <nenolod@atheme-project.org>
parents:
2964
diff
changeset
|
1304 * We can figure this out and easily pass it to g_filename_from_uri(). |
2313 | 1305 * - nenolod |
1306 */ | |
1307 void | |
1308 mainwin_drag_data_received(GtkWidget * widget, | |
1309 GdkDragContext * context, | |
1310 gint x, | |
1311 gint y, | |
1312 GtkSelectionData * selection_data, | |
1313 guint info, | |
1314 guint time, | |
1315 gpointer user_data) | |
1316 { | |
1317 Playlist *playlist = playlist_get_active(); | |
1318 | |
1319 g_return_if_fail(selection_data != NULL); | |
1320 g_return_if_fail(selection_data->data != NULL); | |
1321 | |
1322 if (str_has_prefix_nocase((gchar *) selection_data->data, "fonts:///")) | |
1323 { | |
2974
b93bd39923bf
Rework DnD received data function to use g_filename_from_uri().
William Pitcock <nenolod@atheme-project.org>
parents:
2964
diff
changeset
|
1324 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
|
1325 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
|
1326 |
b93bd39923bf
Rework DnD received data function to use g_filename_from_uri().
William Pitcock <nenolod@atheme-project.org>
parents:
2964
diff
changeset
|
1327 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
|
1328 return; |
2313 | 1329 |
1330 cfg.playlist_font = g_strconcat(decoded, strrchr(cfg.playlist_font, ' '), NULL); | |
3217 | 1331 ui_skinned_playlist_set_font(cfg.playlist_font); |
2313 | 1332 playlistwin_update_list(playlist); |
1333 | |
1334 g_free(decoded); | |
1335 | |
1336 return; | |
1337 } | |
1338 | |
1339 playlist_clear(playlist); | |
1340 playlist_add_url(playlist, (gchar *) selection_data->data); | |
1341 playback_initiate(); | |
1342 } | |
1343 | |
1344 static void | |
1345 on_add_url_add_clicked(GtkWidget * widget, | |
1346 GtkWidget * entry) | |
1347 { | |
1348 const gchar *text = gtk_entry_get_text(GTK_ENTRY(entry)); | |
1349 if (text && *text) | |
1350 playlist_add_url(playlist_get_active(), text); | |
1351 } | |
1352 | |
1353 static void | |
1354 on_add_url_ok_clicked(GtkWidget * widget, | |
1355 GtkWidget * entry) | |
1356 { | |
1357 Playlist *playlist = playlist_get_active(); | |
1358 | |
1359 const gchar *text = gtk_entry_get_text(GTK_ENTRY(entry)); | |
1360 if (text && *text) | |
1361 { | |
1362 playlist_clear(playlist); | |
1363 playlist_add_url(playlist, text); | |
1364 playback_initiate(); | |
1365 } | |
1366 } | |
1367 | |
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
|
1368 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
|
1369 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
|
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 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
|
1372 } |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the 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 |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the 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 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
|
1375 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
|
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 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
|
1378 { |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the 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 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
|
1380 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
|
1381 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
|
1382 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
|
1383 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
|
1384 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
|
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 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
|
1387 } |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the 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 |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the 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 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
|
1390 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
|
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 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
|
1393 { |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1394 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
|
1395 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
|
1396 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
|
1397 _("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
|
1398 _("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
|
1399 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
|
1400 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
|
1401 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
|
1402 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
|
1403 "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
|
1404 "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
|
1405 "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
|
1406 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
|
1407 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
|
1408 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
|
1409 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
|
1410 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
|
1411 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
|
1412 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
|
1413 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
|
1414 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
|
1415 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
|
1416 } |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1417 } |
4d5e6a8717dd
[svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents:
2646
diff
changeset
|
1418 |
2313 | 1419 void |
1420 mainwin_show_add_url_window(void) | |
1421 { | |
1422 static GtkWidget *url_window = NULL; | |
1423 | |
1424 if (!url_window) { | |
1425 url_window = | |
1426 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
|
1427 G_CALLBACK(on_add_url_ok_clicked), |
2313 | 1428 G_CALLBACK(on_add_url_add_clicked)); |
1429 gtk_window_set_transient_for(GTK_WINDOW(url_window), | |
1430 GTK_WINDOW(mainwin)); | |
1431 g_signal_connect(url_window, "destroy", | |
1432 G_CALLBACK(gtk_widget_destroyed), | |
1433 &url_window); | |
1434 } | |
1435 | |
1436 gtk_window_present(GTK_WINDOW(url_window)); | |
1437 } | |
1438 | |
1439 static void | |
1440 check_set( GtkActionGroup * action_group , | |
1441 const gchar * action_name , | |
1442 gboolean is_on ) | |
1443 { | |
1444 /* check_set noew uses gtkaction */ | |
1445 GtkAction *action = gtk_action_group_get_action( action_group , action_name ); | |
1446 if ( action != NULL ) | |
1447 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , is_on ); | |
1448 return; | |
1449 } | |
1450 | |
1451 void | |
1452 mainwin_eject_pushed(void) | |
1453 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
1454 run_filebrowser(PLAY_BUTTON); |
2313 | 1455 } |
1456 | |
1457 void | |
1458 mainwin_rev_pushed(void) | |
1459 { | |
1460 g_get_current_time(&cb_time); | |
1461 | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1462 seek_initial_pos = ui_skinned_horizontal_slider_get_position(mainwin_position); |
2313 | 1463 seek_state = MAINWIN_SEEK_REV; |
1464 } | |
1465 | |
1466 void | |
1467 mainwin_rev_release(void) | |
1468 { | |
1469 GTimeVal now_time; | |
1470 GTimeVal delta_time; | |
1471 gulong now_dur; | |
1472 | |
1473 g_get_current_time(&now_time); | |
1474 | |
1475 delta_time.tv_usec = now_time.tv_usec - cb_time.tv_usec; | |
1476 delta_time.tv_sec = now_time.tv_sec - cb_time.tv_sec; | |
1477 | |
1478 now_dur = labs((delta_time.tv_sec * 1000) + (glong) (delta_time.tv_usec / 1000)); | |
1479 | |
1480 if ( now_dur <= TRISTATE_THRESHOLD ) | |
1481 { | |
1482 /* interpret as 'skip to previous song' */ | |
1483 playlist_prev(playlist_get_active()); | |
1484 } | |
1485 else | |
1486 { | |
1487 /* interpret as 'seek' */ | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1488 mainwin_position_release_cb( mainwin_position, ui_skinned_horizontal_slider_get_position(mainwin_position) ); |
2313 | 1489 } |
1490 | |
1491 seek_state = MAINWIN_SEEK_NIL; | |
1492 } | |
1493 | |
1494 void | |
1495 mainwin_fwd_pushed(void) | |
1496 { | |
1497 g_get_current_time(&cb_time); | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1498 seek_initial_pos = ui_skinned_horizontal_slider_get_position(mainwin_position); |
2313 | 1499 seek_state = MAINWIN_SEEK_FWD; |
1500 } | |
1501 | |
1502 void | |
1503 mainwin_fwd_release(void) | |
1504 { | |
1505 GTimeVal now_time; | |
1506 GTimeVal delta_time; | |
1507 gulong now_dur; | |
1508 | |
1509 g_get_current_time(&now_time); | |
1510 | |
1511 delta_time.tv_usec = now_time.tv_usec - cb_time.tv_usec; | |
1512 delta_time.tv_sec = now_time.tv_sec - cb_time.tv_sec; | |
1513 | |
1514 now_dur = labs((delta_time.tv_sec * 1000) + (glong) (delta_time.tv_usec / 1000)); | |
1515 | |
1516 if ( now_dur <= TRISTATE_THRESHOLD ) | |
1517 { | |
2480
bb2f191895ce
[svn] - fixed crash when skipping to next song with an empty playlist
marvin
parents:
2478
diff
changeset
|
1518 /* interpret as 'skip to next song' */ |
2313 | 1519 playlist_next(playlist_get_active()); |
1520 } | |
1521 else | |
1522 { | |
1523 /* interpret as 'seek' */ | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1524 mainwin_position_release_cb( mainwin_position, ui_skinned_horizontal_slider_get_position(mainwin_position) ); |
2313 | 1525 } |
1526 | |
1527 seek_state = MAINWIN_SEEK_NIL; | |
1528 } | |
1529 | |
1530 void | |
1531 mainwin_play_pushed(void) | |
1532 { | |
1533 if (ab_position_a != -1) | |
1534 playback_seek(ab_position_a / 1000); | |
1535 if (playback_get_paused()) { | |
1536 playback_pause(); | |
1537 return; | |
1538 } | |
1539 | |
1540 if (playlist_get_length(playlist_get_active())) | |
1541 playback_initiate(); | |
1542 else | |
1543 mainwin_eject_pushed(); | |
1544 } | |
1545 | |
1546 void | |
1547 mainwin_stop_pushed(void) | |
1548 { | |
1549 ip_data.stop = TRUE; | |
1550 mainwin_clear_song_info(); | |
1551 playback_stop(); | |
3082
91df04ec5ef7
From: Daniel Drake <dsd@gentoo.org>
William Pitcock <nenolod@atheme-project.org>
parents:
3042
diff
changeset
|
1552 ab_position_a = ab_position_b = -1; |
2313 | 1553 ip_data.stop = FALSE; |
1554 } | |
1555 | |
1556 void | |
1557 mainwin_shuffle_pushed(gboolean toggled) | |
1558 { | |
1559 check_set( toggleaction_group_others , "playback shuffle" , toggled ); | |
1560 } | |
1561 | |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1562 void mainwin_shuffle_pushed_cb(void) { |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1563 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
|
1564 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1565 |
2313 | 1566 void |
1567 mainwin_repeat_pushed(gboolean toggled) | |
1568 { | |
1569 check_set( toggleaction_group_others , "playback repeat" , toggled ); | |
1570 } | |
1571 | |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1572 void mainwin_repeat_pushed_cb(void) { |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1573 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
|
1574 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1575 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1576 void mainwin_equalizer_pushed_cb(void) { |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1577 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
|
1578 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1579 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1580 void mainwin_playlist_pushed_cb(void) { |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1581 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
|
1582 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1583 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1584 void |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1585 mainwin_eq_pushed(gboolean 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 equalizerwin_show(toggled); |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1588 } |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
1589 |
2313 | 1590 void |
1591 mainwin_pl_pushed(gboolean toggled) | |
1592 { | |
1593 if (toggled) | |
1594 playlistwin_show(); | |
1595 else | |
1596 playlistwin_hide(); | |
1597 } | |
1598 | |
1599 gint | |
1600 mainwin_spos_frame_cb(gint pos) | |
1601 { | |
1602 if (mainwin_sposition) { | |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1603 gint x = 0; |
2313 | 1604 if (pos < 6) |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1605 x = 17; |
2313 | 1606 else if (pos < 9) |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1607 x = 20; |
2313 | 1608 else |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1609 x = 23; |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1610 |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1611 UI_SKINNED_HORIZONTAL_SLIDER(mainwin_sposition)->knob_nx = x; |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1612 UI_SKINNED_HORIZONTAL_SLIDER(mainwin_sposition)->knob_px = x; |
2313 | 1613 } |
1614 return 1; | |
1615 } | |
1616 | |
1617 void | |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1618 mainwin_spos_motion_cb(GtkWidget *widget, gint pos) |
2313 | 1619 { |
1620 gint time; | |
1621 gchar *time_msg; | |
1622 Playlist *playlist = playlist_get_active(); | |
1623 | |
1624 pos--; | |
1625 | |
1626 time = ((playlist_get_current_length(playlist) / 1000) * pos) / 12; | |
1627 | |
1628 if (cfg.timer_mode == TIMER_REMAINING) { | |
1629 time = (playlist_get_current_length(playlist) / 1000) - time; | |
1630 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
|
1631 ui_skinned_textbox_set_text(mainwin_stime_min, time_msg); |
2313 | 1632 g_free(time_msg); |
1633 } | |
1634 else { | |
1635 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
|
1636 ui_skinned_textbox_set_text(mainwin_stime_min, time_msg); |
2313 | 1637 g_free(time_msg); |
1638 } | |
1639 | |
1640 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
|
1641 ui_skinned_textbox_set_text(mainwin_stime_sec, time_msg); |
2313 | 1642 g_free(time_msg); |
1643 } | |
1644 | |
1645 void | |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
1646 mainwin_spos_release_cb(GtkWidget *widget, gint pos) |
2313 | 1647 { |
1648 playback_seek(((playlist_get_current_length(playlist_get_active()) / 1000) * | |
1649 (pos - 1)) / 12); | |
1650 } | |
1651 | |
1652 void | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1653 mainwin_position_motion_cb(GtkWidget *widget, gint pos) |
2313 | 1654 { |
1655 gint length, time; | |
1656 gchar *seek_msg; | |
1657 | |
1658 length = playlist_get_current_length(playlist_get_active()) / 1000; | |
1659 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
|
1660 seek_msg = g_strdup_printf(_("Seek to: %d:%-2.2d/%d:%-2.2d (%d%%)"), |
2313 | 1661 time / 60, time % 60, |
1662 length / 60, length % 60, | |
1663 (length != 0) ? (time * 100) / length : 0); | |
1664 mainwin_lock_info_text(seek_msg); | |
1665 g_free(seek_msg); | |
1666 } | |
1667 | |
1668 void | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
1669 mainwin_position_release_cb(GtkWidget *widget, gint pos) |
2313 | 1670 { |
1671 gint length, time; | |
1672 | |
1673 length = playlist_get_current_length(playlist_get_active()) / 1000; | |
1674 time = (length * pos) / 219; | |
1675 playback_seek(time); | |
1676 mainwin_release_info_text(); | |
1677 } | |
1678 | |
1679 gint | |
1680 mainwin_volume_frame_cb(gint pos) | |
1681 { | |
1682 return (gint) rint((pos / 52.0) * 28); | |
1683 } | |
1684 | |
1685 void | |
1686 mainwin_adjust_volume_motion(gint v) | |
1687 { | |
1688 gchar *volume_msg; | |
1689 | |
1690 setting_volume = TRUE; | |
1691 | |
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
|
1692 volume_msg = g_strdup_printf(_("Volume: %d%%"), v); |
2313 | 1693 mainwin_lock_info_text(volume_msg); |
1694 g_free(volume_msg); | |
1695 | |
1696 if (balance < 0) | |
1697 input_set_volume(v, (v * (100 - abs(balance))) / 100); | |
1698 else if (balance > 0) | |
1699 input_set_volume((v * (100 - abs(balance))) / 100, v); | |
1700 else | |
1701 input_set_volume(v, v); | |
1702 } | |
1703 | |
1704 void | |
1705 mainwin_adjust_volume_release(void) | |
1706 { | |
1707 mainwin_release_info_text(); | |
1708 setting_volume = FALSE; | |
1709 read_volume(VOLUME_ADJUSTED); | |
1710 } | |
1711 | |
1712 void | |
1713 mainwin_adjust_balance_motion(gint b) | |
1714 { | |
1715 gchar *balance_msg; | |
1716 gint v, pvl, pvr; | |
1717 | |
1718 setting_volume = TRUE; | |
1719 balance = b; | |
1720 input_get_volume(&pvl, &pvr); | |
1721 v = MAX(pvl, pvr); | |
1722 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
|
1723 balance_msg = g_strdup_printf(_("Balance: %d%% left"), -b); |
2313 | 1724 input_set_volume(v, (gint) rint(((100 + b) / 100.0) * v)); |
1725 } | |
1726 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
|
1727 balance_msg = g_strdup_printf(_("Balance: center")); |
2313 | 1728 input_set_volume(v, v); |
1729 } | |
1730 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
|
1731 balance_msg = g_strdup_printf(_("Balance: %d%% right"), b); |
2313 | 1732 input_set_volume((gint) rint(((100 - b) / 100.0) * v), v); |
1733 } | |
1734 mainwin_lock_info_text(balance_msg); | |
1735 g_free(balance_msg); | |
1736 } | |
1737 | |
1738 void | |
1739 mainwin_adjust_balance_release(void) | |
1740 { | |
1741 mainwin_release_info_text(); | |
1742 setting_volume = FALSE; | |
1743 read_volume(VOLUME_ADJUSTED); | |
1744 } | |
1745 | |
1746 void | |
1747 mainwin_set_volume_slider(gint percent) | |
1748 { | |
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
|
1749 ui_skinned_horizontal_slider_set_position(mainwin_volume, (gint) rint((percent * 51) / 100.0)); |
2313 | 1750 } |
1751 | |
1752 void | |
1753 mainwin_set_balance_slider(gint percent) | |
1754 { | |
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
|
1755 ui_skinned_horizontal_slider_set_position(mainwin_balance, (gint) rint(((percent * 12) / 100.0) + 12)); |
2313 | 1756 } |
1757 | |
1758 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
|
1759 mainwin_volume_motion_cb(GtkWidget *widget, gint pos) |
2313 | 1760 { |
1761 gint vol = (pos * 100) / 51; | |
1762 mainwin_adjust_volume_motion(vol); | |
1763 equalizerwin_set_volume_slider(vol); | |
1764 } | |
1765 | |
1766 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
|
1767 mainwin_volume_release_cb(GtkWidget *widget, gint pos) |
2313 | 1768 { |
1769 mainwin_adjust_volume_release(); | |
1770 } | |
1771 | |
1772 gint | |
1773 mainwin_balance_frame_cb(gint pos) | |
1774 { | |
1775 return ((abs(pos - 12) * 28) / 13); | |
1776 } | |
1777 | |
1778 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
|
1779 mainwin_balance_motion_cb(GtkWidget *widget, gint pos) |
2313 | 1780 { |
1781 gint bal = ((pos - 12) * 100) / 12; | |
1782 mainwin_adjust_balance_motion(bal); | |
1783 equalizerwin_set_balance_slider(bal); | |
1784 } | |
1785 | |
1786 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
|
1787 mainwin_balance_release_cb(GtkWidget *widget, gint pos) |
2313 | 1788 { |
1789 mainwin_adjust_volume_release(); | |
1790 } | |
1791 | |
1792 void | |
1793 mainwin_set_volume_diff(gint diff) | |
1794 { | |
1795 gint vl, vr, vol; | |
1796 | |
1797 input_get_volume(&vl, &vr); | |
1798 vol = MAX(vl, vr); | |
1799 vol = CLAMP(vol + diff, 0, 100); | |
1800 | |
1801 mainwin_adjust_volume_motion(vol); | |
1802 setting_volume = FALSE; | |
1803 mainwin_set_volume_slider(vol); | |
1804 equalizerwin_set_volume_slider(vol); | |
1805 read_volume(VOLUME_SET); | |
1806 } | |
1807 | |
1808 void | |
1809 mainwin_set_balance_diff(gint diff) | |
1810 { | |
1811 gint b; | |
1812 b = CLAMP(balance + diff, -100, 100); | |
1813 mainwin_adjust_balance_motion(b); | |
1814 setting_volume = FALSE; | |
1815 mainwin_set_balance_slider(b); | |
1816 equalizerwin_set_balance_slider(b); | |
1817 read_volume(VOLUME_SET); | |
1818 } | |
1819 | |
1820 void | |
1821 mainwin_show(gboolean show) | |
1822 { | |
1823 if (show) | |
1824 mainwin_real_show(); | |
1825 else | |
1826 mainwin_real_hide(); | |
1827 } | |
1828 | |
1829 void | |
1830 mainwin_real_show(void) | |
1831 { | |
1832 cfg.player_visible = TRUE; | |
1833 | |
1834 check_set( toggleaction_group_others , "show player" , TRUE ); | |
1835 | |
1836 if (cfg.player_shaded) | |
3020 | 1837 ui_vis_clear_data(mainwin_vis); |
2947 | 1838 |
2313 | 1839 mainwin_set_shape_mask(); |
1840 | |
1841 if (cfg.show_wm_decorations) { | |
2906
68f3b7ff4333
Remove pposition_broken global variable.
William Pitcock <nenolod@atheme.org>
parents:
2853
diff
changeset
|
1842 if (cfg.player_x != -1 && cfg.save_window_position) |
2313 | 1843 gtk_window_move(GTK_WINDOW(mainwin), cfg.player_x, cfg.player_y); |
1844 | |
1845 gtk_widget_show(mainwin); | |
1846 return; | |
1847 } | |
1848 | |
2345
0fb47429ad7e
[svn] - in mainwin_real_show, do not return if a nullmask doesn't exist
giacomo
parents:
2339
diff
changeset
|
1849 if (nullmask) |
0fb47429ad7e
[svn] - in mainwin_real_show, do not return if a nullmask doesn't exist
giacomo
parents:
2339
diff
changeset
|
1850 { |
0fb47429ad7e
[svn] - in mainwin_real_show, do not return if a nullmask doesn't exist
giacomo
parents:
2339
diff
changeset
|
1851 g_object_unref(nullmask); |
0fb47429ad7e
[svn] - in mainwin_real_show, do not return if a nullmask doesn't exist
giacomo
parents:
2339
diff
changeset
|
1852 nullmask = NULL; |
0fb47429ad7e
[svn] - in mainwin_real_show, do not return if a nullmask doesn't exist
giacomo
parents:
2339
diff
changeset
|
1853 } |
2313 | 1854 |
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
|
1855 gtk_window_resize(GTK_WINDOW(mainwin), |
2313 | 1856 !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
|
1857 bmp_active_skin->properties.mainwin_width, |
2313 | 1858 !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
|
1859 bmp_active_skin->properties.mainwin_height); |
2313 | 1860 |
1861 draw_main_window(TRUE); | |
1862 | |
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
|
1863 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
|
1864 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
|
1865 |
2313 | 1866 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
|
1867 gtk_widget_show_all(mainwin); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1868 |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1869 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
|
1870 gtk_widget_hide(mainwin_info); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1871 |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1872 if (!cfg.player_shaded) { |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1873 gtk_widget_hide(mainwin_srew); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1874 gtk_widget_hide(mainwin_splay); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1875 gtk_widget_hide(mainwin_spause); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1876 gtk_widget_hide(mainwin_sstop); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1877 gtk_widget_hide(mainwin_sfwd); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1878 gtk_widget_hide(mainwin_seject); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1879 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
|
1880 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
|
1881 gtk_widget_hide(mainwin_svis); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1882 } |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1883 |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1884 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
|
1885 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
|
1886 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
|
1887 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
|
1888 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
|
1889 gtk_widget_hide(mainwin_othertext); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1890 |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1891 gtk_widget_hide(mainwin_position); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1892 gtk_widget_hide(mainwin_sposition); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1893 |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1894 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
|
1895 gtk_widget_show(mainwin_vis); |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1896 else |
7e773af556c1
move gtk_widget_show's to mainwin_real_show
Tomasz Mon <desowin@gmail.com>
parents:
3146
diff
changeset
|
1897 gtk_widget_hide(mainwin_vis); |
2313 | 1898 } |
1899 | |
1900 void | |
1901 mainwin_real_hide(void) | |
1902 { | |
1903 GdkGC *gc; | |
1904 GdkColor pattern; | |
1905 | |
1906 check_set( toggleaction_group_others , "show player", FALSE); | |
1907 | |
1908 if (cfg.player_shaded) | |
3054 | 1909 ui_svis_clear_data(mainwin_svis); |
2313 | 1910 |
1911 if (!cfg.show_wm_decorations) { | |
1912 nullmask = gdk_pixmap_new(mainwin->window, 20, 20, 1); | |
1913 gc = gdk_gc_new(nullmask); | |
1914 pattern.pixel = 0; | |
1915 gdk_gc_set_foreground(gc, &pattern); | |
1916 gdk_draw_rectangle(nullmask, gc, TRUE, 0, 0, 20, 20); | |
1917 g_object_unref(gc); | |
1918 gtk_widget_shape_combine_mask(mainwin, nullmask, 0, 0); | |
1919 } | |
1920 | |
1921 gtk_widget_hide(mainwin); | |
1922 | |
1923 cfg.player_visible = FALSE; | |
1924 } | |
1925 | |
1926 | |
1927 void | |
1928 mainwin_set_stopaftersong(gboolean stop) | |
1929 { | |
1930 cfg.stopaftersong = stop; | |
1931 check_set(toggleaction_group_others, "stop after current song", cfg.stopaftersong); | |
1932 } | |
1933 | |
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
|
1934 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
|
1935 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
|
1936 { |
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 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
|
1938 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
|
1939 } |
2313 | 1940 |
1941 static void | |
1942 mainwin_set_doublesize(gboolean doublesize) | |
1943 { | |
1944 gint height; | |
1945 | |
1946 if (cfg.player_shaded) | |
1947 height = MAINWIN_SHADED_HEIGHT; | |
1948 else | |
1949 height = bmp_active_skin->properties.mainwin_height; | |
1950 | |
1951 mainwin_set_shape_mask(); | |
1952 | |
1953 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
|
1954 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
|
1955 bmp_active_skin->properties.mainwin_width * 2, bmp_active_skin->properties.mainwin_height * 2); |
2313 | 1956 |
1957 if (cfg.doublesize) { | |
1958 gdk_window_set_back_pixmap(mainwin->window, mainwin_bg_x2, 0); | |
1959 } | |
1960 else { | |
1961 gdk_window_set_back_pixmap(mainwin->window, mainwin_bg, 0); | |
1962 } | |
1963 | |
2821 | 1964 GList *iter; |
1965 for (iter = GTK_FIXED (SKINNED_WINDOW(mainwin)->fixed)->children; iter; iter = g_list_next (iter)) { | |
1966 GtkFixedChild *child_data = (GtkFixedChild *) iter->data; | |
1967 GtkWidget *child = child_data->widget; | |
2827 | 1968 g_signal_emit_by_name(child, "toggle-double-size"); |
2821 | 1969 } |
1970 | |
2313 | 1971 draw_main_window(TRUE); |
1972 } | |
1973 | |
1974 void | |
1975 set_doublesize(gboolean doublesize) | |
1976 { | |
1977 cfg.doublesize = doublesize; | |
1978 | |
1979 mainwin_set_doublesize(doublesize); | |
1980 | |
1981 if (cfg.eq_doublesize_linked) | |
1982 equalizerwin_set_doublesize(doublesize); | |
1983 } | |
1984 | |
1985 | |
1986 | |
1987 void | |
1988 mainwin_general_menu_callback(gpointer data, | |
1989 guint action, | |
1990 GtkWidget * item) | |
1991 { | |
1992 Playlist *playlist = playlist_get_active(); | |
1993 | |
1994 switch (action) { | |
1995 case MAINWIN_GENERAL_PREFS: | |
1996 show_prefs_window(); | |
1997 break; | |
1998 case MAINWIN_GENERAL_ABOUT: | |
1999 show_about_window(); | |
2000 break; | |
2001 case MAINWIN_GENERAL_PLAYFILE: | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2002 run_filebrowser(NO_PLAY_BUTTON); |
2313 | 2003 break; |
2004 case MAINWIN_GENERAL_PLAYCD: | |
2005 play_medium(); | |
2006 break; | |
2007 case MAINWIN_GENERAL_ADDCD: | |
2008 add_medium(); | |
2009 break; | |
2010 case MAINWIN_GENERAL_PLAYLOCATION: | |
2011 mainwin_show_add_url_window(); | |
2012 break; | |
3023
49ce30748980
added lastfm GUI stub
Cristi Magherusan <majeru@atheme-project.org>
parents:
3021
diff
changeset
|
2013 case MAINWIN_GENERAL_LASTFM: |
49ce30748980
added lastfm GUI stub
Cristi Magherusan <majeru@atheme-project.org>
parents:
3021
diff
changeset
|
2014 action_lastfm(); |
49ce30748980
added lastfm GUI stub
Cristi Magherusan <majeru@atheme-project.org>
parents:
3021
diff
changeset
|
2015 break; |
2313 | 2016 case MAINWIN_GENERAL_FILEINFO: |
2017 playlist_fileinfo_current(playlist); | |
2018 break; | |
2019 case MAINWIN_GENERAL_FOCUSPLWIN: | |
2020 gtk_window_present(GTK_WINDOW(playlistwin)); | |
2021 break; | |
2022 case MAINWIN_GENERAL_SHOWMWIN: | |
2023 mainwin_show(GTK_CHECK_MENU_ITEM(item)->active); | |
2024 break; | |
2025 case MAINWIN_GENERAL_SHOWPLWIN: | |
2026 if (GTK_CHECK_MENU_ITEM(item)->active) | |
2027 playlistwin_show(); | |
2028 else | |
2029 playlistwin_hide(); | |
2030 break; | |
2031 case MAINWIN_GENERAL_SHOWEQWIN: | |
2032 if (GTK_CHECK_MENU_ITEM(item)->active) | |
2033 equalizerwin_real_show(); | |
2034 else | |
2035 equalizerwin_real_hide(); | |
2036 break; | |
2037 case MAINWIN_GENERAL_PREV: | |
2038 playlist_prev(playlist); | |
2039 break; | |
2040 case MAINWIN_GENERAL_PLAY: | |
2041 mainwin_play_pushed(); | |
2042 break; | |
2043 case MAINWIN_GENERAL_PAUSE: | |
2044 playback_pause(); | |
2045 break; | |
2046 case MAINWIN_GENERAL_STOP: | |
2047 mainwin_stop_pushed(); | |
2048 break; | |
2049 case MAINWIN_GENERAL_NEXT: | |
2050 playlist_next(playlist); | |
2051 break; | |
2052 case MAINWIN_GENERAL_BACK5SEC: | |
2053 if (playback_get_playing() | |
2054 && playlist_get_current_length(playlist) != -1) | |
2055 playback_seek_relative(-5); | |
2056 break; | |
2057 case MAINWIN_GENERAL_FWD5SEC: | |
2058 if (playback_get_playing() | |
2059 && playlist_get_current_length(playlist) != -1) | |
2060 playback_seek_relative(5); | |
2061 break; | |
2062 case MAINWIN_GENERAL_START: | |
2063 playlist_set_position(playlist, 0); | |
2064 break; | |
2065 case MAINWIN_GENERAL_JTT: | |
2066 mainwin_jump_to_time(); | |
2067 break; | |
2068 case MAINWIN_GENERAL_JTF: | |
2500 | 2069 ui_jump_to_track(); |
2313 | 2070 break; |
2071 case MAINWIN_GENERAL_EXIT: | |
2072 mainwin_quit_cb(); | |
2073 break; | |
2074 case MAINWIN_GENERAL_SETAB: | |
2075 if (playlist_get_current_length(playlist) != -1) { | |
2076 if (ab_position_a == -1) { | |
2077 ab_position_a = playback_get_time(); | |
2078 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
|
2079 mainwin_lock_info_text("'Loop-Point A Position' set."); |
2313 | 2080 } else if (ab_position_b == -1) { |
2081 int time = playback_get_time(); | |
2082 if (time > ab_position_a) | |
2083 ab_position_b = time; | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2084 mainwin_release_info_text(); |
2313 | 2085 } else { |
2086 ab_position_a = playback_get_time(); | |
2087 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
|
2088 mainwin_lock_info_text("'Loop-Point A Position' reset."); |
2313 | 2089 } |
2090 } | |
2091 break; | |
2092 case MAINWIN_GENERAL_CLEARAB: | |
2093 if (playlist_get_current_length(playlist) != -1) { | |
2094 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
|
2095 mainwin_release_info_text(); |
2313 | 2096 } |
2097 break; | |
2098 case MAINWIN_GENERAL_NEW_PL: | |
2099 { | |
2100 Playlist *new_pl = playlist_new(); | |
2101 playlist_add_playlist(new_pl); | |
2102 playlist_select_playlist(new_pl); | |
2103 } | |
2104 break; | |
2105 case MAINWIN_GENERAL_PREV_PL: | |
2106 playlist_select_prev(); | |
2107 break; | |
2108 case MAINWIN_GENERAL_NEXT_PL: | |
2109 playlist_select_next(); | |
2110 break; | |
2111 } | |
2112 } | |
2113 | |
2114 static void | |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2115 mainwin_mr_change(GtkWidget *widget, MenuRowItem i) |
2313 | 2116 { |
2117 switch (i) { | |
2118 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
|
2119 mainwin_lock_info_text(_("Options Menu")); |
2313 | 2120 break; |
2121 case MENUROW_ALWAYS: | |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2122 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
|
2123 mainwin_lock_info_text(_("Disable 'Always On Top'")); |
2313 | 2124 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
|
2125 mainwin_lock_info_text(_("Enable 'Always On Top'")); |
2313 | 2126 break; |
2127 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
|
2128 mainwin_lock_info_text(_("File Info Box")); |
2313 | 2129 break; |
2130 case MENUROW_DOUBLESIZE: | |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2131 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
|
2132 mainwin_lock_info_text(_("Disable 'Doublesize'")); |
2313 | 2133 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
|
2134 mainwin_lock_info_text(_("Enable 'Doublesize'")); |
2313 | 2135 break; |
2136 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
|
2137 mainwin_lock_info_text(_("Visualization Menu")); |
2313 | 2138 break; |
3165
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
3157
diff
changeset
|
2139 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
|
2140 break; |
2313 | 2141 } |
2142 } | |
2143 | |
2144 static void | |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2145 mainwin_mr_release(GtkWidget *widget, MenuRowItem i) |
2313 | 2146 { |
2147 GdkModifierType modmask; | |
2148 gint x, y; | |
2149 | |
2150 switch (i) { | |
2151 case MENUROW_OPTIONS: | |
2152 gdk_window_get_pointer(NULL, &x, &y, &modmask); | |
2153 ui_manager_popup_menu_show(GTK_MENU(mainwin_view_menu), x, y, 1, | |
2154 GDK_CURRENT_TIME); | |
2155 break; | |
2156 case MENUROW_ALWAYS: | |
2157 gtk_toggle_action_set_active( | |
2158 GTK_TOGGLE_ACTION(gtk_action_group_get_action( | |
2159 toggleaction_group_others , "view always on top" )) , | |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2160 UI_SKINNED_MENUROW(mainwin_menurow)->always_selected ); |
2313 | 2161 break; |
2162 case MENUROW_FILEINFOBOX: | |
2163 playlist_fileinfo_current(playlist_get_active()); | |
2164 break; | |
2165 case MENUROW_DOUBLESIZE: | |
2166 gtk_toggle_action_set_active( | |
2167 GTK_TOGGLE_ACTION(gtk_action_group_get_action( | |
2168 toggleaction_group_others , "view doublesize" )) , | |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2169 UI_SKINNED_MENUROW(mainwin_menurow)->doublesize_selected ); |
2313 | 2170 break; |
2171 case MENUROW_VISUALIZATION: | |
2172 gdk_window_get_pointer(NULL, &x, &y, &modmask); | |
2173 ui_manager_popup_menu_show(GTK_MENU(mainwin_visualization_menu), x, y, 1, GDK_CURRENT_TIME); | |
2174 break; | |
2175 case MENUROW_NONE: | |
2176 break; | |
2177 } | |
2178 mainwin_release_info_text(); | |
2179 } | |
2180 | |
2181 static void | |
2182 run_no_audiocd_dialog(void) | |
2183 { | |
2184 const gchar *markup = | |
2185 N_("<b><big>No playable CD found.</big></b>\n\n" | |
2186 "No CD inserted, or inserted CD is not an audio CD.\n"); | |
2187 | |
2188 GtkWidget *dialog = | |
2189 gtk_message_dialog_new_with_markup(GTK_WINDOW(mainwin), | |
2190 GTK_DIALOG_DESTROY_WITH_PARENT, | |
2191 GTK_MESSAGE_ERROR, | |
2192 GTK_BUTTONS_OK, | |
2193 _(markup)); | |
2194 gtk_dialog_run(GTK_DIALOG(dialog)); | |
2195 gtk_widget_destroy(dialog); | |
2196 } | |
2197 | |
3157
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
2198 void |
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
2199 run_no_output_device_dialog(gpointer hook_data, gpointer user_data) |
2313 | 2200 { |
2201 const gchar *markup = | |
2202 N_("<b><big>Couldn't open audio.</big></b>\n\n" | |
2203 "Please check that:\n" | |
2204 "1. You have the correct output plugin selected.\n" | |
2205 "2. No other programs is blocking the soundcard.\n" | |
2206 "3. Your soundcard is configured properly.\n"); | |
2207 | |
3157
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
2208 GDK_THREADS_ENTER(); |
2313 | 2209 GtkWidget *dialog = |
2210 gtk_message_dialog_new_with_markup(GTK_WINDOW(mainwin), | |
2211 GTK_DIALOG_DESTROY_WITH_PARENT, | |
2212 GTK_MESSAGE_ERROR, | |
2213 GTK_BUTTONS_OK, | |
2214 _(markup)); | |
2215 gtk_dialog_run(GTK_DIALOG(dialog)); | |
2216 gtk_widget_destroy(dialog); | |
3157
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
2217 GDK_THREADS_LEAVE(); |
2313 | 2218 } |
2219 | |
2220 | |
2221 void | |
2222 add_medium(void) | |
2223 { | |
2224 GList *list, *node; | |
2225 gchar *filename; | |
3169
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2226 |
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2227 /* |
2313 | 2228 gchar *path; |
2229 ConfigDb *db; | |
2230 | |
2231 db = bmp_cfg_db_open(); | |
2232 | |
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
|
2233 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
|
2234 { |
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 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
|
2236 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
|
2237 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
|
2238 } |
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
|
2239 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
|
2240 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
|
2241 */ |
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2242 |
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2243 if (!(list = input_scan_dir(CDDA_DUMMY_PATH))) { |
2313 | 2244 run_no_audiocd_dialog(); |
2245 return; | |
2246 } | |
2247 | |
2248 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
|
2249 filename = g_build_filename(CDDA_DUMMY_PATH, node->data, NULL); |
2313 | 2250 playlist_add(playlist_get_active(), filename); |
2251 g_free(filename); | |
2252 g_free(node->data); | |
2253 } | |
2254 | |
3169
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2255 /*g_free(path);*/ |
2313 | 2256 g_list_free(list); |
2257 | |
2258 } | |
2259 | |
2260 void | |
2261 play_medium(void) | |
2262 { | |
2263 GList *list, *node; | |
2264 gchar *filename; | |
3169
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2265 /* |
2313 | 2266 gchar *path; |
2267 ConfigDb *db; | |
3169
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2268 */ |
2313 | 2269 Playlist *playlist = playlist_get_active(); |
2270 | |
3169
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2271 /* |
2313 | 2272 db = bmp_cfg_db_open(); |
2273 bmp_cfg_db_get_string(db, "CDDA", "directory", &path); | |
2274 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
|
2275 */ |
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2276 |
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2277 if (!(list = input_scan_dir(CDDA_DUMMY_PATH))) { |
2313 | 2278 run_no_audiocd_dialog(); |
2279 return; | |
2280 } | |
2281 | |
2282 playlist_clear(playlist); | |
2283 | |
2284 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
|
2285 filename = g_build_filename(CDDA_DUMMY_PATH, node->data, NULL); |
2313 | 2286 playlist_add(playlist, filename); |
2287 g_free(filename); | |
2288 g_free(node->data); | |
2289 } | |
2290 | |
3169
b1964057a1a0
Hardcoded a dummy path to use with cdaudio-ng plugin
Calin Crisan ccrisan@gmail.com
parents:
3165
diff
changeset
|
2291 /*g_free(path);*/ |
2313 | 2292 g_list_free(list); |
2293 | |
2294 playlist_set_position(playlist, 0); | |
2295 playback_initiate(); | |
2296 } | |
2297 | |
2298 void | |
2299 read_volume(gint when) | |
2300 { | |
2301 static gint pvl = 0, pvr = 0; | |
2302 static gint times = VOLSET_DISP_TIMES; | |
2303 static gboolean changing = FALSE; | |
2304 | |
2305 gint vl, vr, b, v; | |
2306 | |
2307 input_get_volume(&vl, &vr); | |
2308 | |
2309 switch (when) { | |
2310 case VOLSET_STARTUP: | |
2311 vl = CLAMP(vl, 0, 100); | |
2312 vr = CLAMP(vr, 0, 100); | |
2313 pvl = vl; | |
2314 pvr = vr; | |
2315 v = MAX(vl, vr); | |
2316 if (vl > vr) | |
2317 b = (gint) rint(((gdouble) vr / vl) * 100) - 100; | |
2318 else if (vl < vr) | |
2319 b = 100 - (gint) rint(((gdouble) vl / vr) * 100); | |
2320 else | |
2321 b = 0; | |
2322 | |
2323 balance = b; | |
2324 mainwin_set_volume_slider(v); | |
2325 equalizerwin_set_volume_slider(v); | |
2326 mainwin_set_balance_slider(b); | |
2327 equalizerwin_set_balance_slider(b); | |
2328 return; | |
2329 | |
2330 case VOLSET_UPDATE: | |
2331 if (vl == -1 || vr == -1) | |
2332 return; | |
2333 | |
2334 if (setting_volume) { | |
2335 pvl = vl; | |
2336 pvr = vr; | |
2337 return; | |
2338 } | |
2339 | |
2340 if (pvr == vr && pvl == vl && changing) { | |
2341 if (times < VOLSET_DISP_TIMES) | |
2342 times++; | |
2343 else { | |
2344 mainwin_release_info_text(); | |
2345 changing = FALSE; | |
2346 } | |
2347 } | |
2348 else if (pvr != vr || pvl != vl) { | |
2349 gchar *tmp; | |
2350 | |
2351 v = MAX(vl, vr); | |
2352 if (vl > vr) | |
2353 b = (gint) rint(((gdouble) vr / vl) * 100) - 100; | |
2354 else if (vl < vr) | |
2355 b = 100 - (gint) rint(((gdouble) vl / vr) * 100); | |
2356 else | |
2357 b = 0; | |
2358 | |
2359 if (MAX(vl, vr) != MAX(pvl, pvr)) | |
2360 tmp = g_strdup_printf(_("VOLUME: %d%%"), v); | |
2361 else { | |
2362 if (vl > vr) { | |
2363 tmp = g_strdup_printf(_("BALANCE: %d%% LEFT"), -b); | |
2364 } | |
2365 else if (vr == vl) | |
2366 tmp = g_strdup_printf(_("BALANCE: CENTER")); | |
2367 else { /* (vl < vr) */ | |
2368 tmp = g_strdup_printf(_("BALANCE: %d%% RIGHT"), b); | |
2369 } | |
2370 } | |
2371 mainwin_lock_info_text(tmp); | |
2372 g_free(tmp); | |
2373 | |
2374 pvr = vr; | |
2375 pvl = vl; | |
2376 times = 0; | |
2377 changing = TRUE; | |
2378 mainwin_set_volume_slider(v); | |
2379 equalizerwin_set_volume_slider(v); | |
2380 | |
2381 /* Don't change the balance slider if the volume has been | |
2382 * set to zero. The balance can be anything, and our best | |
2383 * guess is what is was before. */ | |
2384 if (v > 0) { | |
2385 balance = b; | |
2386 mainwin_set_balance_slider(b); | |
2387 equalizerwin_set_balance_slider(b); | |
2388 } | |
2389 } | |
2390 break; | |
2391 | |
2392 case VOLUME_ADJUSTED: | |
2393 pvl = vl; | |
2394 pvr = vr; | |
2395 break; | |
2396 | |
2397 case VOLUME_SET: | |
2398 times = 0; | |
2399 changing = TRUE; | |
2400 pvl = vl; | |
2401 pvr = vr; | |
2402 break; | |
2403 } | |
2404 } | |
2405 | |
2406 | |
2407 /* TODO: HAL! */ | |
2408 gboolean | |
2409 can_play_cd(void) | |
2410 { | |
2411 GList *ilist; | |
2412 | |
2413 for (ilist = get_input_list(); ilist; ilist = g_list_next(ilist)) { | |
2414 InputPlugin *ip = INPUT_PLUGIN(ilist->data); | |
2415 | |
2416 if (!g_ascii_strcasecmp(g_basename(ip->filename), | |
2417 PLUGIN_FILENAME("cdaudio"))) { | |
2418 return TRUE; | |
2419 } | |
2420 } | |
2421 | |
2422 return FALSE; | |
2423 } | |
2424 | |
2425 | |
2426 static void | |
2427 set_timer_mode(TimerMode mode) | |
2428 { | |
2429 if (mode == TIMER_ELAPSED) | |
2430 check_set(radioaction_group_viewtime, "view time elapsed", TRUE); | |
2431 else | |
2432 check_set(radioaction_group_viewtime, "view time remaining", TRUE); | |
2433 } | |
2434 | |
2435 static void | |
2436 set_timer_mode_menu_cb(TimerMode mode) | |
2437 { | |
2438 cfg.timer_mode = mode; | |
2439 } | |
2440 | |
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
|
2441 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
|
2442 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
|
2443 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
|
2444 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
|
2445 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
|
2446 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
|
2447 } |
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
|
2448 |
2313 | 2449 static void |
2450 mainwin_playlist_prev(void) | |
2451 { | |
2452 playlist_prev(playlist_get_active()); | |
2453 } | |
2454 | |
2455 static void | |
2456 mainwin_playlist_next(void) | |
2457 { | |
2458 playlist_next(playlist_get_active()); | |
2459 } | |
2460 | |
2461 void | |
2462 mainwin_setup_menus(void) | |
2463 { | |
2464 set_timer_mode(cfg.timer_mode); | |
2465 | |
2466 /* View menu */ | |
2467 | |
2468 check_set(toggleaction_group_others, "view always on top", cfg.always_on_top); | |
2469 check_set(toggleaction_group_others, "view put on all workspaces", cfg.sticky); | |
2470 check_set(toggleaction_group_others, "roll up player", cfg.player_shaded); | |
2471 check_set(toggleaction_group_others, "roll up playlist editor", cfg.playlist_shaded); | |
2472 check_set(toggleaction_group_others, "roll up equalizer", cfg.equalizer_shaded); | |
2473 check_set(toggleaction_group_others, "view easy move", cfg.easy_move); | |
2474 check_set(toggleaction_group_others, "view doublesize", cfg.doublesize); | |
2475 | |
2476 /* Songname menu */ | |
2477 | |
2478 check_set(toggleaction_group_others, "autoscroll songname", cfg.autoscroll); | |
2479 check_set(toggleaction_group_others, "stop after current song", cfg.stopaftersong); | |
2480 | |
2481 /* Playback menu */ | |
2482 | |
2483 check_set(toggleaction_group_others, "playback repeat", cfg.repeat); | |
2484 check_set(toggleaction_group_others, "playback shuffle", cfg.shuffle); | |
2485 check_set(toggleaction_group_others, "playback no playlist advance", cfg.no_playlist_advance); | |
2486 | |
2487 /* Visualization menu */ | |
2488 | |
2489 switch ( cfg.vis_type ) | |
2490 { | |
2491 case VIS_ANALYZER: | |
2492 check_set(radioaction_group_vismode, "vismode analyzer", TRUE); | |
2493 break; | |
2494 case VIS_SCOPE: | |
2495 check_set(radioaction_group_vismode, "vismode scope", TRUE); | |
2496 break; | |
2497 case VIS_VOICEPRINT: | |
2498 check_set(radioaction_group_vismode, "vismode voiceprint", TRUE); | |
2499 break; | |
2500 case VIS_OFF: | |
2501 default: | |
2502 check_set(radioaction_group_vismode, "vismode off", TRUE); | |
2503 break; | |
2504 } | |
2505 | |
2506 switch ( cfg.analyzer_mode ) | |
2507 { | |
2508 case ANALYZER_FIRE: | |
2509 check_set(radioaction_group_anamode, "anamode fire", TRUE); | |
2510 break; | |
2511 case ANALYZER_VLINES: | |
2512 check_set(radioaction_group_anamode, "anamode vertical lines", TRUE); | |
2513 break; | |
2514 case ANALYZER_NORMAL: | |
2515 default: | |
2516 check_set(radioaction_group_anamode, "anamode normal", TRUE); | |
2517 break; | |
2518 } | |
2519 | |
2520 switch ( cfg.analyzer_type ) | |
2521 { | |
2522 case ANALYZER_BARS: | |
2523 check_set(radioaction_group_anatype, "anatype bars", TRUE); | |
2524 break; | |
2525 case ANALYZER_LINES: | |
2526 default: | |
2527 check_set(radioaction_group_anatype, "anatype lines", TRUE); | |
2528 break; | |
2529 } | |
2530 | |
2531 check_set(toggleaction_group_others, "anamode peaks", cfg.analyzer_peaks ); | |
2532 | |
2533 switch ( cfg.scope_mode ) | |
2534 { | |
2535 case SCOPE_LINE: | |
2536 check_set(radioaction_group_scomode, "scomode line", TRUE); | |
2537 break; | |
2538 case SCOPE_SOLID: | |
2539 check_set(radioaction_group_scomode, "scomode solid", TRUE); | |
2540 break; | |
2541 case SCOPE_DOT: | |
2542 default: | |
2543 check_set(radioaction_group_scomode, "scomode dot", TRUE); | |
2544 break; | |
2545 } | |
2546 | |
2547 switch ( cfg.voiceprint_mode ) | |
2548 { | |
2549 case VOICEPRINT_FIRE: | |
2550 check_set(radioaction_group_vprmode, "vprmode fire", TRUE); | |
2551 break; | |
2552 case VOICEPRINT_ICE: | |
2553 check_set(radioaction_group_vprmode, "vprmode ice", TRUE); | |
2554 break; | |
2555 case VOICEPRINT_NORMAL: | |
2556 default: | |
2557 check_set(radioaction_group_vprmode, "vprmode normal", TRUE); | |
2558 break; | |
2559 } | |
2560 | |
2561 switch ( cfg.vu_mode ) | |
2562 { | |
2563 case VU_SMOOTH: | |
2564 check_set(radioaction_group_wshmode, "wshmode smooth", TRUE); | |
2565 break; | |
2566 case VU_NORMAL: | |
2567 default: | |
2568 check_set(radioaction_group_wshmode, "wshmode normal", TRUE); | |
2569 break; | |
2570 } | |
2571 | |
2572 switch ( cfg.vis_refresh ) | |
2573 { | |
2574 case REFRESH_HALF: | |
2575 check_set(radioaction_group_refrate, "refrate half", TRUE); | |
2576 break; | |
2577 case REFRESH_QUARTER: | |
2578 check_set(radioaction_group_refrate, "refrate quarter", TRUE); | |
2579 break; | |
2580 case REFRESH_EIGTH: | |
2581 check_set(radioaction_group_refrate, "refrate eighth", TRUE); | |
2582 break; | |
2583 case REFRESH_FULL: | |
2584 default: | |
2585 check_set(radioaction_group_refrate, "refrate full", TRUE); | |
2586 break; | |
2587 } | |
2588 | |
2589 switch ( cfg.analyzer_falloff ) | |
2590 { | |
2591 case FALLOFF_SLOW: | |
2592 check_set(radioaction_group_anafoff, "anafoff slow", TRUE); | |
2593 break; | |
2594 case FALLOFF_MEDIUM: | |
2595 check_set(radioaction_group_anafoff, "anafoff medium", TRUE); | |
2596 break; | |
2597 case FALLOFF_FAST: | |
2598 check_set(radioaction_group_anafoff, "anafoff fast", TRUE); | |
2599 break; | |
2600 case FALLOFF_FASTEST: | |
2601 check_set(radioaction_group_anafoff, "anafoff fastest", TRUE); | |
2602 break; | |
2603 case FALLOFF_SLOWEST: | |
2604 default: | |
2605 check_set(radioaction_group_anafoff, "anafoff slowest", TRUE); | |
2606 break; | |
2607 } | |
2608 | |
2609 switch ( cfg.peaks_falloff ) | |
2610 { | |
2611 case FALLOFF_SLOW: | |
2612 check_set(radioaction_group_peafoff, "peafoff slow", TRUE); | |
2613 break; | |
2614 case FALLOFF_MEDIUM: | |
2615 check_set(radioaction_group_peafoff, "peafoff medium", TRUE); | |
2616 break; | |
2617 case FALLOFF_FAST: | |
2618 check_set(radioaction_group_peafoff, "peafoff fast", TRUE); | |
2619 break; | |
2620 case FALLOFF_FASTEST: | |
2621 check_set(radioaction_group_peafoff, "peafoff fastest", TRUE); | |
2622 break; | |
2623 case FALLOFF_SLOWEST: | |
2624 default: | |
2625 check_set(radioaction_group_peafoff, "peafoff slowest", TRUE); | |
2626 break; | |
2627 } | |
2628 | |
2629 } | |
2630 | |
2911 | 2631 static void mainwin_info_double_clicked_cb(void) { |
2632 playlist_fileinfo_current(playlist_get_active()); | |
2633 } | |
2634 | |
2635 static void mainwin_info_right_clicked_cb(void) { | |
2636 gint x, y; | |
2637 gdk_window_get_pointer(NULL, &x, &y, NULL); | |
2638 ui_manager_popup_menu_show(GTK_MENU(mainwin_songname_menu), x, y, 3, GDK_CURRENT_TIME); | |
2639 } | |
2640 | |
2313 | 2641 static void |
2642 mainwin_create_widgets(void) | |
2643 { | |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2644 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
|
2645 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
|
2646 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
|
2647 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
|
2648 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2649 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
|
2650 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
|
2651 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
|
2652 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
|
2653 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2654 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
|
2655 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
|
2656 254, 3, 9, 9, 0, |
2844
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2657 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
|
2658 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
|
2659 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2660 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
|
2661 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
|
2662 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
|
2663 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
|
2664 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2665 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
|
2666 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
|
2667 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
|
2668 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
|
2669 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
|
2670 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2671 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
|
2672 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
|
2673 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
|
2674 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
|
2675 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
|
2676 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2677 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
|
2678 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
|
2679 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
|
2680 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
|
2681 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2682 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
|
2683 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
|
2684 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
|
2685 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
|
2686 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2687 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
|
2688 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
|
2689 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
|
2690 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
|
2691 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2692 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
|
2693 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
|
2694 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
|
2695 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
|
2696 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2697 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
|
2698 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
|
2699 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
|
2700 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2701 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
|
2702 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
|
2703 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
|
2704 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2705 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
|
2706 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
|
2707 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
|
2708 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2709 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
|
2710 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
|
2711 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
|
2712 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2713 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
|
2714 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
|
2715 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
|
2716 |
22da7cd0eca0
UiSkinnedButton can now work as SButton
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
2717 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
|
2718 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
|
2719 g_signal_connect(mainwin_seject, "clicked", mainwin_eject_pushed, NULL); |
2313 | 2720 |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2721 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
|
2722 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
|
2723 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
|
2724 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
|
2725 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2726 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
|
2727 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
|
2728 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
|
2729 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
|
2730 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2731 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
|
2732 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
|
2733 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
|
2734 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
|
2735 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
|
2736 |
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
2737 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
|
2738 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
|
2739 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
|
2740 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
|
2741 UI_SKINNED_BUTTON(mainwin_pl)->inside = cfg.playlist_visible; |
2313 | 2742 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2743 mainwin_info = ui_skinned_textbox_new(SKINNED_WINDOW(mainwin)->fixed, 112, 27, 153, 1, SKIN_TEXT); |
2911 | 2744 ui_skinned_textbox_set_scroll(mainwin_info, cfg.autoscroll); |
2745 ui_skinned_textbox_set_xfont(mainwin_info, cfg.mainwin_use_xfont, cfg.mainwin_font); | |
2746 g_signal_connect(mainwin_info, "double-clicked", mainwin_info_double_clicked_cb, NULL); | |
2747 g_signal_connect(mainwin_info, "right-clicked", mainwin_info_right_clicked_cb, NULL); | |
2313 | 2748 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2749 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
|
2750 |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2751 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
|
2752 |
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2753 mainwin_freq_text = ui_skinned_textbox_new(SKINNED_WINDOW(mainwin)->fixed, 156, 43, 10, 0, SKIN_TEXT); |
2313 | 2754 |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
2755 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
|
2756 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
|
2757 g_signal_connect(mainwin_menurow, "release", G_CALLBACK(mainwin_mr_release), NULL); |
2313 | 2758 |
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
|
2759 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
|
2760 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
|
2761 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
|
2762 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
|
2763 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
|
2764 |
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 = 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
|
2766 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
|
2767 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
|
2768 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
|
2769 g_signal_connect(mainwin_balance, "release", G_CALLBACK(mainwin_balance_release_cb), NULL); |
2313 | 2770 |
3073
da99b90d63d3
replace MonoStereo with UiSkinnedMonoStereo
Tomasz Mon <desowin@gmail.com>
parents:
3072
diff
changeset
|
2771 mainwin_monostereo = ui_skinned_monostereo_new(SKINNED_WINDOW(mainwin)->fixed, 212, 41, SKIN_MONOSTEREO); |
2313 | 2772 |
3072
84de3244aeaa
replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents:
3070
diff
changeset
|
2773 mainwin_playstatus = ui_skinned_playstatus_new(SKINNED_WINDOW(mainwin)->fixed, 24, 28); |
2313 | 2774 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2775 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
|
2776 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
|
2777 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2778 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
|
2779 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
|
2780 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2781 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
|
2782 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
|
2783 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2784 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
|
2785 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
|
2786 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2787 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
|
2788 g_signal_connect(mainwin_sec_num, "button-press-event", G_CALLBACK(mainwin_num_clicked), NULL); |
2313 | 2789 |
2964
7926d46872c8
right click on mainwin_about brings menu
Tomasz Mon <desowin@gmail.com>
parents:
2959
diff
changeset
|
2790 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
|
2791 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
|
2792 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
|
2793 g_signal_connect(mainwin_about, "right-clicked", mainwin_about_cb, NULL ); |
2313 | 2794 |
3020 | 2795 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
|
2796 g_signal_connect(mainwin_vis, "button-press-event", G_CALLBACK(mainwin_vis_cb), NULL); |
3054 | 2797 mainwin_svis = ui_svis_new(SKINNED_WINDOW(mainwin)->fixed, 79, 5); |
2798 g_signal_connect(mainwin_svis, "button-press-event", G_CALLBACK(mainwin_vis_cb), NULL); | |
2313 | 2799 |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2800 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
|
2801 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
|
2802 NULL, SKIN_POSBAR); |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2803 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
|
2804 g_signal_connect(mainwin_position, "release", G_CALLBACK(mainwin_position_release_cb), NULL); |
2313 | 2805 |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2806 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
|
2807 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
|
2808 mainwin_spos_frame_cb, SKIN_TITLEBAR); |
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2809 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
|
2810 g_signal_connect(mainwin_sposition, "release", G_CALLBACK(mainwin_spos_release_cb), NULL); |
2313 | 2811 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2812 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
|
2813 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
|
2814 |
3005
3db40ad79fd9
request GdkGC when needed rather than carry one around
Tomasz Mon <desowin@gmail.com>
parents:
3004
diff
changeset
|
2815 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
|
2816 g_signal_connect(mainwin_stime_sec, "clicked", change_timer_mode, NULL); |
2313 | 2817 |
2818 err = gtk_message_dialog_new(GTK_WINDOW(mainwin), GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_MODAL, | |
2819 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("Error in Audacious.")); | |
2820 | |
2821 | |
2822 gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER); | |
2823 /* Dang well better set an error message or you'll see this */ | |
2824 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(err), | |
2825 "Boo! Bad stuff! Booga Booga!"); | |
3157
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
2826 |
f9d34bc5079f
Remove check for playback->error.
William Pitcock <nenolod@atheme-project.org>
parents:
3151
diff
changeset
|
2827 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
|
2828 hook_associate("playback audio error", (void *) run_no_output_device_dialog, NULL); |
2313 | 2829 } |
2830 | |
2831 static void | |
2832 mainwin_create_window(void) | |
2833 { | |
2834 gint width, height; | |
2835 | |
3068
c5189bc4100b
Refactor skinned window code.
William Pitcock <nenolod@atheme-project.org>
parents:
3065
diff
changeset
|
2836 mainwin = ui_skinned_window_new("player"); |
2313 | 2837 gtk_window_set_title(GTK_WINDOW(mainwin), _("Audacious")); |
2838 gtk_window_set_role(GTK_WINDOW(mainwin), "player"); | |
2839 gtk_window_set_resizable(GTK_WINDOW(mainwin), FALSE); | |
2840 | |
2841 width = cfg.player_shaded ? MAINWIN_SHADED_WIDTH : bmp_active_skin->properties.mainwin_width; | |
2842 height = cfg.player_shaded ? MAINWIN_SHADED_HEIGHT : bmp_active_skin->properties.mainwin_height; | |
2843 | |
2844 if (cfg.doublesize) { | |
2845 width *= 2; | |
2846 height *= 2; | |
2847 } | |
2848 | |
2849 gtk_widget_set_size_request(mainwin, width, height); | |
2850 | |
2851 if (cfg.player_x != -1 && cfg.save_window_position) | |
2852 gtk_window_move(GTK_WINDOW(mainwin), cfg.player_x, cfg.player_y); | |
2853 | |
2854 g_signal_connect(mainwin, "destroy", G_CALLBACK(mainwin_destroy), NULL); | |
2855 g_signal_connect(mainwin, "button_press_event", | |
2856 G_CALLBACK(mainwin_mouse_button_press), NULL); | |
2857 g_signal_connect(mainwin, "scroll_event", | |
2858 G_CALLBACK(mainwin_scrolled), NULL); | |
2859 g_signal_connect(mainwin, "button_release_event", | |
2860 G_CALLBACK(mainwin_mouse_button_release), NULL); | |
2861 g_signal_connect(mainwin, "motion_notify_event", | |
2862 G_CALLBACK(mainwin_motion), NULL); | |
2863 g_signal_connect(mainwin, "configure_event", | |
2864 G_CALLBACK(mainwin_configure), NULL); | |
2865 g_signal_connect(mainwin, "style_set", | |
2866 G_CALLBACK(mainwin_set_back_pixmap), NULL); | |
2867 | |
2868 bmp_drag_dest_set(mainwin); | |
2869 | |
2870 g_signal_connect(mainwin, "key_press_event", | |
2871 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
|
2872 |
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
3157
diff
changeset
|
2873 ui_main_evlistener_init(); |
2313 | 2874 } |
2875 | |
2876 void | |
2877 mainwin_create(void) | |
2878 { | |
2879 mainwin_create_window(); | |
2880 | |
2881 gtk_window_add_accel_group( GTK_WINDOW(mainwin) , ui_manager_get_accel_group() ); | |
2882 | |
2883 mainwin_bg = gdk_pixmap_new(mainwin->window, | |
2884 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
|
2885 bmp_active_skin->properties.mainwin_height, -1); |
2313 | 2886 mainwin_bg_x2 = gdk_pixmap_new(mainwin->window, |
2887 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
|
2888 bmp_active_skin->properties.mainwin_height * 2, -1); |
2313 | 2889 mainwin_set_back_pixmap(); |
2890 mainwin_create_widgets(); | |
2891 } | |
2892 | |
2893 void | |
2894 mainwin_attach_idle_func(void) | |
2895 { | |
2896 mainwin_timeout_id = g_timeout_add(MAINWIN_UPDATE_INTERVAL, | |
2897 mainwin_idle_func, NULL); | |
2898 } | |
2899 | |
3018
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2900 gboolean |
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2901 mainwin_update_song_info(void) |
2313 | 2902 { |
3018
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2903 gint time = playback_get_time(); |
2313 | 2904 gint length, t; |
2905 gchar stime_prefix; | |
2906 | |
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
|
2907 if (!playback_get_playing()) |
3018
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2908 return FALSE; |
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2909 |
2313 | 2910 if (ab_position_a != -1 && ab_position_b != -1 && time > ab_position_b) |
2911 playback_seek(ab_position_a/1000); | |
2912 | |
2913 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
|
2914 playlistwin_set_time(time, length, cfg.timer_mode); |
2313 | 2915 |
2916 if (cfg.timer_mode == TIMER_REMAINING) { | |
2917 if (length != -1) { | |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2918 ui_skinned_number_set_number(mainwin_minus_num, 11); |
2313 | 2919 t = length - time; |
2920 stime_prefix = '-'; | |
2921 } | |
2922 else { | |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2923 ui_skinned_number_set_number(mainwin_minus_num, 10); |
2313 | 2924 t = time; |
2925 stime_prefix = ' '; | |
2926 } | |
2927 } | |
2928 else { | |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2929 ui_skinned_number_set_number(mainwin_minus_num, 10); |
2313 | 2930 t = time; |
2931 stime_prefix = ' '; | |
2932 } | |
2933 t /= 1000; | |
2934 | |
2935 /* Show the time in the format HH:MM when we have more than 100 | |
2936 * minutes. */ | |
2937 if (t >= 100 * 60) | |
2938 t /= 60; | |
3001
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2939 ui_skinned_number_set_number(mainwin_10min_num, t / 600); |
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_min_num, (t / 60) % 10); |
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2941 ui_skinned_number_set_number(mainwin_10sec_num, (t / 10) % 6); |
6d4b7b739232
fully implement UiSkinnedNumber, number.c no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
3000
diff
changeset
|
2942 ui_skinned_number_set_number(mainwin_sec_num, t % 10); |
2313 | 2943 |
3042
01ae56759d15
mainwin_sposition is now UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3040
diff
changeset
|
2944 if (!UI_SKINNED_HORIZONTAL_SLIDER(mainwin_sposition)->pressed) { |
2313 | 2945 gchar *time_str; |
2946 | |
2947 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
|
2948 ui_skinned_textbox_set_text(mainwin_stime_min, time_str); |
2313 | 2949 g_free(time_str); |
2950 | |
2951 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
|
2952 ui_skinned_textbox_set_text(mainwin_stime_sec, time_str); |
2313 | 2953 g_free(time_str); |
2954 } | |
2955 | |
2956 time /= 1000; | |
2957 length /= 1000; | |
2958 if (length > 0) { | |
2959 if (time > length) { | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2960 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
|
2961 ui_skinned_horizontal_slider_set_position(mainwin_sposition, 13); |
2313 | 2962 } |
2963 /* update the slider position ONLY if there is not a seek in progress */ | |
2964 else if (seek_state == MAINWIN_SEEK_NIL) { | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2965 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
|
2966 ui_skinned_horizontal_slider_set_position(mainwin_sposition, |
2313 | 2967 ((time * 12) / length) + 1); |
2968 } | |
2969 } | |
2970 else { | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
2971 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
|
2972 ui_skinned_horizontal_slider_set_position(mainwin_sposition, 1); |
2313 | 2973 } |
3018
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2974 |
6a9fdd5aee3a
Move timer updates out of the 100hz giant loop.
Daniel Drake <dsd@gentoo.org>
parents:
3006
diff
changeset
|
2975 return TRUE; |
2313 | 2976 } |
2977 | |
2978 static gboolean | |
2979 mainwin_idle_func(gpointer data) | |
2980 { | |
2981 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
|
2982 |
a6299755b78a
Don't call playback_get_time() if not playing in mainwin_idle_func().
Christian Birchinger <joker@netswarm.net>
parents:
3172
diff
changeset
|
2983 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
|
2984 input_update_vis(playback_get_time()); |
2313 | 2985 |
2986 GDK_THREADS_ENTER(); | |
2987 | |
2988 draw_main_window(mainwin_force_redraw); | |
2989 | |
2990 if (!count) { | |
2991 read_volume(VOLSET_UPDATE); | |
2992 count = 10; | |
2993 } | |
2994 else | |
2995 count--; | |
2996 | |
2997 mainwin_force_redraw = FALSE; | |
2998 draw_equalizer_window(FALSE); | |
2999 draw_playlist_window(FALSE); | |
3000 | |
3001 /* tristate buttons seek */ | |
3002 if ( seek_state != MAINWIN_SEEK_NIL ) | |
3003 { | |
3004 GTimeVal now_time; | |
3005 GTimeVal delta_time; | |
3006 gulong now_dur; | |
3007 g_get_current_time(&now_time); | |
3008 | |
3009 delta_time.tv_usec = now_time.tv_usec - cb_time.tv_usec; | |
3010 delta_time.tv_sec = now_time.tv_sec - cb_time.tv_sec; | |
3011 | |
3012 now_dur = labs((delta_time.tv_sec * 1000) + (glong) (delta_time.tv_usec / 1000)); | |
3013 | |
3014 if ( now_dur > TRISTATE_THRESHOLD ) | |
3015 { | |
3016 gint np; | |
3017 if (seek_state == MAINWIN_SEEK_REV) | |
3018 np = seek_initial_pos - labs((gulong)(now_dur/100)); /* seek back */ | |
3019 else | |
3020 np = seek_initial_pos + labs((gulong)(now_dur/100)); /* seek forward */ | |
3021 | |
3022 /* boundaries check */ | |
3023 if (np < 0 ) | |
3024 np = 0; | |
3025 else if ( np > 219 ) | |
3026 np = 219; | |
3027 | |
3040
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
3028 ui_skinned_horizontal_slider_set_position( mainwin_position , np ); |
067e0186623a
import UiSkinnedHorizontalSlider
Tomasz Mon <desowin@gmail.com>
parents:
3026
diff
changeset
|
3029 mainwin_position_motion_cb( mainwin_position, np ); |
2313 | 3030 } |
3031 } | |
3032 | |
3033 GDK_THREADS_LEAVE(); | |
3034 | |
3035 /* | |
3036 if (seek_state == MAINWIN_SEEK_REV) | |
3037 playback_seek(CLAMP(playback_get_time() - 1000, 0, | |
3038 playlist_get_current_length()) / 1000); | |
3039 else if (seek_state == MAINWIN_SEEK_FWD) | |
3040 playback_seek(CLAMP(playback_get_time() + 1000, 0, | |
3041 playlist_get_current_length()) / 1000); | |
3042 */ | |
3043 | |
3044 return TRUE; | |
3045 } | |
3046 | |
3047 | |
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
|
3048 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
|
3049 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
|
3050 { |
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 /* 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
|
3052 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
|
3053 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
|
3054 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
|
3055 } |
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
|
3056 |
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
|
3057 |
2313 | 3058 /* toggleactionentries actions */ |
3059 | |
3060 void | |
3061 action_anamode_peaks( GtkToggleAction * action ) | |
3062 { | |
3063 cfg.analyzer_peaks = gtk_toggle_action_get_active( action ); | |
3064 } | |
3065 | |
3066 void | |
3067 action_autoscroll_songname( GtkToggleAction * action ) | |
3068 { | |
3069 mainwin_set_title_scroll(gtk_toggle_action_get_active(action)); | |
3070 playlistwin_set_sinfo_scroll(cfg.autoscroll); /* propagate scroll setting to playlistwin_sinfo */ | |
3071 } | |
3072 | |
3073 void | |
3074 action_playback_noplaylistadvance( GtkToggleAction * action ) | |
3075 { | |
3076 cfg.no_playlist_advance = gtk_toggle_action_get_active( action ); | |
3077 } | |
3078 | |
3079 void | |
3080 action_playback_repeat( GtkToggleAction * action ) | |
3081 { | |
3082 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
|
3083 UI_SKINNED_BUTTON(mainwin_repeat)->inside = cfg.repeat; |
2313 | 3084 } |
3085 | |
3086 void | |
3087 action_playback_shuffle( GtkToggleAction * action ) | |
3088 { | |
3089 cfg.shuffle = gtk_toggle_action_get_active( action ); | |
3090 playlist_set_shuffle(cfg.shuffle); | |
2843
91ef09fe7936
UiSkinnedButton can now work as TButton
Tomasz Mon <desowin@gmail.com>
parents:
2842
diff
changeset
|
3091 UI_SKINNED_BUTTON(mainwin_shuffle)->inside = cfg.shuffle; |
2313 | 3092 } |
3093 | |
3094 void | |
3095 action_stop_after_current_song( GtkToggleAction * action ) | |
3096 { | |
3097 cfg.stopaftersong = gtk_toggle_action_get_active( action ); | |
3098 } | |
3099 | |
3100 void | |
3101 action_view_always_on_top( GtkToggleAction * action ) | |
3102 { | |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
3103 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
|
3104 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
|
3105 gtk_widget_queue_draw(mainwin_menurow); |
2907
21b27e97bfb9
Remove pointless starting_up variable.
William Pitcock <nenolod@atheme.org>
parents:
2906
diff
changeset
|
3106 hint_set_always(cfg.always_on_top); |
2313 | 3107 } |
3108 | |
3109 void | |
3110 action_view_doublesize( GtkToggleAction * action ) | |
3111 { | |
3069
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
3112 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
|
3113 gtk_widget_queue_draw(mainwin_menurow); |
093759970e44
replace Menurow with UiSkinnedMenurow
Tomasz Mon <desowin@gmail.com>
parents:
3057
diff
changeset
|
3114 set_doublesize(UI_SKINNED_MENUROW(mainwin_menurow)->doublesize_selected); |
2313 | 3115 gdk_flush(); |
3116 } | |
3117 | |
3118 void | |
3119 action_view_easymove( GtkToggleAction * action ) | |
3120 { | |
3121 cfg.easy_move = gtk_toggle_action_get_active( action ); | |
3122 } | |
3123 | |
3124 void | |
3125 action_view_on_all_workspaces( GtkToggleAction * action ) | |
3126 { | |
3127 cfg.sticky = gtk_toggle_action_get_active( action ); | |
3128 hint_set_sticky(cfg.sticky); | |
3129 } | |
3130 | |
3131 void | |
3132 action_roll_up_equalizer( GtkToggleAction * action ) | |
3133 { | |
3134 equalizerwin_set_shade_menu_cb(gtk_toggle_action_get_active(action)); | |
3135 } | |
3136 | |
3137 void | |
3138 action_roll_up_player( GtkToggleAction * action ) | |
3139 { | |
3140 mainwin_set_shade_menu_cb(gtk_toggle_action_get_active(action)); | |
3141 } | |
3142 | |
3143 void | |
3144 action_roll_up_playlist_editor( GtkToggleAction * action ) | |
3145 { | |
3146 playlistwin_set_shade(gtk_toggle_action_get_active(action)); | |
3147 } | |
3148 | |
3149 void | |
3150 action_show_equalizer( GtkToggleAction * action ) | |
3151 { | |
3152 if (gtk_toggle_action_get_active(action)) | |
3153 equalizerwin_real_show(); | |
3154 else | |
3155 equalizerwin_real_hide(); | |
3156 } | |
3157 | |
3158 void | |
3159 action_show_playlist_editor( GtkToggleAction * action ) | |
3160 { | |
3161 if (gtk_toggle_action_get_active(action)) | |
3162 playlistwin_show(); | |
3163 else | |
3164 playlistwin_hide(); | |
3165 } | |
3166 | |
3167 void | |
3168 action_show_player( GtkToggleAction * action ) | |
3169 { | |
3170 mainwin_show(gtk_toggle_action_get_active(action)); | |
3171 } | |
3172 | |
3173 | |
3174 /* radioactionentries actions (one callback for each radio group) */ | |
3175 | |
3176 void | |
3177 action_anafoff( GtkAction *action, GtkRadioAction *current ) | |
3178 { | |
3179 mainwin_vis_set_afalloff(gtk_radio_action_get_current_value(current)); | |
3180 } | |
3181 | |
3182 void | |
3183 action_anamode( GtkAction *action, GtkRadioAction *current ) | |
3184 { | |
3185 mainwin_vis_set_analyzer_mode(gtk_radio_action_get_current_value(current)); | |
3186 } | |
3187 | |
3188 void | |
3189 action_anatype( GtkAction *action, GtkRadioAction *current ) | |
3190 { | |
3191 mainwin_vis_set_analyzer_type(gtk_radio_action_get_current_value(current)); | |
3192 } | |
3193 | |
3194 void | |
3195 action_peafoff( GtkAction *action, GtkRadioAction *current ) | |
3196 { | |
3197 mainwin_vis_set_pfalloff(gtk_radio_action_get_current_value(current)); | |
3198 } | |
3199 | |
3200 void | |
3201 action_refrate( GtkAction *action, GtkRadioAction *current ) | |
3202 { | |
3203 mainwin_vis_set_refresh(gtk_radio_action_get_current_value(current)); | |
3204 } | |
3205 | |
3206 void | |
3207 action_scomode( GtkAction *action, GtkRadioAction *current ) | |
3208 { | |
3209 cfg.scope_mode = gtk_radio_action_get_current_value(current); | |
3210 } | |
3211 | |
3212 void | |
3213 action_vismode( GtkAction *action, GtkRadioAction *current ) | |
3214 { | |
3215 mainwin_vis_set_type_menu_cb(gtk_radio_action_get_current_value(current)); | |
3216 } | |
3217 | |
3218 void | |
3219 action_vprmode( GtkAction *action, GtkRadioAction *current ) | |
3220 { | |
3221 cfg.voiceprint_mode = gtk_radio_action_get_current_value(current); | |
3222 } | |
3223 | |
3224 void | |
3225 action_wshmode( GtkAction *action, GtkRadioAction *current ) | |
3226 { | |
3227 cfg.vu_mode = gtk_radio_action_get_current_value(current); | |
3228 } | |
3229 | |
3230 void | |
3231 action_viewtime( GtkAction *action, GtkRadioAction *current ) | |
3232 { | |
3233 set_timer_mode_menu_cb(gtk_radio_action_get_current_value(current)); | |
3234 } | |
3235 | |
3236 | |
3237 /* actionentries actions */ | |
3238 | |
3239 void | |
3240 action_about_audacious( void ) | |
3241 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3242 show_about_window(); |
2313 | 3243 } |
3244 | |
3245 void | |
3246 action_play_file( void ) | |
3247 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3248 run_filebrowser(PLAY_BUTTON); |
2313 | 3249 } |
3250 | |
3251 void | |
3252 action_play_location( void ) | |
3253 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3254 mainwin_show_add_url_window(); |
2313 | 3255 } |
3256 | |
3257 void | |
3258 action_ab_set( void ) | |
3259 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3260 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3261 if (playlist_get_current_length(playlist) != -1) |
2313 | 3262 { |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3263 if (ab_position_a == -1) |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3264 { |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3265 ab_position_a = playback_get_time(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3266 ab_position_b = -1; |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3267 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
|
3268 } |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3269 else if (ab_position_b == -1) |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3270 { |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3271 int time = playback_get_time(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3272 if (time > ab_position_a) |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3273 ab_position_b = time; |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3274 mainwin_release_info_text(); |
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 else |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3277 { |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3278 ab_position_a = playback_get_time(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3279 ab_position_b = -1; |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3280 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
|
3281 } |
2313 | 3282 } |
3283 } | |
3284 | |
3285 void | |
3286 action_ab_clear( void ) | |
3287 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3288 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3289 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
|
3290 { |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3291 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
|
3292 mainwin_release_info_text(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3293 } |
2313 | 3294 } |
3295 | |
3296 void | |
3297 action_current_track_info( void ) | |
3298 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3299 playlist_fileinfo_current(playlist_get_active()); |
2313 | 3300 } |
3301 | |
3302 void | |
3303 action_jump_to_file( void ) | |
3304 { | |
2500 | 3305 ui_jump_to_track(); |
2313 | 3306 } |
3307 | |
3308 void | |
3023
49ce30748980
added lastfm GUI stub
Cristi Magherusan <majeru@atheme-project.org>
parents:
3021
diff
changeset
|
3309 action_lastfm( void ) |
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 ui_lastfm(); |
49ce30748980
added lastfm GUI stub
Cristi Magherusan <majeru@atheme-project.org>
parents:
3021
diff
changeset
|
3312 } |
49ce30748980
added lastfm GUI stub
Cristi Magherusan <majeru@atheme-project.org>
parents:
3021
diff
changeset
|
3313 |
49ce30748980
added lastfm GUI stub
Cristi Magherusan <majeru@atheme-project.org>
parents:
3021
diff
changeset
|
3314 void |
2313 | 3315 action_jump_to_playlist_start( void ) |
3316 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3317 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3318 playlist_set_position(playlist, 0); |
2313 | 3319 } |
3320 | |
3321 void | |
3322 action_jump_to_time( void ) | |
3323 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3324 mainwin_jump_to_time(); |
2313 | 3325 } |
3326 | |
3327 void | |
3328 action_playback_next( void ) | |
3329 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3330 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3331 playlist_next(playlist); |
2313 | 3332 } |
3333 | |
3334 void | |
3335 action_playback_previous( void ) | |
3336 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3337 Playlist *playlist = playlist_get_active(); |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3338 playlist_prev(playlist); |
2313 | 3339 } |
3340 | |
3341 void | |
3342 action_playback_play( void ) | |
3343 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3344 mainwin_play_pushed(); |
2313 | 3345 } |
3346 | |
3347 void | |
3348 action_playback_playcd( void ) | |
3349 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3350 play_medium(); |
2313 | 3351 } |
3352 | |
3353 void | |
3354 action_playback_pause( void ) | |
3355 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3356 playback_pause(); |
2313 | 3357 } |
3358 | |
3359 void | |
3360 action_playback_stop( void ) | |
3361 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3362 mainwin_stop_pushed(); |
2313 | 3363 } |
3364 | |
3365 void | |
3366 action_preferences( void ) | |
3367 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3368 show_prefs_window(); |
2313 | 3369 } |
3370 | |
3371 void | |
3372 action_quit( void ) | |
3373 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
3374 mainwin_quit_cb(); |
2313 | 3375 } |