Mercurial > audlegacy
annotate audacious/main.c @ 2228:894f7aa46f83 trunk
[svn] - bmp_playback_* -> playback_* -- i knew something smelled rotten here, hmm.
author | nenolod |
---|---|
date | Sun, 31 Dec 2006 19:57:29 -0800 |
parents | 4de6e7d138c6 |
children | ac2ea05e60a0 |
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 */ |
2222 | 214 FALSE, /* internal: whether or not to terminate */ |
0 | 215 }; |
216 | |
217 typedef struct bmp_cfg_boolent_t { | |
218 char const *be_vname; | |
219 gboolean *be_vloc; | |
220 gboolean be_wrt; | |
221 } bmp_cfg_boolent; | |
222 | |
223 typedef struct bmp_cfg_nument_t { | |
224 char const *ie_vname; | |
225 gint *ie_vloc; | |
226 gboolean ie_wrt; | |
227 } bmp_cfg_nument; | |
228 | |
229 typedef struct bmp_cfg_strent_t { | |
230 char const *se_vname; | |
231 char **se_vloc; | |
232 gboolean se_wrt; | |
233 } bmp_cfg_strent; | |
234 | |
235 const gchar *bmp_titlestring_presets[] = { | |
236 "%t", | |
946
8cfe13fcd0c7
[svn] - Forgot a few things regarding titlestrings!
nhjm449
parents:
943
diff
changeset
|
237 "%{p:%p - %}%t", |
8cfe13fcd0c7
[svn] - Forgot a few things regarding titlestrings!
nhjm449
parents:
943
diff
changeset
|
238 "%{p:%p - %}%{a:%a - %}%t", |
943 | 239 "%{p:%p - %}%{a:%a - %}%{n:%n. %}%t", |
240 "%{p:%p %}%{a:[ %a ] %}%{p:- %}%{n:%n. %}%{t:%t%}", | |
946
8cfe13fcd0c7
[svn] - Forgot a few things regarding titlestrings!
nhjm449
parents:
943
diff
changeset
|
241 "%{a:%a - %}%t" |
0 | 242 }; |
243 | |
244 const guint n_titlestring_presets = G_N_ELEMENTS(bmp_titlestring_presets); | |
245 | |
1105
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
246 const gchar *chardet_detector_presets[] = { |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
247 "None", |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
248 "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
|
249 "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
|
250 "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
|
251 "Korean", |
1613
9becbe564217
[svn] - chardet patch for Russian language witten by Valentine Sinitsyn.
yaz
parents:
1595
diff
changeset
|
252 "Russian", |
1105
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
253 #ifdef HAVE_UDET |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
254 "Universal" |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
255 #endif |
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 |
4be4d74db123
[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents:
1068
diff
changeset
|
258 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
|
259 |
0 | 260 static bmp_cfg_boolent bmp_boolents[] = { |
261 {"allow_multiple_instances", &cfg.allow_multiple_instances, TRUE}, | |
262 {"use_realtime", &cfg.use_realtime, TRUE}, | |
263 {"always_show_cb", &cfg.always_show_cb, TRUE}, | |
264 {"convert_underscore", &cfg.convert_underscore, TRUE}, | |
265 {"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
|
266 {"convert_slash", &cfg.convert_slash, TRUE }, |
0 | 267 {"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
|
268 {"show_separator_in_pl", &cfg.show_separator_in_pl, TRUE}, |
0 | 269 {"snap_windows", &cfg.snap_windows, TRUE}, |
270 {"save_window_positions", &cfg.save_window_position, TRUE}, | |
271 {"dim_titlebar", &cfg.dim_titlebar, TRUE}, | |
272 {"get_info_on_load", &cfg.get_info_on_load, TRUE}, | |
273 {"get_info_on_demand", &cfg.get_info_on_demand, TRUE}, | |
1938 | 274 {"eq_doublesize_linked", &cfg.eq_doublesize_linked, TRUE}, |
0 | 275 {"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
|
276 {"refresh_file_list", &cfg.refresh_file_list, TRUE}, |
0 | 277 {"sort_jump_to_file", &cfg.sort_jump_to_file, TRUE}, |
278 {"use_pl_metadata", &cfg.use_pl_metadata, TRUE}, | |
279 {"warn_about_unplayables", &cfg.warn_about_unplayables, TRUE}, | |
280 {"use_backslash_as_dir_delimiter", &cfg.use_backslash_as_dir_delimiter, TRUE}, | |
281 {"player_shaded", &cfg.player_shaded, TRUE}, | |
282 {"player_visible", &cfg.player_visible, TRUE}, | |
283 {"shuffle", &cfg.shuffle, TRUE}, | |
284 {"repeat", &cfg.repeat, TRUE}, | |
1938 | 285 {"doublesize", &cfg.doublesize, TRUE}, |
0 | 286 {"autoscroll_songname", &cfg.autoscroll, TRUE}, |
898 | 287 {"stop_after_current_song", &cfg.stopaftersong, TRUE}, |
0 | 288 {"playlist_shaded", &cfg.playlist_shaded, TRUE}, |
289 {"playlist_visible", &cfg.playlist_visible, TRUE}, | |
290 {"playlist_transparent", &cfg.playlist_transparent, TRUE}, | |
291 {"use_fontsets", &cfg.use_fontsets, TRUE}, | |
85
8c8a20f72ace
[svn] s/static GTKItemFactoryEntry/GTKItemFactoryEntry/g.
nenolod
parents:
80
diff
changeset
|
292 {"mainwin_use_xfont", &cfg.mainwin_use_xfont, FALSE}, |
0 | 293 {"equalizer_visible", &cfg.equalizer_visible, TRUE}, |
294 {"equalizer_active", &cfg.equalizer_active, TRUE}, | |
295 {"equalizer_shaded", &cfg.equalizer_shaded, TRUE}, | |
296 {"equalizer_autoload", &cfg.equalizer_autoload, TRUE}, | |
1938 | 297 {"easy_move", &cfg.easy_move, TRUE}, |
0 | 298 {"use_eplugins", &cfg.use_eplugins, TRUE}, |
299 {"always_on_top", &cfg.always_on_top, TRUE}, | |
300 {"sticky", &cfg.sticky, TRUE}, | |
301 {"random_skin_on_play", &cfg.random_skin_on_play, TRUE}, | |
302 {"pause_between_songs", &cfg.pause_between_songs, TRUE}, | |
303 {"show_wm_decorations", &cfg.show_wm_decorations, TRUE}, | |
304 {"eq_extra_filtering", &cfg.eq_extra_filtering, TRUE}, | |
305 {"analyzer_peaks", &cfg.analyzer_peaks, TRUE}, | |
306 {"custom_cursors", &cfg.custom_cursors, TRUE}, | |
307 {"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
|
308 {"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
|
309 {"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
|
310 {"playlist_detect", &cfg.playlist_detect, TRUE}, |
1358 | 311 {"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
|
312 {"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
|
313 {"use_file_cover", &cfg.use_file_cover, TRUE}, |
1905
6b4116c34489
[svn] - change "Transparency" to "Miscillaneous UI Features" in prefswin
nenolod
parents:
1904
diff
changeset
|
314 {"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
|
315 {"use_extension_probing", &cfg.use_extension_probing, TRUE}, |
0 | 316 }; |
317 | |
318 static gint ncfgbent = G_N_ELEMENTS(bmp_boolents); | |
319 | |
320 static bmp_cfg_nument bmp_numents[] = { | |
321 {"player_x", &cfg.player_x, TRUE}, | |
322 {"player_y", &cfg.player_y, TRUE}, | |
323 {"timer_mode", &cfg.timer_mode, TRUE}, | |
324 {"vis_type", &cfg.vis_type, TRUE}, | |
325 {"analyzer_mode", &cfg.analyzer_mode, TRUE}, | |
326 {"analyzer_type", &cfg.analyzer_type, TRUE}, | |
327 {"scope_mode", &cfg.scope_mode, TRUE}, | |
328 {"vu_mode", &cfg.vu_mode, TRUE}, | |
2203
60bd49189fde
[svn] - two realcolour modes for voiceprint vis: Fire and Ice
marvin
parents:
2186
diff
changeset
|
329 {"voiceprint_mode", &cfg.voiceprint_mode, TRUE}, |
0 | 330 {"vis_refresh_rate", &cfg.vis_refresh, TRUE}, |
331 {"analyzer_falloff", &cfg.analyzer_falloff, TRUE}, | |
332 {"peaks_falloff", &cfg.peaks_falloff, TRUE}, | |
333 {"playlist_x", &cfg.playlist_x, TRUE}, | |
334 {"playlist_y", &cfg.playlist_y, TRUE}, | |
335 {"playlist_width", &cfg.playlist_width, TRUE}, | |
336 {"playlist_height", &cfg.playlist_height, TRUE}, | |
337 {"playlist_position", &cfg.playlist_position, TRUE}, | |
338 {"equalizer_x", &cfg.equalizer_x, TRUE}, | |
339 {"equalizer_y", &cfg.equalizer_y, TRUE}, | |
340 {"snap_distance", &cfg.snap_distance, TRUE}, | |
341 {"pause_between_songs_time", &cfg.pause_between_songs_time, TRUE}, | |
342 {"mouse_wheel_change", &cfg.mouse_change, TRUE}, | |
343 {"scroll_pl_by", &cfg.scroll_pl_by, TRUE}, | |
344 {"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
|
345 {"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
|
346 {"output_buffer_size", &cfg.output_buffer_size, TRUE}, |
1710 | 347 {"recurse_for_cover_depth", &cfg.recurse_for_cover_depth, TRUE}, |
348 {"filepopup_pixelsize", &cfg.filepopup_pixelsize, TRUE}, | |
349 {"filepopup_delay", &cfg.filepopup_delay, TRUE}, | |
2186 | 350 {"colorize_r", &cfg.colorize_r, TRUE}, |
351 {"colorize_g", &cfg.colorize_g, TRUE}, | |
352 {"colorize_b", &cfg.colorize_b, TRUE}, | |
0 | 353 }; |
354 | |
355 static gint ncfgient = G_N_ELEMENTS(bmp_numents); | |
356 | |
357 static bmp_cfg_strent bmp_strents[] = { | |
358 {"playlist_font", &cfg.playlist_font, TRUE}, | |
359 {"mainwin_font", &cfg.mainwin_font, TRUE}, | |
360 {"eqpreset_default_file", &cfg.eqpreset_default_file, TRUE}, | |
361 {"eqpreset_extension", &cfg.eqpreset_extension, TRUE}, | |
362 {"skin", &cfg.skin, FALSE}, | |
363 {"output_plugin", &cfg.outputplugin, FALSE}, | |
364 {"disabled_iplugins", &cfg.disabled_iplugins, TRUE}, | |
365 {"enabled_gplugins", &cfg.enabled_gplugins, FALSE}, | |
366 {"enabled_vplugins", &cfg.enabled_vplugins, FALSE}, | |
367 {"enabled_eplugins", &cfg.enabled_eplugins, FALSE}, | |
368 {"filesel_path", &cfg.filesel_path, FALSE}, | |
369 {"playlist_path", &cfg.playlist_path, FALSE}, | |
370 {"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
|
371 {"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
|
372 {"chardet_fallback", &cfg.chardet_fallback, TRUE}, |
1413 | 373 {"cover_name_include", &cfg.cover_name_include, TRUE}, |
374 {"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
|
375 {"session_uri_base", &cfg.session_uri_base, TRUE} |
0 | 376 }; |
377 | |
378 static gint ncfgsent = G_N_ELEMENTS(bmp_strents); | |
379 | |
380 gchar *bmp_paths[BMP_PATH_COUNT] = {}; | |
381 | |
382 GList *dock_window_list = NULL; | |
383 | |
384 gboolean pposition_broken = FALSE; | |
385 | |
486 | 386 gboolean starting_up = TRUE; |
0 | 387 |
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
|
388 /* 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
|
389 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
|
390 PLUGIN_FILENAME("ALSA"), |
1886 | 391 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
|
392 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
|
393 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
|
394 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
|
395 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
|
396 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
|
397 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
|
398 }; |
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
|
399 |
2026 | 400 GCond *cond_scan; |
401 GMutex *mutex_scan; | |
402 | |
0 | 403 static GSList * |
404 get_feature_list(void) | |
405 { | |
406 GSList *features = NULL; | |
407 | |
408 #ifdef HAVE_GCONF | |
409 features = g_slist_append(features, "GConf"); | |
410 #endif | |
411 | |
412 return features; | |
413 } | |
414 | |
415 static void | |
416 dump_version(void) | |
417 { | |
418 GSList *features; | |
419 | |
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
|
420 g_printf("%s %s [%s]", _(application_name), VERSION, svn_stamp); |
0 | 421 |
422 features = get_feature_list(); | |
423 | |
424 if (features) { | |
425 GSList *item; | |
426 | |
427 g_printf(" ("); | |
428 | |
429 for (item = features; g_slist_next(item); item = g_slist_next(item)) | |
430 g_printf("%s, ", (const gchar *) item->data); | |
431 | |
432 g_printf("%s)", (const gchar *) item->data); | |
433 | |
434 g_slist_free(features); | |
435 } | |
436 | |
437 g_printf("\n"); | |
438 } | |
439 | |
440 const gchar * | |
441 xmms_get_gentitle_format(void) | |
442 { | |
625
0a73d1faeb4e
[svn] GCC 4.1 warning fixes by Diego 'Flameeyes' Petteno from Gentoo.
chainsaw
parents:
538
diff
changeset
|
443 guint titlestring_preset = cfg.titlestring_preset; |
0 | 444 |
445 if (titlestring_preset < n_titlestring_presets) | |
446 return bmp_titlestring_presets[titlestring_preset]; | |
447 | |
448 return cfg.gentitle_format; | |
449 } | |
450 | |
887 | 451 void |
0 | 452 make_directory(const gchar * path, mode_t mode) |
453 { | |
454 if (mkdir(path, mode) == 0) | |
455 return; | |
456 | |
457 if (errno == EEXIST) | |
458 return; | |
459 | |
460 g_printerr(_("Could not create directory (%s): %s"), path, | |
461 g_strerror(errno)); | |
462 } | |
463 | |
464 static void | |
465 bmp_make_user_dir(void) | |
466 { | |
467 const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; | |
468 | |
469 make_directory(bmp_paths[BMP_PATH_USER_DIR], mode755); | |
470 make_directory(bmp_paths[BMP_PATH_USER_PLUGIN_DIR], mode755); | |
471 make_directory(bmp_paths[BMP_PATH_USER_SKIN_DIR], mode755); | |
472 make_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR], mode755); | |
473 } | |
474 | |
475 static void | |
476 bmp_free_paths(void) | |
477 { | |
478 int i; | |
479 | |
480 for (i = 0; i < BMP_PATH_COUNT; i++) | |
481 { | |
482 g_free(bmp_paths[i]); | |
483 bmp_paths[i] = 0; | |
484 } | |
485 } | |
486 | |
487 | |
488 #define USER_PATH(path) \ | |
489 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], path, NULL); | |
490 | |
491 static void | |
492 bmp_init_paths(void) | |
493 { | |
734 | 494 bmp_paths[BMP_PATH_USER_DIR] = g_build_filename(g_get_home_dir(), BMP_RCPATH, NULL); |
0 | 495 |
496 bmp_paths[BMP_PATH_USER_PLUGIN_DIR] = USER_PATH(BMP_USER_PLUGIN_DIR_BASENAME); | |
497 bmp_paths[BMP_PATH_USER_SKIN_DIR] = USER_PATH(BMP_SKIN_DIR_BASENAME); | |
498 bmp_paths[BMP_PATH_SKIN_THUMB_DIR] = USER_PATH(BMP_SKIN_THUMB_DIR_BASENAME); | |
499 bmp_paths[BMP_PATH_CONFIG_FILE] = USER_PATH(BMP_CONFIG_BASENAME); | |
500 bmp_paths[BMP_PATH_PLAYLIST_FILE] = USER_PATH(BMP_PLAYLIST_BASENAME); | |
501 bmp_paths[BMP_PATH_ACCEL_FILE] = USER_PATH(BMP_ACCEL_BASENAME); | |
502 bmp_paths[BMP_PATH_LOG_FILE] = USER_PATH(BMP_LOG_BASENAME); | |
503 | |
504 g_atexit(bmp_free_paths); | |
505 } | |
506 | |
507 | |
508 void | |
509 bmp_config_load(void) | |
510 { | |
511 ConfigDb *db; | |
512 gint i, length; | |
513 | |
514 memcpy(&cfg, &bmp_default_config, sizeof(BmpConfig)); | |
515 | |
516 db = bmp_cfg_db_open(); | |
517 for (i = 0; i < ncfgbent; ++i) { | |
518 bmp_cfg_db_get_bool(db, NULL, | |
519 bmp_boolents[i].be_vname, | |
520 bmp_boolents[i].be_vloc); | |
521 } | |
522 | |
523 for (i = 0; i < ncfgient; ++i) { | |
524 bmp_cfg_db_get_int(db, NULL, | |
525 bmp_numents[i].ie_vname, | |
526 bmp_numents[i].ie_vloc); | |
527 } | |
528 | |
529 for (i = 0; i < ncfgsent; ++i) { | |
530 bmp_cfg_db_get_string(db, NULL, | |
531 bmp_strents[i].se_vname, | |
532 bmp_strents[i].se_vloc); | |
533 } | |
534 | |
535 /* Preset */ | |
536 bmp_cfg_db_get_float(db, NULL, "equalizer_preamp", &cfg.equalizer_preamp); | |
537 for (i = 0; i < 10; i++) { | |
538 gchar eqtext[18]; | |
539 | |
540 g_snprintf(eqtext, sizeof(eqtext), "equalizer_band%d", i); | |
541 bmp_cfg_db_get_float(db, NULL, eqtext, &cfg.equalizer_bands[i]); | |
542 } | |
543 | |
544 /* History */ | |
545 if (bmp_cfg_db_get_int(db, NULL, "url_history_length", &length)) { | |
546 for (i = 1; i <= length; i++) { | |
547 gchar str[19], *tmp; | |
548 | |
549 g_snprintf(str, sizeof(str), "url_history%d", i); | |
550 if (bmp_cfg_db_get_string(db, NULL, str, &tmp)) | |
551 cfg.url_history = g_list_append(cfg.url_history, tmp); | |
552 } | |
553 } | |
554 | |
555 bmp_cfg_db_close(db); | |
556 | |
557 | |
558 if (cfg.playlist_font && strlen(cfg.playlist_font) == 0) { | |
559 g_free(cfg.playlist_font); | |
560 cfg.playlist_font = NULL; | |
561 } | |
562 | |
563 if (cfg.mainwin_font && strlen(cfg.mainwin_font) == 0) { | |
564 g_free(cfg.mainwin_font); | |
565 cfg.mainwin_font = NULL; | |
566 } | |
567 | |
568 if (!cfg.playlist_font) | |
1653 | 569 cfg.playlist_font = g_strdup(PLAYLISTWIN_DEFAULT_FONT); |
0 | 570 |
571 if (!cfg.mainwin_font) | |
1653 | 572 cfg.mainwin_font = g_strdup(MAINWIN_DEFAULT_FONT); |
0 | 573 |
574 if (!cfg.gentitle_format) | |
1347
8a874906535b
[svn] - use a more standard-looking default title format
nenolod
parents:
1283
diff
changeset
|
575 cfg.gentitle_format = g_strdup("%{p:%p - %}%{a:%a - %}%t"); |
0 | 576 |
577 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
|
578 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
|
579 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
|
580 |
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 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
|
582 { |
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 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
|
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 |
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
|
586 g_free(pl_path); |
0 | 587 } |
588 | |
589 if (!cfg.eqpreset_default_file) | |
1653 | 590 cfg.eqpreset_default_file = g_strdup(EQUALIZER_DEFAULT_DIR_PRESET); |
0 | 591 |
592 if (!cfg.eqpreset_extension) | |
1653 | 593 cfg.eqpreset_extension = g_strdup(EQUALIZER_DEFAULT_PRESET_EXT); |
1413 | 594 |
1761
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
595 if (!cfg.chardet_fallback) |
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
596 cfg.chardet_fallback = g_strdup(""); |
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
597 |
1413 | 598 if (!cfg.cover_name_include) |
599 cfg.cover_name_include = g_strdup(""); | |
600 | |
601 if (!cfg.cover_name_exclude) | |
602 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
|
603 |
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
604 if (!cfg.session_uri_base) |
70caa62ead63
[svn] - fix for "bmp_rcfile_write_string: assertion `value != NULL' failed"
yaz
parents:
1753
diff
changeset
|
605 cfg.session_uri_base = g_strdup(""); |
0 | 606 } |
607 | |
608 | |
609 void | |
610 bmp_config_save(void) | |
611 { | |
612 GList *node; | |
613 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
|
614 gint i, cur_pb_time; |
0 | 615 ConfigDb *db; |
2088 | 616 Playlist *playlist = playlist_get_active(); |
0 | 617 |
618 cfg.disabled_iplugins = input_stringify_disabled_list(); | |
619 | |
620 | |
621 db = bmp_cfg_db_open(); | |
622 | |
623 for (i = 0; i < ncfgbent; ++i) | |
624 if (bmp_boolents[i].be_wrt) | |
625 bmp_cfg_db_set_bool(db, NULL, | |
626 bmp_boolents[i].be_vname, | |
627 *bmp_boolents[i].be_vloc); | |
628 | |
629 for (i = 0; i < ncfgient; ++i) | |
630 if (bmp_numents[i].ie_wrt) | |
631 bmp_cfg_db_set_int(db, NULL, | |
632 bmp_numents[i].ie_vname, | |
633 *bmp_numents[i].ie_vloc); | |
634 | |
635 /* This is a bit lame .. it'll end up being written twice, | |
636 * could do with being done a bit neater. -larne */ | |
637 bmp_cfg_db_set_int(db, NULL, "playlist_position", | |
2088 | 638 playlist_get_position(playlist)); |
0 | 639 |
207
e152a92d3f45
[svn] Save the preference to enable or disable bitmap fonts.
nenolod
parents:
198
diff
changeset
|
640 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
|
641 cfg.mainwin_use_xfont); |
e152a92d3f45
[svn] Save the preference to enable or disable bitmap fonts.
nenolod
parents:
198
diff
changeset
|
642 |
0 | 643 for (i = 0; i < ncfgsent; ++i) { |
644 if (bmp_strents[i].se_wrt) | |
645 bmp_cfg_db_set_string(db, NULL, | |
646 bmp_strents[i].se_vname, | |
647 *bmp_strents[i].se_vloc); | |
648 } | |
649 | |
650 bmp_cfg_db_set_float(db, NULL, "equalizer_preamp", cfg.equalizer_preamp); | |
651 | |
652 for (i = 0; i < 10; i++) { | |
653 str = g_strdup_printf("equalizer_band%d", i); | |
654 bmp_cfg_db_set_float(db, NULL, str, cfg.equalizer_bands[i]); | |
655 g_free(str); | |
656 } | |
657 | |
196 | 658 if (bmp_active_skin != NULL) |
659 { | |
660 if (bmp_active_skin->path) | |
661 bmp_cfg_db_set_string(db, NULL, "skin", bmp_active_skin->path); | |
662 else | |
663 bmp_cfg_db_unset_key(db, NULL, "skin"); | |
664 } | |
0 | 665 |
666 if (get_current_output_plugin()) | |
667 bmp_cfg_db_set_string(db, NULL, "output_plugin", | |
668 get_current_output_plugin()->filename); | |
669 else | |
670 bmp_cfg_db_unset_key(db, NULL, "output_plugin"); | |
671 | |
672 str = general_stringify_enabled_list(); | |
673 if (str) { | |
674 bmp_cfg_db_set_string(db, NULL, "enabled_gplugins", str); | |
675 g_free(str); | |
676 } | |
677 else | |
678 bmp_cfg_db_unset_key(db, NULL, "enabled_gplugins"); | |
679 | |
680 str = vis_stringify_enabled_list(); | |
681 if (str) { | |
682 bmp_cfg_db_set_string(db, NULL, "enabled_vplugins", str); | |
683 g_free(str); | |
684 } | |
685 else | |
686 bmp_cfg_db_unset_key(db, NULL, "enabled_vplugins"); | |
687 | |
688 str = effect_stringify_enabled_list(); | |
689 if (str) { | |
690 bmp_cfg_db_set_string(db, NULL, "enabled_eplugins", str); | |
691 g_free(str); | |
692 } | |
693 else | |
694 bmp_cfg_db_unset_key(db, NULL, "enabled_eplugins"); | |
695 | |
696 if (cfg.filesel_path) | |
697 bmp_cfg_db_set_string(db, NULL, "filesel_path", cfg.filesel_path); | |
698 | |
699 if (cfg.playlist_path) | |
700 bmp_cfg_db_set_string(db, NULL, "playlist_path", cfg.playlist_path); | |
701 | |
702 bmp_cfg_db_set_int(db, NULL, "url_history_length", | |
703 g_list_length(cfg.url_history)); | |
704 | |
705 for (node = cfg.url_history, i = 1; node; node = g_list_next(node), i++) { | |
706 str = g_strdup_printf("url_history%d", i); | |
707 bmp_cfg_db_set_string(db, NULL, str, node->data); | |
708 g_free(str); | |
709 } | |
710 | |
2228
894f7aa46f83
[svn] - bmp_playback_* -> playback_* -- i knew something smelled rotten here, hmm.
nenolod
parents:
2222
diff
changeset
|
711 if (playback_get_playing()) { |
894f7aa46f83
[svn] - bmp_playback_* -> playback_* -- i knew something smelled rotten here, hmm.
nenolod
parents:
2222
diff
changeset
|
712 cur_pb_time = playback_get_time(); |
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
|
713 } 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
|
714 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
|
715 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
|
716 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
|
717 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
|
718 |
0 | 719 bmp_cfg_db_close(db); |
720 | |
2088 | 721 playlist_save(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]); |
0 | 722 } |
723 | |
724 static void | |
725 bmp_set_default_icon(void) | |
726 { | |
727 GdkPixbuf *icon; | |
728 | |
120 | 729 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) audacious_player_xpm); |
0 | 730 gtk_window_set_default_icon(icon); |
731 g_object_unref(icon); | |
732 } | |
733 | |
734 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
|
735 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
|
736 { |
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 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
|
738 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
|
739 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
|
740 |
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 /* 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
|
742 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
|
743 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
|
744 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
|
745 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
|
746 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
|
747 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
|
748 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
|
749 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
|
750 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
|
751 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
|
752 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
|
753 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
|
754 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
|
755 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
|
756 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
|
757 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
|
758 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
|
759 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
|
760 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
|
761 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
|
762 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
|
763 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
|
764 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
|
765 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
|
766 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
|
767 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
|
768 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
|
769 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
|
770 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
|
771 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
|
772 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
|
773 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
|
774 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
|
775 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
|
776 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
|
777 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
|
778 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
|
779 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
|
780 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
|
781 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
|
782 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
|
783 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
|
784 |
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 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
|
786 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
|
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 |
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
|
789 static void |
0 | 790 display_usage(void) |
791 { | |
44 | 792 g_print(_("Usage: audacious [options] [files] ...\n\n" |
0 | 793 "Options:\n" |
794 "--------\n")); | |
795 g_print("\n-h, --help "); | |
796 /* -h, --help switch */ | |
797 g_print(_("Display this text and exit")); | |
798 g_print("\n-n, --session "); | |
799 /* -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
|
800 g_print(_("Select Audacious/BMP/XMMS session (Default: 0)")); |
0 | 801 g_print("\n-r, --rew "); |
802 /* -r, --rew switch */ | |
803 g_print(_("Skip backwards in playlist")); | |
804 g_print("\n-p, --play "); | |
805 /* -p, --play switch */ | |
806 g_print(_("Start playing current playlist")); | |
807 g_print("\n-u, --pause "); | |
808 /* -u, --pause switch */ | |
809 g_print(_("Pause current song")); | |
810 g_print("\n-s, --stop "); | |
811 /* -s, --stop switch */ | |
812 g_print(_("Stop current song")); | |
813 g_print("\n-t, --play-pause "); | |
814 /* -t, --play-pause switch */ | |
815 g_print(_("Pause if playing, play otherwise")); | |
816 g_print("\n-f, --fwd "); | |
817 /* -f, --fwd switch */ | |
818 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
|
819 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
|
820 /* -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
|
821 g_print(_("Display Jump to file dialog")); |
0 | 822 g_print("\n-e, --enqueue "); |
823 /* -e, --enqueue switch */ | |
824 g_print(_("Don't clear the playlist")); | |
825 g_print("\n-m, --show-main-window "); | |
826 /* -m, --show-main-window switch */ | |
827 g_print(_("Show the main window")); | |
828 g_print("\n-a, --activate "); | |
829 /* -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
|
830 g_print(_("Activate Audacious")); |
0 | 831 g_print("\n-i, --sm-client-id "); |
832 /* -i, --sm-client-id switch */ | |
833 g_print(_("Previous session ID")); | |
316
950f104f2e11
[svn] Fix spacing in --help output, patch by Mikachu.
chainsaw
parents:
284
diff
changeset
|
834 g_print("\n-H, --headless "); |
193 | 835 /* -h, --headless switch */ |
836 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
|
837 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
|
838 /* -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
|
839 g_print(_("Disable error/warning interception (logging)")); |
0 | 840 g_print("\n-v, --version "); |
841 /* -v, --version switch */ | |
842 g_print(_("Print version number and exit\n")); | |
843 | |
844 exit(EXIT_SUCCESS); | |
845 } | |
846 | |
847 static void | |
848 parse_cmd_line(gint argc, | |
849 gchar ** argv, | |
850 BmpCmdLineOpt * options) | |
851 { | |
852 static struct option long_options[] = { | |
853 {"help", 0, NULL, 'h'}, | |
854 {"session", 1, NULL, 'n'}, | |
855 {"rew", 0, NULL, 'r'}, | |
856 {"play", 0, NULL, 'p'}, | |
857 {"pause", 0, NULL, 'u'}, | |
858 {"play-pause", 0, NULL, 't'}, | |
859 {"stop", 0, NULL, 's'}, | |
860 {"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
|
861 {"show-jump-box", 0, NULL, 'j'}, |
0 | 862 {"enqueue", 0, NULL, 'e'}, |
2127
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
863 {"enqueue-to-temp", 0, NULL, 'E'}, |
0 | 864 {"show-main-window", 0, NULL, 'm'}, |
865 {"activate", 0, NULL, 'a'}, | |
866 {"version", 0, NULL, 'v'}, | |
867 {"sm-client-id", 1, NULL, 'i'}, | |
868 {"xmms", 0, NULL, 'x'}, | |
191 | 869 {"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
|
870 {"no-log", 0, NULL, 'N'}, |
0 | 871 {0, 0, 0, 0} |
872 }; | |
873 | |
874 gchar *filename, *current_dir; | |
875 gint c, i; | |
876 | |
877 memset(options, 0, sizeof(BmpCmdLineOpt)); | |
878 options->session = -1; | |
879 | |
2127
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
880 while ((c = getopt_long(argc, argv, "chn:HrpusfemavtLSjE", long_options, |
0 | 881 NULL)) != -1) { |
882 switch (c) { | |
883 case 'h': | |
884 display_usage(); | |
885 break; | |
886 case 'n': | |
887 options->session = atoi(optarg); | |
888 break; | |
191 | 889 case 'H': |
890 options->headless = TRUE; | |
891 break; | |
0 | 892 case 'r': |
893 options->rew = TRUE; | |
894 break; | |
895 case 'p': | |
896 options->play = TRUE; | |
897 break; | |
898 case 'u': | |
899 options->pause = TRUE; | |
900 break; | |
901 case 's': | |
902 options->stop = TRUE; | |
903 break; | |
904 case 'f': | |
905 options->fwd = TRUE; | |
906 break; | |
907 case 't': | |
908 options->play_pause = TRUE; | |
909 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
|
910 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
|
911 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
|
912 break; |
0 | 913 case 'm': |
914 options->mainwin = TRUE; | |
915 break; | |
916 case 'a': | |
917 options->activate = TRUE; | |
918 break; | |
2127
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
919 case 'E': |
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
920 options->enqueue_to_temp = TRUE; |
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
921 break; |
0 | 922 case 'e': |
923 options->enqueue = TRUE; | |
924 break; | |
925 case 'v': | |
926 dump_version(); | |
927 exit(EXIT_SUCCESS); | |
928 break; | |
929 case 'i': | |
930 options->previous_session_id = g_strdup(optarg); | |
931 break; | |
932 case 'c': | |
933 options->playcd = TRUE; | |
934 break; | |
935 case 'S': | |
936 options->load_skins = TRUE; | |
937 break; | |
1348
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
938 case 'N': |
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
939 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
|
940 break; |
0 | 941 } |
942 } | |
943 | |
944 current_dir = g_get_current_dir(); | |
945 | |
946 for (i = optind; i < argc; i++) { | |
947 if (argv[i][0] == '/' || strstr(argv[i], "://")) | |
948 filename = g_strdup(argv[i]); | |
949 else | |
950 filename = g_build_filename(current_dir, argv[i], NULL); | |
951 | |
952 options->filenames = g_list_prepend(options->filenames, filename); | |
953 } | |
954 | |
955 options->filenames = g_list_reverse(options->filenames); | |
956 | |
957 g_free(current_dir); | |
958 } | |
959 | |
960 static void | |
961 handle_cmd_line_options(BmpCmdLineOpt * options, | |
962 gboolean remote) | |
963 { | |
964 GList *filenames = options->filenames; | |
965 gint session = options->session; | |
966 | |
967 if (session == -1) { | |
968 if (!remote) | |
969 session = ctrlsocket_get_session_id(); | |
970 else | |
971 session = 0; | |
972 } | |
973 | |
974 if (filenames) { | |
975 gint pos = 0; | |
976 | |
977 if (options->load_skins) { | |
978 xmms_remote_set_skin(session, filenames->data); | |
979 skin_install_skin(filenames->data); | |
980 } | |
981 else { | |
2127
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
982 if (options->enqueue_to_temp) |
63af5b9c5026
[svn] - add playlist_select_playlist() to select a literal playlist
nenolod
parents:
2120
diff
changeset
|
983 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
|
984 |
0 | 985 if (options->enqueue && options->play) |
986 pos = xmms_remote_get_playlist_length(session); | |
987 | |
988 if (!options->enqueue) | |
989 xmms_remote_playlist_clear(session); | |
990 | |
991 xmms_remote_playlist_add(session, filenames); | |
992 | |
993 if (options->enqueue && options->play && | |
994 xmms_remote_get_playlist_length(session) > pos) | |
995 xmms_remote_set_playlist_pos(session, pos); | |
996 | |
997 if (!options->enqueue) | |
998 xmms_remote_play(session); | |
999 } | |
1000 | |
1001 g_list_foreach(filenames, (GFunc) g_free, NULL); | |
1002 g_list_free(filenames); | |
1003 } | |
1004 | |
1005 if (options->rew) | |
1006 xmms_remote_playlist_prev(session); | |
1007 | |
1008 if (options->play) | |
1009 xmms_remote_play(session); | |
1010 | |
1011 if (options->pause) | |
1012 xmms_remote_pause(session); | |
1013 | |
1014 if (options->stop) | |
1015 xmms_remote_stop(session); | |
1016 | |
1017 if (options->fwd) | |
1018 xmms_remote_playlist_next(session); | |
1019 | |
1020 if (options->play_pause) | |
1021 xmms_remote_play_pause(session); | |
1022 | |
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
|
1023 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
|
1024 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
|
1025 |
0 | 1026 if (options->mainwin) |
1027 xmms_remote_main_win_toggle(session, TRUE); | |
1028 | |
1029 if (options->activate) | |
1030 xmms_remote_activate(session); | |
1031 | |
1032 if (options->playcd) | |
1033 play_medium(); | |
1034 } | |
1035 | |
1036 static void | |
1037 bmp_setup_logger(void) | |
1038 { | |
1039 if (!bmp_logger_start(bmp_paths[BMP_PATH_LOG_FILE])) | |
1040 return; | |
1041 | |
1042 g_atexit(bmp_logger_stop); | |
1043 } | |
1044 | |
1045 static void | |
1046 run_load_skin_error_dialog(const gchar * skin_path) | |
1047 { | |
1048 const gchar *markup = | |
1049 N_("<b><big>Unable to load skin.</big></b>\n" | |
1050 "\n" | |
1051 "Check that skin at '%s' is usable and default skin is properly " | |
1052 "installed at '%s'\n"); | |
1053 | |
1054 GtkWidget *dialog = | |
1055 gtk_message_dialog_new_with_markup(NULL, | |
1056 GTK_DIALOG_MODAL, | |
1057 GTK_MESSAGE_ERROR, | |
1058 GTK_BUTTONS_CLOSE, | |
1059 _(markup), | |
1060 skin_path, | |
1061 BMP_DEFAULT_SKIN_PATH); | |
1062 gtk_dialog_run(GTK_DIALOG(dialog)); | |
1063 gtk_widget_destroy(dialog); | |
1064 } | |
1065 | |
781
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1066 // use a format string? |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1067 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
|
1068 { |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1069 fprintf(stderr,error_text); |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1070 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
|
1071 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
|
1072 error_text); |
781
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1073 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
|
1074 gtk_widget_hide(err); |
781
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 } |
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1077 |
0 | 1078 gint |
1079 main(gint argc, gchar ** argv) | |
1080 { | |
44 | 1081 gboolean gtk_init_check_ok; |
2088 | 1082 Playlist *playlist; |
0 | 1083 |
1084 /* Setup l10n early so we can print localized error messages */ | |
1085 gtk_set_locale(); | |
749 | 1086 bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
1087 bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); | |
1088 textdomain(PACKAGE_NAME); | |
0 | 1089 |
1090 bmp_init_paths(); | |
1091 bmp_make_user_dir(); | |
1092 | |
1093 /* Check GTK version. Really, this is only needed for binary | |
1094 * 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
|
1095 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
|
1096 g_printerr(_("Sorry, your GTK+ version (%d.%d.%d) does not work with Audacious.\n" |
0 | 1097 "Please use GTK+ %s or newer.\n"), |
1098 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
|
1099 "2.6.0"); |
0 | 1100 exit(EXIT_FAILURE); |
1101 } | |
1102 | |
1103 g_set_application_name(_(application_name)); | |
1104 | |
1105 g_thread_init(NULL); | |
1106 if (!g_thread_supported()) { | |
1107 g_printerr(_("Sorry, threads isn't supported on your platform.\n\n" | |
1108 "If you're on a libc5 based linux system and installed Glib & GTK+ before you\n" | |
1109 "installed LinuxThreads you need to recompile Glib & GTK+.\n")); | |
1110 exit(EXIT_FAILURE); | |
1111 } | |
1112 | |
1113 gdk_threads_init(); | |
1114 | |
2026 | 1115 cond_scan = g_cond_new(); |
1116 mutex_scan = g_mutex_new(); | |
1117 | |
44 | 1118 gtk_init_check_ok = gtk_init_check(&argc, &argv); |
1119 /* Now let's parse the command line options first. */ | |
1120 parse_cmd_line(argc, argv, &options); | |
1121 if (!gtk_init_check_ok) { | |
0 | 1122 if (argc < 2) { |
1123 /* GTK check failed, and no arguments passed to indicate | |
1124 that user is intending to only remote control a running | |
1125 session */ | |
44 | 1126 g_printerr(_("audacious: Unable to open display, exiting.\n")); |
0 | 1127 exit(EXIT_FAILURE); |
1128 } | |
1129 | |
1130 handle_cmd_line_options(&options, TRUE); | |
191 | 1131 |
1132 /* we could be running headless, so GTK probably wont matter */ | |
1133 if (options.headless != 1) | |
1134 exit(EXIT_SUCCESS); | |
0 | 1135 } |
1136 | |
1348
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
1137 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
|
1138 bmp_setup_logger(); |
cc57f7545876
[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
nenolod
parents:
1347
diff
changeset
|
1139 |
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
|
1140 signal_handlers_init(); |
0 | 1141 |
1142 g_random_set_seed(time(NULL)); | |
1143 | |
1144 bmp_config_load(); | |
1145 | |
1146 if (options.session != -1 || !ctrlsocket_setup()) { | |
1147 handle_cmd_line_options(&options, TRUE); | |
1148 exit(EXIT_SUCCESS); | |
1149 } | |
1150 | |
2003
74f280120233
[svn] - init plugins before initalizing the skin system.
nenolod
parents:
2000
diff
changeset
|
1151 plugin_system_init(); |
74f280120233
[svn] - init plugins before initalizing the skin system.
nenolod
parents:
2000
diff
changeset
|
1152 |
2120
1d67cf383e32
[svn] - dynamically allocate the playlist at startup and fix some lingering improper uses of playlist_get()
nenolod
parents:
2113
diff
changeset
|
1153 /* 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
|
1154 playlist_init(); |
1d67cf383e32
[svn] - dynamically allocate the playlist at startup and fix some lingering improper uses of playlist_get()
nenolod
parents:
2113
diff
changeset
|
1155 |
191 | 1156 if (options.headless != 1) |
1157 { | |
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
|
1158 /* 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
|
1159 register_aud_stock_icons(); |
781
12c47704b4b5
[svn] Add error reporting for many places, patch by external contributor Derek
nenolod
parents:
749
diff
changeset
|
1160 |
191 | 1161 bmp_set_default_icon(); |
0 | 1162 |
191 | 1163 gtk_accel_map_load(bmp_paths[BMP_PATH_ACCEL_FILE]); |
0 | 1164 |
1810 | 1165 if (!init_skins(cfg.skin)) { |
1166 run_load_skin_error_dialog(cfg.skin); | |
1167 exit(EXIT_FAILURE); | |
1168 } | |
1169 | |
191 | 1170 GDK_THREADS_ENTER(); |
0 | 1171 } |
1172 | |
2120
1d67cf383e32
[svn] - dynamically allocate the playlist at startup and fix some lingering improper uses of playlist_get()
nenolod
parents:
2113
diff
changeset
|
1173 /* Load the default playlist in. */ |
2088 | 1174 playlist = playlist_get_active(); |
1175 playlist_load(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]); | |
1176 playlist_set_position(playlist, cfg.playlist_position); | |
0 | 1177 |
1178 /* this needs to be called after all 3 windows are created and | |
191 | 1179 * input plugins are setup'ed |
1180 * but not if we're running headless --nenolod | |
1181 */ | |
0 | 1182 mainwin_setup_menus(); |
1183 | |
191 | 1184 if (options.headless != 1) |
1185 GDK_THREADS_LEAVE(); | |
0 | 1186 |
1187 ctrlsocket_start(); | |
1188 | |
1189 handle_cmd_line_options(&options, FALSE); | |
1190 | |
191 | 1191 if (options.headless != 1) |
1192 { | |
1193 GDK_THREADS_ENTER(); | |
0 | 1194 |
191 | 1195 read_volume(VOLSET_STARTUP); |
1196 mainwin_set_info_text(); | |
1197 | |
1198 /* FIXME: delayed, because it deals directly with the plugin | |
1199 * interface to set menu items */ | |
1200 create_prefs_window(); | |
0 | 1201 |
1264 | 1202 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
|
1203 create_filepopup_window(); |
1264 | 1204 |
191 | 1205 if (cfg.player_visible) |
1206 mainwin_show(TRUE); | |
1207 else if (!cfg.playlist_visible && !cfg.equalizer_visible) | |
1208 mainwin_show(TRUE); | |
125 | 1209 |
191 | 1210 if (cfg.equalizer_visible) |
1211 equalizerwin_show(TRUE); | |
1212 | |
1213 if (cfg.playlist_visible) | |
1214 playlistwin_show(); | |
0 | 1215 |
191 | 1216 hint_set_always(cfg.always_on_top); |
0 | 1217 |
191 | 1218 playlist_start_get_info_thread(); |
1219 mainwin_attach_idle_func(); | |
1220 | |
486 | 1221 starting_up = FALSE; |
1222 | |
680
8282b365f6cb
[svn] - Add some sanity checking to make sure we can't do X11 stuff when running headless.
nenolod
parents:
625
diff
changeset
|
1223 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
|
1224 |
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
|
1225 if (cfg.resume_playback_on_startup) { |
2088 | 1226 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
|
1227 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
|
1228 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
|
1229 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
|
1230 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
|
1231 output_set_volume(0,0); |
2228
894f7aa46f83
[svn] - bmp_playback_* -> playback_* -- i knew something smelled rotten here, hmm.
nenolod
parents:
2222
diff
changeset
|
1232 playback_initiate(); |
1966
fcf3900d05b9
[svn] - temporarily display the newui at startup along with the oldui
nenolod
parents:
1959
diff
changeset
|
1233 |
fcf3900d05b9
[svn] - temporarily display the newui at startup along with the oldui
nenolod
parents:
1959
diff
changeset
|
1234 /* 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
|
1235 * tune. --chainsaw |
fcf3900d05b9
[svn] - temporarily display the newui at startup along with the oldui
nenolod
parents:
1959
diff
changeset
|
1236 */ |
fcf3900d05b9
[svn] - temporarily display the newui at startup along with the oldui
nenolod
parents:
1959
diff
changeset
|
1237 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
|
1238 g_usleep(1000); |
1659
eeaf62b288a3
[svn] Make the playback resume code a lot more robust.
chainsaw
parents:
1653
diff
changeset
|
1239 if (!ip_data.playing) |
eeaf62b288a3
[svn] Make the playback resume code a lot more robust.
chainsaw
parents:
1653
diff
changeset
|
1240 break; |
eeaf62b288a3
[svn] Make the playback resume code a lot more robust.
chainsaw
parents:
1653
diff
changeset
|
1241 } |
2228
894f7aa46f83
[svn] - bmp_playback_* -> playback_* -- i knew something smelled rotten here, hmm.
nenolod
parents:
2222
diff
changeset
|
1242 playback_seek(cfg.resume_playback_on_startup_time / |
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
|
1243 1000); |
1753
01df1ea5feae
[svn] Mute while seeking for playback resume, tighten the loop. We want a responsive GUI ASAP.
chainsaw
parents:
1710
diff
changeset
|
1244 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
|
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 } |
8c6949ffd7f8
[svn] Support for saving the playback state, and resuming playback after restart. Patch by cha0smaster, closes bug #479.
chainsaw
parents:
946
diff
changeset
|
1247 |
191 | 1248 gtk_main(); |
1249 | |
1250 GDK_THREADS_LEAVE(); | |
0 | 1251 |
2026 | 1252 g_cond_free(cond_scan); |
1253 g_mutex_free(mutex_scan); | |
1254 | |
191 | 1255 return EXIT_SUCCESS; |
1256 } | |
1257 else | |
1258 { | |
1259 mainwin_set_info_text(); | |
1260 playlist_start_get_info_thread(); | |
0 | 1261 |
486 | 1262 starting_up = FALSE; |
1263 | |
191 | 1264 for (;;) |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
191
diff
changeset
|
1265 { |
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
|
1266 /* 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
|
1267 audcore_generic_events(); |
198 | 1268 free_vis_data(); /* to prevent buffer overflow -- paranoia */ |
191 | 1269 xmms_usleep(10000); |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
191
diff
changeset
|
1270 } |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
191
diff
changeset
|
1271 |
191 | 1272 return EXIT_SUCCESS; |
1273 } | |
0 | 1274 } |