annotate src/audacious/ui_main.c @ 4325:309e8f970517

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