Mercurial > audlegacy
annotate audacious/main.c @ 2205:cc6a05baa156 trunk
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
author | giacomo |
---|---|
date | Sat, 23 Dec 2006 03:47:44 -0800 |
parents | 60bd49189fde |
children | 4de6e7d138c6 |
rev | line source |
---|---|
680
8282b365f6cb
[svn] - Add some sanity checking to make sure we can't do X11 stuff when running headless.
nenolod
parents:
625
diff
changeset
|
1 /* Audacious - Cross-platform multimedia player |
8282b365f6cb
[svn] - Add some sanity checking to make sure we can't do X11 stuff when running headless.
nenolod
parents:
625
diff
changeset
|
2 * Copyright (C) 2005-2006 Audacious development team. |
197
ccd034857702
[svn] Split up generic events into audcore_generic_events(), and client-specific stuff remains in mainwin_idle_func().
nenolod
parents:
196
diff
changeset
|
3 * |
ccd034857702
[svn] Split up generic events into audcore_generic_events(), and client-specific stuff remains in mainwin_idle_func().
nenolod
parents:
196
diff
changeset
|
4 * Based on BMP: |
0 | 5 * Copyright (C) 2003-2004 BMP development team. |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2003 XMMS development team. | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
2105
f18a5b617c34
[svn] - move to GPLv2-only. Based on my interpretation of the license, we are
nenolod
parents:
2088
diff
changeset
|
12 * the Free Software Foundation; under version 2 of the License. |
0 | 13 * |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
1459 | 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
0 | 22 */ |
23 | |
24 #ifdef HAVE_CONFIG_H | |
25 # include "config.h" | |
26 #endif | |
27 | |
28 #include "main.h" | |
29 | |
30 #include <glib.h> | |
31 #include <glib/gi18n.h> | |
32 #include <glib/gprintf.h> | |
33 #include <gdk/gdk.h> | |
34 #include <stdlib.h> | |
35 #include <string.h> | |
36 #include <getopt.h> | |
37 #include <ctype.h> | |
38 #include <time.h> | |
39 | |
40 #include <unistd.h> | |
41 #include <errno.h> | |
42 #include <sys/types.h> | |
43 #include <sys/stat.h> | |
44 #include <signal.h> | |
1640 | 45 |
46 #include "platform/smartinclude.h" | |
0 | 47 |
48 #include "libaudacious/configdb.h" | |
49 #include "libaudacious/beepctrl.h" | |
50 #include "libaudacious/util.h" | |
2146
e0e50e151bab
[svn] - move vfs from libaudacious to main audacious
nenolod
parents:
2127
diff
changeset
|
51 #include "vfs.h" |
0 | 52 |
53 #include "controlsocket.h" | |
54 #include "dnd.h" | |
55 #include "effect.h" | |
1653 | 56 #include "equalizer.h" |
0 | 57 #include "general.h" |
197
ccd034857702
[svn] Split up generic events into audcore_generic_events(), and client-specific stuff remains in mainwin_idle_func().
nenolod
parents:
196
diff
changeset
|
58 #include "genevent.h" |
0 | 59 #include "hints.h" |
60 #include "input.h" | |
61 #include "logger.h" | |
1653 | 62 #include "mainwin.h" |
0 | 63 #include "output.h" |
538
e4e897d20791
[svn] remove libaudcore, we never did anything with it
nenolod
parents:
534
diff
changeset
|
64 #include "playback.h" |
0 | 65 #include "playlist.h" |
1653 | 66 #include "ui_playlist.h" |
0 | 67 #include "pluginenum.h" |
68 #include "prefswin.h" | |
69 #include "skinwin.h" | |
70 #include "util.h" | |
71 #include "visualization.h" | |
530
1947144093bc
[svn] When running SVN, make a note of the SVN version. The SVN version is stored in build_stamp.c.
nenolod
parents:
486
diff
changeset
|
72 #include "build_stamp.h" |
1264 | 73 #include "ui_fileinfo.h" |
2156
a792aaee8e8e
[svn] - new signal handling which does not block (based on concept from BMP 0.9.8 that never got released)
nenolod
parents:
2146
diff
changeset
|
74 #include "signals.h" |
0 | 75 |
2205
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
76 #include "icons-csource.h" |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
77 #include "icons-stock.h" |
120 | 78 #include "images/audacious_player.xpm" |
0 | 79 |
680
8282b365f6cb
[svn] - Add some sanity checking to make sure we can't do X11 stuff when running headless.
nenolod
parents:
625
diff
changeset
|
80 gboolean has_x11_connection = FALSE; /* do we have an X11 connection? */ |
0 | 81 |
82 /* Translatable string for beep.desktop's comment field */ | |
85
8c8a20f72ace
[svn] s/static GTKItemFactoryEntry/GTKItemFactoryEntry/g.
nenolod
parents:
80
diff
changeset
|
83 const gchar *desktop_comment = N_("Audacious"); |
0 | 84 |
85
8c8a20f72ace
[svn] s/static GTKItemFactoryEntry/GTKItemFactoryEntry/g.
nenolod
parents:
80
diff
changeset
|
85 const gchar *application_name = N_("Audacious"); |
0 | 86 |
1653 | 87 |
0 | 88 struct _BmpCmdLineOpt { |
89 GList *filenames; | |
90 gint session; | |
1885
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
91 gboolean play, stop, pause, fwd, rew, play_pause, playcd, show_jump_box; |
0 | 92 gboolean enqueue, mainwin, remote, activate; |
93 gboolean load_skins; | |
191 | 94 gboolean headless; |
1348
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
95 gboolean no_log; |
2127
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
96 gboolean enqueue_to_temp; |
0 | 97 gchar *previous_session_id; |
98 }; | |
99 | |
100 typedef struct _BmpCmdLineOpt BmpCmdLineOpt; | |
101 | |
781
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
102 BmpCmdLineOpt options; |
0 | 103 |
104 BmpConfig cfg; | |
105 | |
106 BmpConfig bmp_default_config = { | |
107 MAINWIN_DEFAULT_POS_X, /* mainwin x position */ | |
108 MAINWIN_DEFAULT_POS_Y, /* mainwin y position */ | |
109 EQUALIZER_DEFAULT_POS_X, /* equalizer x position */ | |
110 EQUALIZER_DEFAULT_POS_Y, /* equalizer y position */ | |
111 PLAYLISTWIN_DEFAULT_POS_X, /* playlistwin x position */ | |
112 PLAYLISTWIN_DEFAULT_POS_Y, /* playlistwin y position */ | |
113 PLAYLISTWIN_DEFAULT_WIDTH, /* playlistwin width */ | |
114 PLAYLISTWIN_DEFAULT_HEIGHT, /* playlistwin height */ | |
115 10, /* snap distance */ | |
116 FALSE, /* real-time priority */ | |
117 FALSE, FALSE, /* shuffle, repeat */ | |
118 FALSE, /* UNUSED (double size) */ | |
119 TRUE, /* autoscroll */ | |
120 TRUE, /* analyzer peaks */ | |
121 FALSE, /* equalizer autoload */ | |
122 FALSE, /* easy move */ | |
123 FALSE, /* equalizer active */ | |
124 FALSE, /* playlistwin visible */ | |
125 FALSE, /* equalizer visible */ | |
126 TRUE, /* player visible */ | |
127 FALSE, /* player shaded */ | |
128 FALSE, /* playlistwin shaded */ | |
129 FALSE, /* equalizer shaded */ | |
130 FALSE, /* allow multiple instances */ | |
131 TRUE, /* always show cb */ | |
2019
d3a62e1075e2
[svn] Allow \ to / conversion to be switched on & off, by external contributor Chris Kehler <cbkehler@sympatico.ca>.
chainsaw
parents:
2003
diff
changeset
|
132 TRUE, TRUE, TRUE, /* convert '_', %20 and '\' */ |
0 | 133 TRUE, /* show numbers in playlist */ |
134 TRUE, /* snap windows */ | |
135 TRUE, /* save window positions */ | |
136 TRUE, /* dim titlebar */ | |
137 FALSE, /* get playlist info on load */ | |
138 TRUE, /* get playlist info on demand */ | |
139 TRUE, /* UNUSED (equalizer doublesize linked) */ | |
140 FALSE, /* sort jump to file */ | |
141 FALSE, /* use effect plugins */ | |
142 FALSE, /* always on top */ | |
143 FALSE, /* sticky */ | |
144 FALSE, /* no playlist advance */ | |
1884 | 145 FALSE, /* stop after current song */ |
893
6afdd0d7e1e1
[svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents:
887
diff
changeset
|
146 TRUE, /* refresh file list */ |
0 | 147 TRUE, /* UNUSED (smooth title scrolling) */ |
148 TRUE, /* use playlist metadata */ | |
149 TRUE, /* warn about unplayables */ | |
150 FALSE, /* use \ as directory delimiter */ | |
151 FALSE, /* random skin on play */ | |
152 FALSE, /* use fontsets */ | |
153 FALSE, /* use X font for mainwin */ | |
154 TRUE, /* use custom cursors */ | |
155 TRUE, /* close dialog on open */ | |
156 TRUE, /* close dialog on add */ | |
157 0.0, /* equalizer preamp */ | |
158 {0, 0, 0, 0, 0, /* equalizer bands */ | |
159 0, 0, 0, 0, 0}, | |
160 NULL, /* skin */ | |
161 NULL, /* output plugin */ | |
162 NULL, /* file selector path */ | |
163 NULL, /* playlist path */ | |
164 NULL, /* playlist font */ | |
165 NULL, /* mainwin font */ | |
166 NULL, /* disabled input plugins */ | |
167 NULL, /* enabled general plugins */ | |
168 NULL, /* enabled visualization plugins */ | |
169 NULL, /* enabled effect plugins */ | |
170 NULL, /* equalizer preset default file */ | |
171 NULL, /* equalizer preset extension */ | |
172 NULL, /* URL history */ | |
173 0, /* timer mode */ | |
174 VIS_ANALYZER, /* visualizer type */ | |
175 ANALYZER_NORMAL, /* analyzer mode */ | |
176 ANALYZER_BARS, /* analyzer type */ | |
177 SCOPE_DOT, /* scope mode */ | |
2203
60bd49189fde
[svn] - two realcolour modes for voiceprint vis: Fire and Ice
marvin
parents:
2186
diff
changeset
|
178 VOICEPRINT_NORMAL, /* voiceprint mode */ |
0 | 179 VU_SMOOTH, /* VU mode */ |
180 REFRESH_FULL, /* visualizer refresh rate */ | |
181 FALLOFF_FAST, /* analyzer fall off rate */ | |
182 FALLOFF_SLOW, /* peaks fall off rate */ | |
183 0, /* playlist position */ | |
184 2, /* pause between songs time */ | |
185 FALSE, /* pause between songs */ | |
186 FALSE, /* show window decorations */ | |
187 8, /* mouse wheel scroll step */ | |
188 FALSE, /* playlist transparent */ | |
1347
8a874906535b
[svn] - use a more standard-looking default title format
nenolod
parents:
1283
diff
changeset
|
189 2, /* 3rd preset (ARTIST - ALBUM - TITLE) */ |
0 | 190 NULL, /* title format */ |
191 FALSE, /* software volume control enabled */ | |
192 TRUE, /* UNUSED (XMMS compatibility mode) */ | |
193 TRUE, /* extra eq filtering */ | |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
194 3, /* scroll pl by */ |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
195 FALSE, /* resume playback on startup */ |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
196 -1, /* resume playback on startup time */ |
1147 | 197 TRUE, /* show seperators in pl */ |
1146
7e208feb36a2
[svn] - new global variable `output_buffer_size', replaces all of the per-plugin buffer sizes
nenolod
parents:
1105
diff
changeset
|
198 NULL, |
7e208feb36a2
[svn] - new global variable `output_buffer_size', replaces all of the per-plugin buffer sizes
nenolod
parents:
1105
diff
changeset
|
199 NULL, |
1163
ff71f891265b
[svn] - Allow to do format detection on demand; instead of immediately on add
nenolod
parents:
1147
diff
changeset
|
200 3000, /* audio buffer size */ |
1164 | 201 FALSE, /* whether or not to postpone format detection on initial add */ |
1358 | 202 TRUE, /* show filepopup for tuple */ |
1413 | 203 NULL, /* words identifying covers */ |
204 NULL, /* words that might not show up in cover names */ | |
1444
c04ce16b2b57
[svn] - libaudacious/beepctrl.c: optimise further and be more paranoid about leaks
nenolod
parents:
1429
diff
changeset
|
205 FALSE, |
c04ce16b2b57
[svn] - libaudacious/beepctrl.c: optimise further and be more paranoid about leaks
nenolod
parents:
1429
diff
changeset
|
206 0, |
c04ce16b2b57
[svn] - libaudacious/beepctrl.c: optimise further and be more paranoid about leaks
nenolod
parents:
1429
diff
changeset
|
207 NULL, /* default session uri base (non-NULL = custom session uri base) */ |
1710 | 208 150, /* short side length of the picture in the filepopup */ |
209 20, /* delay until the filepopup comes up */ | |
1904
4960ba312ffe
[svn] - add a default value for cfg.use_file_cover (FALSE)
nenolod
parents:
1889
diff
changeset
|
210 FALSE, /* use filename.jpg for coverart */ |
1905
6b4116c34489
[svn] - change "Transparency" to "Miscillaneous UI Features" in prefswin
nenolod
parents:
1904
diff
changeset
|
211 FALSE, /* use XMMS-style file selection */ |
2113 | 212 TRUE, /* use extension probing */ |
2186 | 213 255, 255, 255, /* colorize r, g, b */ |
0 | 214 }; |
215 | |
216 typedef struct bmp_cfg_boolent_t { | |
217 char const *be_vname; | |
218 gboolean *be_vloc; | |
219 gboolean be_wrt; | |
220 } bmp_cfg_boolent; | |
221 | |
222 typedef struct bmp_cfg_nument_t { | |
223 char const *ie_vname; | |
224 gint *ie_vloc; | |
225 gboolean ie_wrt; | |
226 } bmp_cfg_nument; | |
227 | |
228 typedef struct bmp_cfg_strent_t { | |
229 char const *se_vname; | |
230 char **se_vloc; | |
231 gboolean se_wrt; | |
232 } bmp_cfg_strent; | |
233 | |
234 const gchar *bmp_titlestring_presets[] = { | |
235 "%t", | |
946
8cfe13fcd0c7
[svn] - Forgot a few things regarding titlestrings!
nhjm449
parents:
943
diff
changeset
|
236 "%{p:%p - %}%t", |
8cfe13fcd0c7
[svn] - Forgot a few things regarding titlestrings!
nhjm449
parents:
943
diff
changeset
|
237 "%{p:%p - %}%{a:%a - %}%t", |
943 | 238 "%{p:%p - %}%{a:%a - %}%{n:%n. %}%t", |
239 "%{p:%p %}%{a:[ %a ] %}%{p:- %}%{n:%n. %}%{t:%t%}", | |
946
8cfe13fcd0c7
[svn] - Forgot a few things regarding titlestrings!
nhjm449
parents:
943
diff
changeset
|
240 "%{a:%a - %}%t" |
0 | 241 }; |
242 | |
243 const guint n_titlestring_presets = G_N_ELEMENTS(bmp_titlestring_presets); | |
244 | |
1105
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
245 const gchar *chardet_detector_presets[] = { |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
246 "None", |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
247 "Japanese", |
1595
e6cc84e06444
[svn] - libguess update: workaround for that g_convert can't convert properly from UCS-2BE/LE trailing after BOM.
yaz
parents:
1566
diff
changeset
|
248 "Taiwanese", |
e6cc84e06444
[svn] - libguess update: workaround for that g_convert can't convert properly from UCS-2BE/LE trailing after BOM.
yaz
parents:
1566
diff
changeset
|
249 "Chinese", |
e6cc84e06444
[svn] - libguess update: workaround for that g_convert can't convert properly from UCS-2BE/LE trailing after BOM.
yaz
parents:
1566
diff
changeset
|
250 "Korean", |
1613
9becbe564217
[svn] - chardet patch for Russian language witten by Valentine Sinitsyn.
yaz
parents:
1595
diff
changeset
|
251 "Russian", |
1105
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
252 #ifdef HAVE_UDET |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
253 "Universal" |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
254 #endif |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
255 }; |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
256 |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
257 const guint n_chardet_detector_presets = G_N_ELEMENTS(chardet_detector_presets); |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
258 |
0 | 259 static bmp_cfg_boolent bmp_boolents[] = { |
260 {"allow_multiple_instances", &cfg.allow_multiple_instances, TRUE}, | |
261 {"use_realtime", &cfg.use_realtime, TRUE}, | |
262 {"always_show_cb", &cfg.always_show_cb, TRUE}, | |
263 {"convert_underscore", &cfg.convert_underscore, TRUE}, | |
264 {"convert_twenty", &cfg.convert_twenty, TRUE}, | |
2019
d3a62e1075e2
[svn] Allow \ to / conversion to be switched on & off, by external contributor Chris Kehler <cbkehler@sympatico.ca>.
chainsaw
parents:
2003
diff
changeset
|
265 {"convert_slash", &cfg.convert_slash, TRUE }, |
0 | 266 {"show_numbers_in_pl", &cfg.show_numbers_in_pl, TRUE}, |
1056
21628529c615
[svn] add the config option to enable/disable separator line in the playlist
yaz
parents:
1042
diff
changeset
|
267 {"show_separator_in_pl", &cfg.show_separator_in_pl, TRUE}, |
0 | 268 {"snap_windows", &cfg.snap_windows, TRUE}, |
269 {"save_window_positions", &cfg.save_window_position, TRUE}, | |
270 {"dim_titlebar", &cfg.dim_titlebar, TRUE}, | |
271 {"get_info_on_load", &cfg.get_info_on_load, TRUE}, | |
272 {"get_info_on_demand", &cfg.get_info_on_demand, TRUE}, | |
1938 | 273 {"eq_doublesize_linked", &cfg.eq_doublesize_linked, TRUE}, |
0 | 274 {"no_playlist_advance", &cfg.no_playlist_advance, TRUE}, |
893
6afdd0d7e1e1
[svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents:
887
diff
changeset
|
275 {"refresh_file_list", &cfg.refresh_file_list, TRUE}, |
0 | 276 {"sort_jump_to_file", &cfg.sort_jump_to_file, TRUE}, |
277 {"use_pl_metadata", &cfg.use_pl_metadata, TRUE}, | |
278 {"warn_about_unplayables", &cfg.warn_about_unplayables, TRUE}, | |
279 {"use_backslash_as_dir_delimiter", &cfg.use_backslash_as_dir_delimiter, TRUE}, | |
280 {"player_shaded", &cfg.player_shaded, TRUE}, | |
281 {"player_visible", &cfg.player_visible, TRUE}, | |
282 {"shuffle", &cfg.shuffle, TRUE}, | |
283 {"repeat", &cfg.repeat, TRUE}, | |
1938 | 284 {"doublesize", &cfg.doublesize, TRUE}, |
0 | 285 {"autoscroll_songname", &cfg.autoscroll, TRUE}, |
898 | 286 {"stop_after_current_song", &cfg.stopaftersong, TRUE}, |
0 | 287 {"playlist_shaded", &cfg.playlist_shaded, TRUE}, |
288 {"playlist_visible", &cfg.playlist_visible, TRUE}, | |
289 {"playlist_transparent", &cfg.playlist_transparent, TRUE}, | |
290 {"use_fontsets", &cfg.use_fontsets, TRUE}, | |
85
8c8a20f72ace
[svn] s/static GTKItemFactoryEntry/GTKItemFactoryEntry/g.
nenolod
parents:
80
diff
changeset
|
291 {"mainwin_use_xfont", &cfg.mainwin_use_xfont, FALSE}, |
0 | 292 {"equalizer_visible", &cfg.equalizer_visible, TRUE}, |
293 {"equalizer_active", &cfg.equalizer_active, TRUE}, | |
294 {"equalizer_shaded", &cfg.equalizer_shaded, TRUE}, | |
295 {"equalizer_autoload", &cfg.equalizer_autoload, TRUE}, | |
1938 | 296 {"easy_move", &cfg.easy_move, TRUE}, |
0 | 297 {"use_eplugins", &cfg.use_eplugins, TRUE}, |
298 {"always_on_top", &cfg.always_on_top, TRUE}, | |
299 {"sticky", &cfg.sticky, TRUE}, | |
300 {"random_skin_on_play", &cfg.random_skin_on_play, TRUE}, | |
301 {"pause_between_songs", &cfg.pause_between_songs, TRUE}, | |
302 {"show_wm_decorations", &cfg.show_wm_decorations, TRUE}, | |
303 {"eq_extra_filtering", &cfg.eq_extra_filtering, TRUE}, | |
304 {"analyzer_peaks", &cfg.analyzer_peaks, TRUE}, | |
305 {"custom_cursors", &cfg.custom_cursors, TRUE}, | |
306 {"close_dialog_open", &cfg.close_dialog_open, TRUE}, | |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
307 {"close_dialog_add", &cfg.close_dialog_add, TRUE}, |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
308 {"resume_playback_on_startup", &cfg.resume_playback_on_startup, TRUE}, |
1163
ff71f891265b
[svn] - Allow to do format detection on demand; instead of immediately on add
nenolod
parents:
1147
diff
changeset
|
309 {"playlist_detect", &cfg.playlist_detect, TRUE}, |
1358 | 310 {"show_filepopup_for_tuple", &cfg.show_filepopup_for_tuple, TRUE}, |
1889
597bd579d9af
[svn] Patch by Michael Hanselmann to fetch a per-song image file.
nemo
parents:
1886
diff
changeset
|
311 {"recurse_for_cover", &cfg.recurse_for_cover, TRUE}, |
597bd579d9af
[svn] Patch by Michael Hanselmann to fetch a per-song image file.
nemo
parents:
1886
diff
changeset
|
312 {"use_file_cover", &cfg.use_file_cover, TRUE}, |
1905
6b4116c34489
[svn] - change "Transparency" to "Miscillaneous UI Features" in prefswin
nenolod
parents:
1904
diff
changeset
|
313 {"use_xmms_style_fileselector", &cfg.use_xmms_style_fileselector, TRUE}, |
2108
02f39b64f36b
[svn] - add support for new extension probing system
nenolod
parents:
2105
diff
changeset
|
314 {"use_extension_probing", &cfg.use_extension_probing, TRUE}, |
0 | 315 }; |
316 | |
317 static gint ncfgbent = G_N_ELEMENTS(bmp_boolents); | |
318 | |
319 static bmp_cfg_nument bmp_numents[] = { | |
320 {"player_x", &cfg.player_x, TRUE}, | |
321 {"player_y", &cfg.player_y, TRUE}, | |
322 {"timer_mode", &cfg.timer_mode, TRUE}, | |
323 {"vis_type", &cfg.vis_type, TRUE}, | |
324 {"analyzer_mode", &cfg.analyzer_mode, TRUE}, | |
325 {"analyzer_type", &cfg.analyzer_type, TRUE}, | |
326 {"scope_mode", &cfg.scope_mode, TRUE}, | |
327 {"vu_mode", &cfg.vu_mode, TRUE}, | |
2203
60bd49189fde
[svn] - two realcolour modes for voiceprint vis: Fire and Ice
marvin
parents:
2186
diff
changeset
|
328 {"voiceprint_mode", &cfg.voiceprint_mode, TRUE}, |
0 | 329 {"vis_refresh_rate", &cfg.vis_refresh, TRUE}, |
330 {"analyzer_falloff", &cfg.analyzer_falloff, TRUE}, | |
331 {"peaks_falloff", &cfg.peaks_falloff, TRUE}, | |
332 {"playlist_x", &cfg.playlist_x, TRUE}, | |
333 {"playlist_y", &cfg.playlist_y, TRUE}, | |
334 {"playlist_width", &cfg.playlist_width, TRUE}, | |
335 {"playlist_height", &cfg.playlist_height, TRUE}, | |
336 {"playlist_position", &cfg.playlist_position, TRUE}, | |
337 {"equalizer_x", &cfg.equalizer_x, TRUE}, | |
338 {"equalizer_y", &cfg.equalizer_y, TRUE}, | |
339 {"snap_distance", &cfg.snap_distance, TRUE}, | |
340 {"pause_between_songs_time", &cfg.pause_between_songs_time, TRUE}, | |
341 {"mouse_wheel_change", &cfg.mouse_change, TRUE}, | |
342 {"scroll_pl_by", &cfg.scroll_pl_by, TRUE}, | |
343 {"titlestring_preset", &cfg.titlestring_preset, TRUE}, | |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
344 {"resume_playback_on_startup_time", &cfg.resume_playback_on_startup_time, TRUE}, |
1146
7e208feb36a2
[svn] - new global variable `output_buffer_size', replaces all of the per-plugin buffer sizes
nenolod
parents:
1105
diff
changeset
|
345 {"output_buffer_size", &cfg.output_buffer_size, TRUE}, |
1710 | 346 {"recurse_for_cover_depth", &cfg.recurse_for_cover_depth, TRUE}, |
347 {"filepopup_pixelsize", &cfg.filepopup_pixelsize, TRUE}, | |
348 {"filepopup_delay", &cfg.filepopup_delay, TRUE}, | |
2186 | 349 {"colorize_r", &cfg.colorize_r, TRUE}, |
350 {"colorize_g", &cfg.colorize_g, TRUE}, | |
351 {"colorize_b", &cfg.colorize_b, TRUE}, | |
0 | 352 }; |
353 | |
354 static gint ncfgient = G_N_ELEMENTS(bmp_numents); | |
355 | |
356 static bmp_cfg_strent bmp_strents[] = { | |
357 {"playlist_font", &cfg.playlist_font, TRUE}, | |
358 {"mainwin_font", &cfg.mainwin_font, TRUE}, | |
359 {"eqpreset_default_file", &cfg.eqpreset_default_file, TRUE}, | |
360 {"eqpreset_extension", &cfg.eqpreset_extension, TRUE}, | |
361 {"skin", &cfg.skin, FALSE}, | |
362 {"output_plugin", &cfg.outputplugin, FALSE}, | |
363 {"disabled_iplugins", &cfg.disabled_iplugins, TRUE}, | |
364 {"enabled_gplugins", &cfg.enabled_gplugins, FALSE}, | |
365 {"enabled_vplugins", &cfg.enabled_vplugins, FALSE}, | |
366 {"enabled_eplugins", &cfg.enabled_eplugins, FALSE}, | |
367 {"filesel_path", &cfg.filesel_path, FALSE}, | |
368 {"playlist_path", &cfg.playlist_path, FALSE}, | |
369 {"generic_title_format", &cfg.gentitle_format, TRUE}, | |
1105
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
370 {"chardet_detector", &cfg.chardet_detector, TRUE}, |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
371 {"chardet_fallback", &cfg.chardet_fallback, TRUE}, |
1413 | 372 {"cover_name_include", &cfg.cover_name_include, TRUE}, |
373 {"cover_name_exclude", &cfg.cover_name_exclude, TRUE}, | |
1444
c04ce16b2b57
[svn] - libaudacious/beepctrl.c: optimise further and be more paranoid about leaks
nenolod
parents:
1429
diff
changeset
|
374 {"session_uri_base", &cfg.session_uri_base, TRUE} |
0 | 375 }; |
376 | |
377 static gint ncfgsent = G_N_ELEMENTS(bmp_strents); | |
378 | |
379 gchar *bmp_paths[BMP_PATH_COUNT] = {}; | |
380 | |
381 GList *dock_window_list = NULL; | |
382 | |
383 gboolean pposition_broken = FALSE; | |
384 | |
486 | 385 gboolean starting_up = TRUE; |
0 | 386 |
1883
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
387 /* XXX: case-sensitivity is bad for lazy nenolods. :( -nenolod */ |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
388 static gchar *pl_candidates[] = { |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
389 PLUGIN_FILENAME("ALSA"), |
1886 | 390 PLUGIN_FILENAME("coreaudio"), |
1883
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
391 PLUGIN_FILENAME("OSS"), |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
392 PLUGIN_FILENAME("sun"), |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
393 PLUGIN_FILENAME("ESD"), |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
394 PLUGIN_FILENAME("pulse_audio"), |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
395 PLUGIN_FILENAME("disk_writer"), |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
396 NULL |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
397 }; |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
398 |
2026 | 399 GCond *cond_scan; |
400 GMutex *mutex_scan; | |
401 | |
0 | 402 static GSList * |
403 get_feature_list(void) | |
404 { | |
405 GSList *features = NULL; | |
406 | |
407 #ifdef HAVE_GCONF | |
408 features = g_slist_append(features, "GConf"); | |
409 #endif | |
410 | |
411 return features; | |
412 } | |
413 | |
414 static void | |
415 dump_version(void) | |
416 { | |
417 GSList *features; | |
418 | |
530
1947144093bc
[svn] When running SVN, make a note of the SVN version. The SVN version is stored in build_stamp.c.
nenolod
parents:
486
diff
changeset
|
419 g_printf("%s %s [%s]", _(application_name), VERSION, svn_stamp); |
0 | 420 |
421 features = get_feature_list(); | |
422 | |
423 if (features) { | |
424 GSList *item; | |
425 | |
426 g_printf(" ("); | |
427 | |
428 for (item = features; g_slist_next(item); item = g_slist_next(item)) | |
429 g_printf("%s, ", (const gchar *) item->data); | |
430 | |
431 g_printf("%s)", (const gchar *) item->data); | |
432 | |
433 g_slist_free(features); | |
434 } | |
435 | |
436 g_printf("\n"); | |
437 } | |
438 | |
439 const gchar * | |
440 xmms_get_gentitle_format(void) | |
441 { | |
625
0a73d1faeb4e
[svn] GCC 4.1 warning fixes by Diego 'Flameeyes' Petteno from Gentoo.
chainsaw
parents:
538
diff
changeset
|
442 guint titlestring_preset = cfg.titlestring_preset; |
0 | 443 |
444 if (titlestring_preset < n_titlestring_presets) | |
445 return bmp_titlestring_presets[titlestring_preset]; | |
446 | |
447 return cfg.gentitle_format; | |
448 } | |
449 | |
887 | 450 void |
0 | 451 make_directory(const gchar * path, mode_t mode) |
452 { | |
453 if (mkdir(path, mode) == 0) | |
454 return; | |
455 | |
456 if (errno == EEXIST) | |
457 return; | |
458 | |
459 g_printerr(_("Could not create directory (%s): %s"), path, | |
460 g_strerror(errno)); | |
461 } | |
462 | |
463 static void | |
464 bmp_make_user_dir(void) | |
465 { | |
466 const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; | |
467 | |
468 make_directory(bmp_paths[BMP_PATH_USER_DIR], mode755); | |
469 make_directory(bmp_paths[BMP_PATH_USER_PLUGIN_DIR], mode755); | |
470 make_directory(bmp_paths[BMP_PATH_USER_SKIN_DIR], mode755); | |
471 make_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR], mode755); | |
472 } | |
473 | |
474 static void | |
475 bmp_free_paths(void) | |
476 { | |
477 int i; | |
478 | |
479 for (i = 0; i < BMP_PATH_COUNT; i++) | |
480 { | |
481 g_free(bmp_paths[i]); | |
482 bmp_paths[i] = 0; | |
483 } | |
484 } | |
485 | |
486 | |
487 #define USER_PATH(path) \ | |
488 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], path, NULL); | |
489 | |
490 static void | |
491 bmp_init_paths(void) | |
492 { | |
734 | 493 bmp_paths[BMP_PATH_USER_DIR] = g_build_filename(g_get_home_dir(), BMP_RCPATH, NULL); |
0 | 494 |
495 bmp_paths[BMP_PATH_USER_PLUGIN_DIR] = USER_PATH(BMP_USER_PLUGIN_DIR_BASENAME); | |
496 bmp_paths[BMP_PATH_USER_SKIN_DIR] = USER_PATH(BMP_SKIN_DIR_BASENAME); | |
497 bmp_paths[BMP_PATH_SKIN_THUMB_DIR] = USER_PATH(BMP_SKIN_THUMB_DIR_BASENAME); | |
498 bmp_paths[BMP_PATH_CONFIG_FILE] = USER_PATH(BMP_CONFIG_BASENAME); | |
499 bmp_paths[BMP_PATH_PLAYLIST_FILE] = USER_PATH(BMP_PLAYLIST_BASENAME); | |
500 bmp_paths[BMP_PATH_ACCEL_FILE] = USER_PATH(BMP_ACCEL_BASENAME); | |
501 bmp_paths[BMP_PATH_LOG_FILE] = USER_PATH(BMP_LOG_BASENAME); | |
502 | |
503 g_atexit(bmp_free_paths); | |
504 } | |
505 | |
506 | |
507 void | |
508 bmp_config_load(void) | |
509 { | |
510 ConfigDb *db; | |
511 gint i, length; | |
512 | |
513 memcpy(&cfg, &bmp_default_config, sizeof(BmpConfig)); | |
514 | |
515 db = bmp_cfg_db_open(); | |
516 for (i = 0; i < ncfgbent; ++i) { | |
517 bmp_cfg_db_get_bool(db, NULL, | |
518 bmp_boolents[i].be_vname, | |
519 bmp_boolents[i].be_vloc); | |
520 } | |
521 | |
522 for (i = 0; i < ncfgient; ++i) { | |
523 bmp_cfg_db_get_int(db, NULL, | |
524 bmp_numents[i].ie_vname, | |
525 bmp_numents[i].ie_vloc); | |
526 } | |
527 | |
528 for (i = 0; i < ncfgsent; ++i) { | |
529 bmp_cfg_db_get_string(db, NULL, | |
530 bmp_strents[i].se_vname, | |
531 bmp_strents[i].se_vloc); | |
532 } | |
533 | |
534 /* Preset */ | |
535 bmp_cfg_db_get_float(db, NULL, "equalizer_preamp", &cfg.equalizer_preamp); | |
536 for (i = 0; i < 10; i++) { | |
537 gchar eqtext[18]; | |
538 | |
539 g_snprintf(eqtext, sizeof(eqtext), "equalizer_band%d", i); | |
540 bmp_cfg_db_get_float(db, NULL, eqtext, &cfg.equalizer_bands[i]); | |
541 } | |
542 | |
543 /* History */ | |
544 if (bmp_cfg_db_get_int(db, NULL, "url_history_length", &length)) { | |
545 for (i = 1; i <= length; i++) { | |
546 gchar str[19], *tmp; | |
547 | |
548 g_snprintf(str, sizeof(str), "url_history%d", i); | |
549 if (bmp_cfg_db_get_string(db, NULL, str, &tmp)) | |
550 cfg.url_history = g_list_append(cfg.url_history, tmp); | |
551 } | |
552 } | |
553 | |
554 bmp_cfg_db_close(db); | |
555 | |
556 | |
557 if (cfg.playlist_font && strlen(cfg.playlist_font) == 0) { | |
558 g_free(cfg.playlist_font); | |
559 cfg.playlist_font = NULL; | |
560 } | |
561 | |
562 if (cfg.mainwin_font && strlen(cfg.mainwin_font) == 0) { | |
563 g_free(cfg.mainwin_font); | |
564 cfg.mainwin_font = NULL; | |
565 } | |
566 | |
567 if (!cfg.playlist_font) | |
1653 | 568 cfg.playlist_font = g_strdup(PLAYLISTWIN_DEFAULT_FONT); |
0 | 569 |
570 if (!cfg.mainwin_font) | |
1653 | 571 cfg.mainwin_font = g_strdup(MAINWIN_DEFAULT_FONT); |
0 | 572 |
573 if (!cfg.gentitle_format) | |
1347
8a874906535b
[svn] - use a more standard-looking default title format
nenolod
parents:
1283
diff
changeset
|
574 cfg.gentitle_format = g_strdup("%{p:%p - %}%{a:%a - %}%t"); |
0 | 575 |
576 if (!cfg.outputplugin) { | |
1883
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
577 gint iter; |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
578 gchar *pl_path = g_build_filename(PLUGIN_DIR, plugin_dir_list[0], NULL); |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
579 |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
580 for (iter = 0; pl_candidates[iter] != NULL && cfg.outputplugin == NULL; iter++) |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
581 { |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
582 cfg.outputplugin = find_file_recursively(pl_path, pl_candidates[iter]); |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
583 } |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
584 |
5f0266d393b8
[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
nenolod
parents:
1811
diff
changeset
|
585 g_free(pl_path); |
0 | 586 } |
587 | |
588 if (!cfg.eqpreset_default_file) | |
1653 | 589 cfg.eqpreset_default_file = g_strdup(EQUALIZER_DEFAULT_DIR_PRESET); |
0 | 590 |
591 if (!cfg.eqpreset_extension) | |
1653 | 592 cfg.eqpreset_extension = g_strdup(EQUALIZER_DEFAULT_PRESET_EXT); |
1413 | 593 |
1761
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
594 if (!cfg.chardet_fallback) |
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
595 cfg.chardet_fallback = g_strdup(""); |
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
596 |
1413 | 597 if (!cfg.cover_name_include) |
598 cfg.cover_name_include = g_strdup(""); | |
599 | |
600 if (!cfg.cover_name_exclude) | |
601 cfg.cover_name_exclude = g_strdup("back"); | |
1761
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
602 |
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
603 if (!cfg.session_uri_base) |
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
604 cfg.session_uri_base = g_strdup(""); |
0 | 605 } |
606 | |
607 | |
608 void | |
609 bmp_config_save(void) | |
610 { | |
611 GList *node; | |
612 gchar *str; | |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
613 gint i, cur_pb_time; |
0 | 614 ConfigDb *db; |
2088 | 615 Playlist *playlist = playlist_get_active(); |
0 | 616 |
617 cfg.disabled_iplugins = input_stringify_disabled_list(); | |
618 | |
619 | |
620 db = bmp_cfg_db_open(); | |
621 | |
622 for (i = 0; i < ncfgbent; ++i) | |
623 if (bmp_boolents[i].be_wrt) | |
624 bmp_cfg_db_set_bool(db, NULL, | |
625 bmp_boolents[i].be_vname, | |
626 *bmp_boolents[i].be_vloc); | |
627 | |
628 for (i = 0; i < ncfgient; ++i) | |
629 if (bmp_numents[i].ie_wrt) | |
630 bmp_cfg_db_set_int(db, NULL, | |
631 bmp_numents[i].ie_vname, | |
632 *bmp_numents[i].ie_vloc); | |
633 | |
634 /* This is a bit lame .. it'll end up being written twice, | |
635 * could do with being done a bit neater. -larne */ | |
636 bmp_cfg_db_set_int(db, NULL, "playlist_position", | |
2088 | 637 playlist_get_position(playlist)); |
0 | 638 |
207
e152a92d3f45
[svn] Save the preference to enable or disable bitmap fonts.
nenolod
parents:
198
diff
changeset
|
639 bmp_cfg_db_set_bool(db, NULL, "mainwin_use_xfont", |
e152a92d3f45
[svn] Save the preference to enable or disable bitmap fonts.
nenolod
parents:
198
diff
changeset
|
640 cfg.mainwin_use_xfont); |
e152a92d3f45
[svn] Save the preference to enable or disable bitmap fonts.
nenolod
parents:
198
diff
changeset
|
641 |
0 | 642 for (i = 0; i < ncfgsent; ++i) { |
643 if (bmp_strents[i].se_wrt) | |
644 bmp_cfg_db_set_string(db, NULL, | |
645 bmp_strents[i].se_vname, | |
646 *bmp_strents[i].se_vloc); | |
647 } | |
648 | |
649 bmp_cfg_db_set_float(db, NULL, "equalizer_preamp", cfg.equalizer_preamp); | |
650 | |
651 for (i = 0; i < 10; i++) { | |
652 str = g_strdup_printf("equalizer_band%d", i); | |
653 bmp_cfg_db_set_float(db, NULL, str, cfg.equalizer_bands[i]); | |
654 g_free(str); | |
655 } | |
656 | |
196 | 657 if (bmp_active_skin != NULL) |
658 { | |
659 if (bmp_active_skin->path) | |
660 bmp_cfg_db_set_string(db, NULL, "skin", bmp_active_skin->path); | |
661 else | |
662 bmp_cfg_db_unset_key(db, NULL, "skin"); | |
663 } | |
0 | 664 |
665 if (get_current_output_plugin()) | |
666 bmp_cfg_db_set_string(db, NULL, "output_plugin", | |
667 get_current_output_plugin()->filename); | |
668 else | |
669 bmp_cfg_db_unset_key(db, NULL, "output_plugin"); | |
670 | |
671 str = general_stringify_enabled_list(); | |
672 if (str) { | |
673 bmp_cfg_db_set_string(db, NULL, "enabled_gplugins", str); | |
674 g_free(str); | |
675 } | |
676 else | |
677 bmp_cfg_db_unset_key(db, NULL, "enabled_gplugins"); | |
678 | |
679 str = vis_stringify_enabled_list(); | |
680 if (str) { | |
681 bmp_cfg_db_set_string(db, NULL, "enabled_vplugins", str); | |
682 g_free(str); | |
683 } | |
684 else | |
685 bmp_cfg_db_unset_key(db, NULL, "enabled_vplugins"); | |
686 | |
687 str = effect_stringify_enabled_list(); | |
688 if (str) { | |
689 bmp_cfg_db_set_string(db, NULL, "enabled_eplugins", str); | |
690 g_free(str); | |
691 } | |
692 else | |
693 bmp_cfg_db_unset_key(db, NULL, "enabled_eplugins"); | |
694 | |
695 if (cfg.filesel_path) | |
696 bmp_cfg_db_set_string(db, NULL, "filesel_path", cfg.filesel_path); | |
697 | |
698 if (cfg.playlist_path) | |
699 bmp_cfg_db_set_string(db, NULL, "playlist_path", cfg.playlist_path); | |
700 | |
701 bmp_cfg_db_set_int(db, NULL, "url_history_length", | |
702 g_list_length(cfg.url_history)); | |
703 | |
704 for (node = cfg.url_history, i = 1; node; node = g_list_next(node), i++) { | |
705 str = g_strdup_printf("url_history%d", i); | |
706 bmp_cfg_db_set_string(db, NULL, str, node->data); | |
707 g_free(str); | |
708 } | |
709 | |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
710 if (bmp_playback_get_playing()) { |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
711 cur_pb_time = bmp_playback_get_time(); |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
712 } else |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
713 cur_pb_time = -1; |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
714 cfg.resume_playback_on_startup_time = cur_pb_time; |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
715 bmp_cfg_db_set_int(db, NULL, "resume_playback_on_startup_time", |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
716 cfg.resume_playback_on_startup_time); |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
717 |
0 | 718 bmp_cfg_db_close(db); |
719 | |
2088 | 720 playlist_save(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]); |
0 | 721 } |
722 | |
723 static void | |
724 bmp_set_default_icon(void) | |
725 { | |
726 GdkPixbuf *icon; | |
727 | |
120 | 728 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) audacious_player_xpm); |
0 | 729 gtk_window_set_default_icon(icon); |
730 g_object_unref(icon); | |
731 } | |
732 | |
733 static void | |
2205
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
734 register_aud_stock_icons(void) |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
735 { |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
736 GtkIconFactory *iconfactory = gtk_icon_factory_new(); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
737 GtkIconSet *iconset; |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
738 GdkPixbuf *pixbuf; |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
739 |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
740 /* pick images in icons-csource.h */ |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
741 pixbuf = gdk_pixbuf_new_from_inline( -1 , removedups_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
742 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
743 gtk_icon_factory_add( iconfactory , AUD_STOCK_REMOVEDUPS , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
744 pixbuf = gdk_pixbuf_new_from_inline( -1 , removeunavail_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
745 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
746 gtk_icon_factory_add( iconfactory , AUD_STOCK_REMOVEUNAVAIL , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
747 pixbuf = gdk_pixbuf_new_from_inline( -1 , randomizepl_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
748 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
749 gtk_icon_factory_add( iconfactory , AUD_STOCK_RANDOMIZEPL , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
750 pixbuf = gdk_pixbuf_new_from_inline( -1 , sortbytitle_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
751 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
752 gtk_icon_factory_add( iconfactory , AUD_STOCK_SORTBYTITLE , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
753 pixbuf = gdk_pixbuf_new_from_inline( -1 , sortbyfilename_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
754 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
755 gtk_icon_factory_add( iconfactory , AUD_STOCK_SORTBYFILENAME , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
756 pixbuf = gdk_pixbuf_new_from_inline( -1 , sortbyartist_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
757 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
758 gtk_icon_factory_add( iconfactory , AUD_STOCK_SORTBYARTIST , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
759 pixbuf = gdk_pixbuf_new_from_inline( -1 , sortbypathfile_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
760 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
761 gtk_icon_factory_add( iconfactory , AUD_STOCK_SORTBYPATHFILE , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
762 pixbuf = gdk_pixbuf_new_from_inline( -1 , selectnone_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
763 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
764 gtk_icon_factory_add( iconfactory , AUD_STOCK_SELECTNONE , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
765 pixbuf = gdk_pixbuf_new_from_inline( -1 , selectall_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
766 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
767 gtk_icon_factory_add( iconfactory , AUD_STOCK_SELECTALL , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
768 pixbuf = gdk_pixbuf_new_from_inline( -1 , selectinvert_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
769 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
770 gtk_icon_factory_add( iconfactory , AUD_STOCK_SELECTINVERT , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
771 pixbuf = gdk_pixbuf_new_from_inline( -1 , invertpl_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
772 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
773 gtk_icon_factory_add( iconfactory , AUD_STOCK_INVERTPL , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
774 pixbuf = gdk_pixbuf_new_from_inline( -1 , queuetoggle_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
775 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
776 gtk_icon_factory_add( iconfactory , AUD_STOCK_QUEUETOGGLE , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
777 pixbuf = gdk_pixbuf_new_from_inline( -1 , info_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
778 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
779 gtk_icon_factory_add( iconfactory , AUD_STOCK_INFO , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
780 pixbuf = gdk_pixbuf_new_from_inline( -1 , playlist_pixbuf , FALSE , NULL ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
781 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
782 gtk_icon_factory_add( iconfactory , AUD_STOCK_PLAYLIST , iconset ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
783 |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
784 gtk_icon_factory_add_default( iconfactory ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
785 g_object_unref( iconfactory ); |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
786 } |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
787 |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
788 static void |
0 | 789 display_usage(void) |
790 { | |
44 | 791 g_print(_("Usage: audacious [options] [files] ...\n\n" |
0 | 792 "Options:\n" |
793 "--------\n")); | |
794 g_print("\n-h, --help "); | |
795 /* -h, --help switch */ | |
796 g_print(_("Display this text and exit")); | |
797 g_print("\n-n, --session "); | |
798 /* -n, --session switch */ | |
257
256b3acc87d4
[svn] Properly report Audacious instead of XMMS or BMP in all places. Patch by laci; closes bug #379.
chainsaw
parents:
216
diff
changeset
|
799 g_print(_("Select Audacious/BMP/XMMS session (Default: 0)")); |
0 | 800 g_print("\n-r, --rew "); |
801 /* -r, --rew switch */ | |
802 g_print(_("Skip backwards in playlist")); | |
803 g_print("\n-p, --play "); | |
804 /* -p, --play switch */ | |
805 g_print(_("Start playing current playlist")); | |
806 g_print("\n-u, --pause "); | |
807 /* -u, --pause switch */ | |
808 g_print(_("Pause current song")); | |
809 g_print("\n-s, --stop "); | |
810 /* -s, --stop switch */ | |
811 g_print(_("Stop current song")); | |
812 g_print("\n-t, --play-pause "); | |
813 /* -t, --play-pause switch */ | |
814 g_print(_("Pause if playing, play otherwise")); | |
815 g_print("\n-f, --fwd "); | |
816 /* -f, --fwd switch */ | |
817 g_print(_("Skip forward in playlist")); | |
1885
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
818 g_print("\n-j, --show-jump-box "); |
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
819 /* -j, --show-jump-box switch */ |
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
820 g_print(_("Display Jump to file dialog")); |
0 | 821 g_print("\n-e, --enqueue "); |
822 /* -e, --enqueue switch */ | |
823 g_print(_("Don't clear the playlist")); | |
824 g_print("\n-m, --show-main-window "); | |
825 /* -m, --show-main-window switch */ | |
826 g_print(_("Show the main window")); | |
827 g_print("\n-a, --activate "); | |
828 /* -a, --activate switch */ | |
257
256b3acc87d4
[svn] Properly report Audacious instead of XMMS or BMP in all places. Patch by laci; closes bug #379.
chainsaw
parents:
216
diff
changeset
|
829 g_print(_("Activate Audacious")); |
0 | 830 g_print("\n-i, --sm-client-id "); |
831 /* -i, --sm-client-id switch */ | |
832 g_print(_("Previous session ID")); | |
316
950f104f2e11
[svn] Fix spacing in --help output, patch by Mikachu.
chainsaw
parents:
284
diff
changeset
|
833 g_print("\n-H, --headless "); |
193 | 834 /* -h, --headless switch */ |
835 g_print(_("Headless operation [experimental]")); | |
1348
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
836 g_print("\n-N, --no-log "); |
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
837 /* -N, --no-log switch */ |
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
838 g_print(_("Disable error/warning interception (logging)")); |
0 | 839 g_print("\n-v, --version "); |
840 /* -v, --version switch */ | |
841 g_print(_("Print version number and exit\n")); | |
842 | |
843 exit(EXIT_SUCCESS); | |
844 } | |
845 | |
846 static void | |
847 parse_cmd_line(gint argc, | |
848 gchar ** argv, | |
849 BmpCmdLineOpt * options) | |
850 { | |
851 static struct option long_options[] = { | |
852 {"help", 0, NULL, 'h'}, | |
853 {"session", 1, NULL, 'n'}, | |
854 {"rew", 0, NULL, 'r'}, | |
855 {"play", 0, NULL, 'p'}, | |
856 {"pause", 0, NULL, 'u'}, | |
857 {"play-pause", 0, NULL, 't'}, | |
858 {"stop", 0, NULL, 's'}, | |
859 {"fwd", 0, NULL, 'f'}, | |
1885
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
860 {"show-jump-box", 0, NULL, 'j'}, |
0 | 861 {"enqueue", 0, NULL, 'e'}, |
2127
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
862 {"enqueue-to-temp", 0, NULL, 'E'}, |
0 | 863 {"show-main-window", 0, NULL, 'm'}, |
864 {"activate", 0, NULL, 'a'}, | |
865 {"version", 0, NULL, 'v'}, | |
866 {"sm-client-id", 1, NULL, 'i'}, | |
867 {"xmms", 0, NULL, 'x'}, | |
191 | 868 {"headless", 0, NULL, 'H'}, |
1348
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
869 {"no-log", 0, NULL, 'N'}, |
0 | 870 {0, 0, 0, 0} |
871 }; | |
872 | |
873 gchar *filename, *current_dir; | |
874 gint c, i; | |
875 | |
876 memset(options, 0, sizeof(BmpCmdLineOpt)); | |
877 options->session = -1; | |
878 | |
2127
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
879 while ((c = getopt_long(argc, argv, "chn:HrpusfemavtLSjE", long_options, |
0 | 880 NULL)) != -1) { |
881 switch (c) { | |
882 case 'h': | |
883 display_usage(); | |
884 break; | |
885 case 'n': | |
886 options->session = atoi(optarg); | |
887 break; | |
191 | 888 case 'H': |
889 options->headless = TRUE; | |
890 break; | |
0 | 891 case 'r': |
892 options->rew = TRUE; | |
893 break; | |
894 case 'p': | |
895 options->play = TRUE; | |
896 break; | |
897 case 'u': | |
898 options->pause = TRUE; | |
899 break; | |
900 case 's': | |
901 options->stop = TRUE; | |
902 break; | |
903 case 'f': | |
904 options->fwd = TRUE; | |
905 break; | |
906 case 't': | |
907 options->play_pause = TRUE; | |
908 break; | |
1885
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
909 case 'j': |
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
910 options->show_jump_box = TRUE; |
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
911 break; |
0 | 912 case 'm': |
913 options->mainwin = TRUE; | |
914 break; | |
915 case 'a': | |
916 options->activate = TRUE; | |
917 break; | |
2127
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
918 case 'E': |
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
919 options->enqueue_to_temp = TRUE; |
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
920 break; |
0 | 921 case 'e': |
922 options->enqueue = TRUE; | |
923 break; | |
924 case 'v': | |
925 dump_version(); | |
926 exit(EXIT_SUCCESS); | |
927 break; | |
928 case 'i': | |
929 options->previous_session_id = g_strdup(optarg); | |
930 break; | |
931 case 'c': | |
932 options->playcd = TRUE; | |
933 break; | |
934 case 'S': | |
935 options->load_skins = TRUE; | |
936 break; | |
1348
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
937 case 'N': |
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
938 options->no_log = TRUE; |
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
939 break; |
0 | 940 } |
941 } | |
942 | |
943 current_dir = g_get_current_dir(); | |
944 | |
945 for (i = optind; i < argc; i++) { | |
946 if (argv[i][0] == '/' || strstr(argv[i], "://")) | |
947 filename = g_strdup(argv[i]); | |
948 else | |
949 filename = g_build_filename(current_dir, argv[i], NULL); | |
950 | |
951 options->filenames = g_list_prepend(options->filenames, filename); | |
952 } | |
953 | |
954 options->filenames = g_list_reverse(options->filenames); | |
955 | |
956 g_free(current_dir); | |
957 } | |
958 | |
959 static void | |
960 handle_cmd_line_options(BmpCmdLineOpt * options, | |
961 gboolean remote) | |
962 { | |
963 GList *filenames = options->filenames; | |
964 gint session = options->session; | |
965 | |
966 if (session == -1) { | |
967 if (!remote) | |
968 session = ctrlsocket_get_session_id(); | |
969 else | |
970 session = 0; | |
971 } | |
972 | |
973 if (filenames) { | |
974 gint pos = 0; | |
975 | |
976 if (options->load_skins) { | |
977 xmms_remote_set_skin(session, filenames->data); | |
978 skin_install_skin(filenames->data); | |
979 } | |
980 else { | |
2127
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
981 if (options->enqueue_to_temp) |
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
982 xmms_remote_playlist_enqueue_to_temp(session, filenames->data); |
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
983 |
0 | 984 if (options->enqueue && options->play) |
985 pos = xmms_remote_get_playlist_length(session); | |
986 | |
987 if (!options->enqueue) | |
988 xmms_remote_playlist_clear(session); | |
989 | |
990 xmms_remote_playlist_add(session, filenames); | |
991 | |
992 if (options->enqueue && options->play && | |
993 xmms_remote_get_playlist_length(session) > pos) | |
994 xmms_remote_set_playlist_pos(session, pos); | |
995 | |
996 if (!options->enqueue) | |
997 xmms_remote_play(session); | |
998 } | |
999 | |
1000 g_list_foreach(filenames, (GFunc) g_free, NULL); | |
1001 g_list_free(filenames); | |
1002 } | |
1003 | |
1004 if (options->rew) | |
1005 xmms_remote_playlist_prev(session); | |
1006 | |
1007 if (options->play) | |
1008 xmms_remote_play(session); | |
1009 | |
1010 if (options->pause) | |
1011 xmms_remote_pause(session); | |
1012 | |
1013 if (options->stop) | |
1014 xmms_remote_stop(session); | |
1015 | |
1016 if (options->fwd) | |
1017 xmms_remote_playlist_next(session); | |
1018 | |
1019 if (options->play_pause) | |
1020 xmms_remote_play_pause(session); | |
1021 | |
1885
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
1022 if (options->show_jump_box) |
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
1023 xmms_remote_show_jtf_box(session); |
1cd683dd944e
[svn] Jump to track window shown when calling audacious with the -j option. Patch by Henrik Johansson <henrik_johansson@home.se>, submitted as Gentoo bug #151260.
chainsaw
parents:
1884
diff
changeset
|
1024 |
0 | 1025 if (options->mainwin) |
1026 xmms_remote_main_win_toggle(session, TRUE); | |
1027 | |
1028 if (options->activate) | |
1029 xmms_remote_activate(session); | |
1030 | |
1031 if (options->playcd) | |
1032 play_medium(); | |
1033 } | |
1034 | |
1035 static void | |
1036 bmp_setup_logger(void) | |
1037 { | |
1038 if (!bmp_logger_start(bmp_paths[BMP_PATH_LOG_FILE])) | |
1039 return; | |
1040 | |
1041 g_atexit(bmp_logger_stop); | |
1042 } | |
1043 | |
1044 static void | |
1045 run_load_skin_error_dialog(const gchar * skin_path) | |
1046 { | |
1047 const gchar *markup = | |
1048 N_("<b><big>Unable to load skin.</big></b>\n" | |
1049 "\n" | |
1050 "Check that skin at '%s' is usable and default skin is properly " | |
1051 "installed at '%s'\n"); | |
1052 | |
1053 GtkWidget *dialog = | |
1054 gtk_message_dialog_new_with_markup(NULL, | |
1055 GTK_DIALOG_MODAL, | |
1056 GTK_MESSAGE_ERROR, | |
1057 GTK_BUTTONS_CLOSE, | |
1058 _(markup), | |
1059 skin_path, | |
1060 BMP_DEFAULT_SKIN_PATH); | |
1061 gtk_dialog_run(GTK_DIALOG(dialog)); | |
1062 gtk_widget_destroy(dialog); | |
1063 } | |
1064 | |
781
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1065 // use a format string? |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1066 void report_error(const gchar *error_text) |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1067 { |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1068 fprintf(stderr,error_text); |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1069 if (options.headless!=1) { |
813
c8cf439179b8
[svn] - Fix a ton and a half of memory leaks, via the wonderful Leonardo Boshell <leonardop -at- gentoo.org>.
nenolod
parents:
781
diff
changeset
|
1070 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(err), |
c8cf439179b8
[svn] - Fix a ton and a half of memory leaks, via the wonderful Leonardo Boshell <leonardop -at- gentoo.org>.
nenolod
parents:
781
diff
changeset
|
1071 error_text); |
781
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1072 gtk_dialog_run(GTK_DIALOG(err)); |
813
c8cf439179b8
[svn] - Fix a ton and a half of memory leaks, via the wonderful Leonardo Boshell <leonardop -at- gentoo.org>.
nenolod
parents:
781
diff
changeset
|
1073 gtk_widget_hide(err); |
781
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1074 } |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1075 } |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1076 |
0 | 1077 gint |
1078 main(gint argc, gchar ** argv) | |
1079 { | |
44 | 1080 gboolean gtk_init_check_ok; |
2088 | 1081 Playlist *playlist; |
0 | 1082 |
1083 /* Setup l10n early so we can print localized error messages */ | |
1084 gtk_set_locale(); | |
749 | 1085 bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
1086 bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); | |
1087 textdomain(PACKAGE_NAME); | |
0 | 1088 |
1089 bmp_init_paths(); | |
1090 bmp_make_user_dir(); | |
1091 | |
1092 /* Check GTK version. Really, this is only needed for binary | |
1093 * distribution since configure already checks. */ | |
680
8282b365f6cb
[svn] - Add some sanity checking to make sure we can't do X11 stuff when running headless.
nenolod
parents:
625
diff
changeset
|
1094 if (!GTK_CHECK_VERSION(2, 6, 0)) { |
257
256b3acc87d4
[svn] Properly report Audacious instead of XMMS or BMP in all places. Patch by laci; closes bug #379.
chainsaw
parents:
216
diff
changeset
|
1095 g_printerr(_("Sorry, your GTK+ version (%d.%d.%d) does not work with Audacious.\n" |
0 | 1096 "Please use GTK+ %s or newer.\n"), |
1097 gtk_major_version, gtk_minor_version, gtk_micro_version, | |
680
8282b365f6cb
[svn] - Add some sanity checking to make sure we can't do X11 stuff when running headless.
nenolod
parents:
625
diff
changeset
|
1098 "2.6.0"); |
0 | 1099 exit(EXIT_FAILURE); |
1100 } | |
1101 | |
1102 g_set_application_name(_(application_name)); | |
1103 | |
1104 g_thread_init(NULL); | |
1105 if (!g_thread_supported()) { | |
1106 g_printerr(_("Sorry, threads isn't supported on your platform.\n\n" | |
1107 "If you're on a libc5 based linux system and installed Glib & GTK+ before you\n" | |
1108 "installed LinuxThreads you need to recompile Glib & GTK+.\n")); | |
1109 exit(EXIT_FAILURE); | |
1110 } | |
1111 | |
1112 gdk_threads_init(); | |
1113 | |
2026 | 1114 cond_scan = g_cond_new(); |
1115 mutex_scan = g_mutex_new(); | |
1116 | |
44 | 1117 gtk_init_check_ok = gtk_init_check(&argc, &argv); |
1118 /* Now let's parse the command line options first. */ | |
1119 parse_cmd_line(argc, argv, &options); | |
1120 if (!gtk_init_check_ok) { | |
0 | 1121 if (argc < 2) { |
1122 /* GTK check failed, and no arguments passed to indicate | |
1123 that user is intending to only remote control a running | |
1124 session */ | |
44 | 1125 g_printerr(_("audacious: Unable to open display, exiting.\n")); |
0 | 1126 exit(EXIT_FAILURE); |
1127 } | |
1128 | |
1129 handle_cmd_line_options(&options, TRUE); | |
191 | 1130 |
1131 /* we could be running headless, so GTK probably wont matter */ | |
1132 if (options.headless != 1) | |
1133 exit(EXIT_SUCCESS); | |
0 | 1134 } |
1135 | |
1348
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
1136 if (options.no_log == FALSE) |
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
1137 bmp_setup_logger(); |
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
1138 |
2156
a792aaee8e8e
[svn] - new signal handling which does not block (based on concept from BMP 0.9.8 that never got released)
nenolod
parents:
2146
diff
changeset
|
1139 signal_handlers_init(); |
0 | 1140 |
1141 g_random_set_seed(time(NULL)); | |
1142 | |
1143 bmp_config_load(); | |
1144 | |
1145 if (options.session != -1 || !ctrlsocket_setup()) { | |
1146 handle_cmd_line_options(&options, TRUE); | |
1147 exit(EXIT_SUCCESS); | |
1148 } | |
1149 | |
2003
74f280120233
[svn] - init plugins before initalizing the skin system.
nenolod
parents:
2000
diff
changeset
|
1150 plugin_system_init(); |
74f280120233
[svn] - init plugins before initalizing the skin system.
nenolod
parents:
2000
diff
changeset
|
1151 |
2120
1d67cf383e32
[svn] - dynamically allocate the playlist at startup and fix some lingering improper uses of playlist_get()
nenolod
parents:
2113
diff
changeset
|
1152 /* Initialize the playlist system. */ |
1d67cf383e32
[svn] - dynamically allocate the playlist at startup and fix some lingering improper uses of playlist_get()
nenolod
parents:
2113
diff
changeset
|
1153 playlist_init(); |
1d67cf383e32
[svn] - dynamically allocate the playlist at startup and fix some lingering improper uses of playlist_get()
nenolod
parents:
2113
diff
changeset
|
1154 |
191 | 1155 if (options.headless != 1) |
1156 { | |
2205
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
1157 /* register icons in stock */ |
cc6a05baa156
[svn] - added audacious stock icons; source files wanting to use them must include icons-stock.h; removed obsolete pixmaps.h
giacomo
parents:
2203
diff
changeset
|
1158 register_aud_stock_icons(); |
781
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1159 |
191 | 1160 bmp_set_default_icon(); |
0 | 1161 |
191 | 1162 gtk_accel_map_load(bmp_paths[BMP_PATH_ACCEL_FILE]); |
0 | 1163 |
1810 | 1164 if (!init_skins(cfg.skin)) { |
1165 run_load_skin_error_dialog(cfg.skin); | |
1166 exit(EXIT_FAILURE); | |
1167 } | |
1168 | |
191 | 1169 GDK_THREADS_ENTER(); |
0 | 1170 } |
1171 | |
2120
1d67cf383e32
[svn] - dynamically allocate the playlist at startup and fix some lingering improper uses of playlist_get()
nenolod
parents:
2113
diff
changeset
|
1172 /* Load the default playlist in. */ |
2088 | 1173 playlist = playlist_get_active(); |
1174 playlist_load(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]); | |
1175 playlist_set_position(playlist, cfg.playlist_position); | |
0 | 1176 |
1177 /* this needs to be called after all 3 windows are created and | |
191 | 1178 * input plugins are setup'ed |
1179 * but not if we're running headless --nenolod | |
1180 */ | |
0 | 1181 mainwin_setup_menus(); |
1182 | |
191 | 1183 if (options.headless != 1) |
1184 GDK_THREADS_LEAVE(); | |
0 | 1185 |
1186 ctrlsocket_start(); | |
1187 | |
1188 handle_cmd_line_options(&options, FALSE); | |
1189 | |
191 | 1190 if (options.headless != 1) |
1191 { | |
1192 GDK_THREADS_ENTER(); | |
0 | 1193 |
191 | 1194 read_volume(VOLSET_STARTUP); |
1195 mainwin_set_info_text(); | |
1196 | |
1197 /* FIXME: delayed, because it deals directly with the plugin | |
1198 * interface to set menu items */ | |
1199 create_prefs_window(); | |
0 | 1200 |
1264 | 1201 create_fileinfo_window(); |
1283
19b1d3f22e10
[svn] - when hovering over a playlist tuple, describe the tuple via a tooltip-like popup
nenolod
parents:
1264
diff
changeset
|
1202 create_filepopup_window(); |
1264 | 1203 |
191 | 1204 if (cfg.player_visible) |
1205 mainwin_show(TRUE); | |
1206 else if (!cfg.playlist_visible && !cfg.equalizer_visible) | |
1207 mainwin_show(TRUE); | |
125 | 1208 |
191 | 1209 if (cfg.equalizer_visible) |
1210 equalizerwin_show(TRUE); | |
1211 | |
1212 if (cfg.playlist_visible) | |
1213 playlistwin_show(); | |
0 | 1214 |
191 | 1215 hint_set_always(cfg.always_on_top); |
0 | 1216 |
191 | 1217 playlist_start_get_info_thread(); |
1218 mainwin_attach_idle_func(); | |
1219 | |
486 | 1220 starting_up = FALSE; |
1221 | |
680
8282b365f6cb
[svn] - Add some sanity checking to make sure we can't do X11 stuff when running headless.
nenolod
parents:
625
diff
changeset
|
1222 has_x11_connection = TRUE; |
8282b365f6cb
[svn] - Add some sanity checking to make sure we can't do X11 stuff when running headless.
nenolod
parents:
625
diff
changeset
|
1223 |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
1224 if (cfg.resume_playback_on_startup) { |
2088 | 1225 if (cfg.resume_playback_on_startup_time != -1 && playlist_get_length(playlist) > 0) { |
1659
eeaf62b288a3
[svn] Make the playback resume code a lot more robust.
chainsaw
parents:
1653
diff
changeset
|
1226 int i; |
1753
01df1ea5feae
[svn] Mute while seeking for playback resume, tighten the loop. We want a responsive GUI ASAP.
chainsaw
parents:
1710
diff
changeset
|
1227 gint l=0, r=0; |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
1228 while (gtk_events_pending()) gtk_main_iteration(); |
1753
01df1ea5feae
[svn] Mute while seeking for playback resume, tighten the loop. We want a responsive GUI ASAP.
chainsaw
parents:
1710
diff
changeset
|
1229 output_get_volume(&l, &r); |
01df1ea5feae
[svn] Mute while seeking for playback resume, tighten the loop. We want a responsive GUI ASAP.
chainsaw
parents:
1710
diff
changeset
|
1230 output_set_volume(0,0); |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
1231 bmp_playback_initiate(); |
1966
fcf3900d05b9
[svn] - temporarily display the newui at startup along with the oldui
nenolod
parents:
1959
diff
changeset
|
1232 |
fcf3900d05b9
[svn] - temporarily display the newui at startup along with the oldui
nenolod
parents:
1959
diff
changeset
|
1233 /* Busy wait; loop is fairly tight to minimize duration of "frozen" GUI. Feel free to |
fcf3900d05b9
[svn] - temporarily display the newui at startup along with the oldui
nenolod
parents:
1959
diff
changeset
|
1234 * tune. --chainsaw |
fcf3900d05b9
[svn] - temporarily display the newui at startup along with the oldui
nenolod
parents:
1959
diff
changeset
|
1235 */ |
fcf3900d05b9
[svn] - temporarily display the newui at startup along with the oldui
nenolod
parents:
1959
diff
changeset
|
1236 for (i = 0; i < 20; i++) { |
1753
01df1ea5feae
[svn] Mute while seeking for playback resume, tighten the loop. We want a responsive GUI ASAP.
chainsaw
parents:
1710
diff
changeset
|
1237 g_usleep(1000); |
1659
eeaf62b288a3
[svn] Make the playback resume code a lot more robust.
chainsaw
parents:
1653
diff
changeset
|
1238 if (!ip_data.playing) |
eeaf62b288a3
[svn] Make the playback resume code a lot more robust.
chainsaw
parents:
1653
diff
changeset
|
1239 break; |
eeaf62b288a3
[svn] Make the playback resume code a lot more robust.
chainsaw
parents:
1653
diff
changeset
|
1240 } |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
1241 bmp_playback_seek(cfg.resume_playback_on_startup_time / |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
1242 1000); |
1753
01df1ea5feae
[svn] Mute while seeking for playback resume, tighten the loop. We want a responsive GUI ASAP.
chainsaw
parents:
1710
diff
changeset
|
1243 output_set_volume(l, r); |
998
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
1244 } |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
1245 } |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
1246 |
191 | 1247 gtk_main(); |
1248 | |
1249 GDK_THREADS_LEAVE(); | |
0 | 1250 |
2026 | 1251 g_cond_free(cond_scan); |
1252 g_mutex_free(mutex_scan); | |
1253 | |
191 | 1254 return EXIT_SUCCESS; |
1255 } | |
1256 else | |
1257 { | |
1258 mainwin_set_info_text(); | |
1259 playlist_start_get_info_thread(); | |
0 | 1260 |
486 | 1261 starting_up = FALSE; |
1262 | |
191 | 1263 for (;;) |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
191
diff
changeset
|
1264 { |
197
ccd034857702
[svn] Split up generic events into audcore_generic_events(), and client-specific stuff remains in mainwin_idle_func().
nenolod
parents:
196
diff
changeset
|
1265 /* headless eventloop */ |
ccd034857702
[svn] Split up generic events into audcore_generic_events(), and client-specific stuff remains in mainwin_idle_func().
nenolod
parents:
196
diff
changeset
|
1266 audcore_generic_events(); |
198 | 1267 free_vis_data(); /* to prevent buffer overflow -- paranoia */ |
191 | 1268 xmms_usleep(10000); |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
191
diff
changeset
|
1269 } |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
191
diff
changeset
|
1270 |
191 | 1271 return EXIT_SUCCESS; |
1272 } | |
0 | 1273 } |