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