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