Mercurial > audlegacy
annotate audacious/main.c @ 602:c1fca3e01a84 trunk
[svn] ditto
author | nenolod |
---|---|
date | Fri, 03 Feb 2006 06:34:31 -0800 |
parents | e4e897d20791 |
children | 0a73d1faeb4e |
rev | line source |
---|---|
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
|
1 /* Audacious - Cross-platform multimedia platform. |
ccd034857702
[svn] Split up generic events into audcore_generic_events(), and client-specific stuff remains in mainwin_idle_func().
nenolod
parents:
196
diff
changeset
|
2 * Copyright (C) 2005 Audacious development team. |
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 | |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program; if not, write to the Free Software | |
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
23 */ | |
24 | |
25 #ifdef HAVE_CONFIG_H | |
26 # include "config.h" | |
27 #endif | |
28 | |
29 #include "main.h" | |
30 | |
31 #include <glib.h> | |
32 #include <glib/gi18n.h> | |
33 #include <glib/gprintf.h> | |
34 #include <gdk/gdk.h> | |
35 #include <stdlib.h> | |
36 #include <string.h> | |
37 #include <getopt.h> | |
38 #include <ctype.h> | |
39 #include <time.h> | |
40 | |
41 #include <unistd.h> | |
42 #include <errno.h> | |
43 #include <sys/types.h> | |
44 #include <sys/stat.h> | |
45 #include <signal.h> | |
46 #include <gdk/gdkx.h> | |
47 #include <X11/Xlib.h> | |
48 #include <X11/Xatom.h> | |
49 | |
50 #include "libaudacious/configdb.h" | |
51 #include "libaudacious/beepctrl.h" | |
52 #include "libaudacious/util.h" | |
53 #include "libaudacious/vfs.h" | |
54 | |
55 #include "controlsocket.h" | |
56 #include "dnd.h" | |
57 #include "dock.h" | |
58 #include "effect.h" | |
59 #include "equalizer.h" | |
60 #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
|
61 #include "genevent.h" |
0 | 62 #include "hints.h" |
63 #include "input.h" | |
64 #include "logger.h" | |
65 #include "mainwin.h" | |
66 #include "output.h" | |
538
e4e897d20791
[svn] remove libaudcore, we never did anything with it
nenolod
parents:
534
diff
changeset
|
67 #include "playback.h" |
0 | 68 #include "playlist.h" |
383 | 69 #include "ui_playlist.h" |
0 | 70 #include "pluginenum.h" |
71 #include "prefswin.h" | |
72 #include "skin.h" | |
73 #include "skinwin.h" | |
74 #include "util.h" | |
75 #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
|
76 #include "build_stamp.h" |
0 | 77 |
78 #include "pixmaps.h" | |
120 | 79 #include "images/audacious_player.xpm" |
0 | 80 |
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 |
87 | |
88 struct _BmpCmdLineOpt { | |
89 GList *filenames; | |
90 gint session; | |
91 gboolean play, stop, pause, fwd, rew, play_pause, playcd; | |
92 gboolean enqueue, mainwin, remote, activate; | |
93 gboolean load_skins; | |
191 | 94 gboolean headless; |
0 | 95 gchar *previous_session_id; |
96 }; | |
97 | |
98 typedef struct _BmpCmdLineOpt BmpCmdLineOpt; | |
99 | |
100 | |
101 BmpConfig cfg; | |
102 | |
103 BmpConfig bmp_default_config = { | |
104 MAINWIN_DEFAULT_POS_X, /* mainwin x position */ | |
105 MAINWIN_DEFAULT_POS_Y, /* mainwin y position */ | |
106 EQUALIZER_DEFAULT_POS_X, /* equalizer x position */ | |
107 EQUALIZER_DEFAULT_POS_Y, /* equalizer y position */ | |
108 PLAYLISTWIN_DEFAULT_POS_X, /* playlistwin x position */ | |
109 PLAYLISTWIN_DEFAULT_POS_Y, /* playlistwin y position */ | |
110 PLAYLISTWIN_DEFAULT_WIDTH, /* playlistwin width */ | |
111 PLAYLISTWIN_DEFAULT_HEIGHT, /* playlistwin height */ | |
112 10, /* snap distance */ | |
113 FALSE, /* real-time priority */ | |
114 FALSE, FALSE, /* shuffle, repeat */ | |
115 FALSE, /* UNUSED (double size) */ | |
116 TRUE, /* autoscroll */ | |
117 TRUE, /* analyzer peaks */ | |
118 FALSE, /* equalizer autoload */ | |
119 FALSE, /* easy move */ | |
120 FALSE, /* equalizer active */ | |
121 FALSE, /* playlistwin visible */ | |
122 FALSE, /* equalizer visible */ | |
123 TRUE, /* player visible */ | |
124 FALSE, /* player shaded */ | |
125 FALSE, /* playlistwin shaded */ | |
126 FALSE, /* equalizer shaded */ | |
127 FALSE, /* allow multiple instances */ | |
128 TRUE, /* always show cb */ | |
129 TRUE, TRUE, /* convert '_' and %20 */ | |
130 TRUE, /* show numbers in playlist */ | |
131 TRUE, /* snap windows */ | |
132 TRUE, /* save window positions */ | |
133 TRUE, /* dim titlebar */ | |
134 FALSE, /* get playlist info on load */ | |
135 TRUE, /* get playlist info on demand */ | |
136 TRUE, /* UNUSED (equalizer doublesize linked) */ | |
137 FALSE, /* sort jump to file */ | |
138 FALSE, /* use effect plugins */ | |
139 FALSE, /* always on top */ | |
140 FALSE, /* sticky */ | |
141 FALSE, /* no playlist advance */ | |
142 TRUE, /* UNUSED (smooth title scrolling) */ | |
143 TRUE, /* use playlist metadata */ | |
144 TRUE, /* warn about unplayables */ | |
145 FALSE, /* use \ as directory delimiter */ | |
146 FALSE, /* random skin on play */ | |
147 FALSE, /* use fontsets */ | |
148 FALSE, /* use X font for mainwin */ | |
149 TRUE, /* use custom cursors */ | |
150 TRUE, /* close dialog on open */ | |
151 TRUE, /* close dialog on add */ | |
152 0.0, /* equalizer preamp */ | |
153 {0, 0, 0, 0, 0, /* equalizer bands */ | |
154 0, 0, 0, 0, 0}, | |
155 NULL, /* skin */ | |
156 NULL, /* output plugin */ | |
157 NULL, /* file selector path */ | |
158 NULL, /* playlist path */ | |
159 NULL, /* playlist font */ | |
160 NULL, /* mainwin font */ | |
161 NULL, /* disabled input plugins */ | |
162 NULL, /* enabled general plugins */ | |
163 NULL, /* enabled visualization plugins */ | |
164 NULL, /* enabled effect plugins */ | |
165 NULL, /* equalizer preset default file */ | |
166 NULL, /* equalizer preset extension */ | |
167 NULL, /* URL history */ | |
168 0, /* timer mode */ | |
169 VIS_ANALYZER, /* visualizer type */ | |
170 ANALYZER_NORMAL, /* analyzer mode */ | |
171 ANALYZER_BARS, /* analyzer type */ | |
172 SCOPE_DOT, /* scope mode */ | |
173 VU_SMOOTH, /* VU mode */ | |
174 REFRESH_FULL, /* visualizer refresh rate */ | |
175 FALLOFF_FAST, /* analyzer fall off rate */ | |
176 FALLOFF_SLOW, /* peaks fall off rate */ | |
177 0, /* playlist position */ | |
178 2, /* pause between songs time */ | |
179 FALSE, /* pause between songs */ | |
180 FALSE, /* show window decorations */ | |
181 8, /* mouse wheel scroll step */ | |
182 FALSE, /* playlist transparent */ | |
534
ba0608cbbdaa
[svn] artist - album - title is now the default title format.
nenolod
parents:
530
diff
changeset
|
183 2, /* 2nd preset (ARTIST - TITLE) */ |
0 | 184 NULL, /* title format */ |
185 FALSE, /* software volume control enabled */ | |
186 TRUE, /* UNUSED (XMMS compatibility mode) */ | |
187 TRUE, /* extra eq filtering */ | |
188 3 /* scroll pl by */ | |
189 }; | |
190 | |
191 typedef struct bmp_cfg_boolent_t { | |
192 char const *be_vname; | |
193 gboolean *be_vloc; | |
194 gboolean be_wrt; | |
195 } bmp_cfg_boolent; | |
196 | |
197 typedef struct bmp_cfg_nument_t { | |
198 char const *ie_vname; | |
199 gint *ie_vloc; | |
200 gboolean ie_wrt; | |
201 } bmp_cfg_nument; | |
202 | |
203 typedef struct bmp_cfg_strent_t { | |
204 char const *se_vname; | |
205 char **se_vloc; | |
206 gboolean se_wrt; | |
207 } bmp_cfg_strent; | |
208 | |
209 const gchar *bmp_titlestring_presets[] = { | |
210 "%t", | |
211 "%p - %t", | |
212 "%p - %a - %t", | |
213 "%a - %t" | |
214 }; | |
215 | |
216 const guint n_titlestring_presets = G_N_ELEMENTS(bmp_titlestring_presets); | |
217 | |
218 static bmp_cfg_boolent bmp_boolents[] = { | |
219 {"allow_multiple_instances", &cfg.allow_multiple_instances, TRUE}, | |
220 {"use_realtime", &cfg.use_realtime, TRUE}, | |
221 {"always_show_cb", &cfg.always_show_cb, TRUE}, | |
222 {"convert_underscore", &cfg.convert_underscore, TRUE}, | |
223 {"convert_twenty", &cfg.convert_twenty, TRUE}, | |
224 {"show_numbers_in_pl", &cfg.show_numbers_in_pl, TRUE}, | |
225 {"snap_windows", &cfg.snap_windows, TRUE}, | |
226 {"save_window_positions", &cfg.save_window_position, TRUE}, | |
227 {"dim_titlebar", &cfg.dim_titlebar, TRUE}, | |
228 {"get_info_on_load", &cfg.get_info_on_load, TRUE}, | |
229 {"get_info_on_demand", &cfg.get_info_on_demand, TRUE}, | |
230 {"no_playlist_advance", &cfg.no_playlist_advance, TRUE}, | |
231 {"sort_jump_to_file", &cfg.sort_jump_to_file, TRUE}, | |
232 {"use_pl_metadata", &cfg.use_pl_metadata, TRUE}, | |
233 {"warn_about_unplayables", &cfg.warn_about_unplayables, TRUE}, | |
234 {"use_backslash_as_dir_delimiter", &cfg.use_backslash_as_dir_delimiter, TRUE}, | |
235 {"player_shaded", &cfg.player_shaded, TRUE}, | |
236 {"player_visible", &cfg.player_visible, TRUE}, | |
237 {"shuffle", &cfg.shuffle, TRUE}, | |
238 {"repeat", &cfg.repeat, TRUE}, | |
239 {"autoscroll_songname", &cfg.autoscroll, TRUE}, | |
240 {"playlist_shaded", &cfg.playlist_shaded, TRUE}, | |
241 {"playlist_visible", &cfg.playlist_visible, TRUE}, | |
242 {"playlist_transparent", &cfg.playlist_transparent, TRUE}, | |
243 {"use_fontsets", &cfg.use_fontsets, TRUE}, | |
85
8c8a20f72ace
[svn] s/static GTKItemFactoryEntry/GTKItemFactoryEntry/g.
nenolod
parents:
80
diff
changeset
|
244 {"mainwin_use_xfont", &cfg.mainwin_use_xfont, FALSE}, |
0 | 245 {"equalizer_visible", &cfg.equalizer_visible, TRUE}, |
246 {"equalizer_active", &cfg.equalizer_active, TRUE}, | |
247 {"equalizer_shaded", &cfg.equalizer_shaded, TRUE}, | |
248 {"equalizer_autoload", &cfg.equalizer_autoload, TRUE}, | |
249 {"use_eplugins", &cfg.use_eplugins, TRUE}, | |
250 {"always_on_top", &cfg.always_on_top, TRUE}, | |
251 {"sticky", &cfg.sticky, TRUE}, | |
252 {"random_skin_on_play", &cfg.random_skin_on_play, TRUE}, | |
253 {"pause_between_songs", &cfg.pause_between_songs, TRUE}, | |
254 {"show_wm_decorations", &cfg.show_wm_decorations, TRUE}, | |
255 {"eq_extra_filtering", &cfg.eq_extra_filtering, TRUE}, | |
256 {"analyzer_peaks", &cfg.analyzer_peaks, TRUE}, | |
257 {"custom_cursors", &cfg.custom_cursors, TRUE}, | |
258 {"close_dialog_open", &cfg.close_dialog_open, TRUE}, | |
259 {"close_dialog_add", &cfg.close_dialog_add, TRUE} | |
260 }; | |
261 | |
262 static gint ncfgbent = G_N_ELEMENTS(bmp_boolents); | |
263 | |
264 static bmp_cfg_nument bmp_numents[] = { | |
265 {"player_x", &cfg.player_x, TRUE}, | |
266 {"player_y", &cfg.player_y, TRUE}, | |
267 {"timer_mode", &cfg.timer_mode, TRUE}, | |
268 {"vis_type", &cfg.vis_type, TRUE}, | |
269 {"analyzer_mode", &cfg.analyzer_mode, TRUE}, | |
270 {"analyzer_type", &cfg.analyzer_type, TRUE}, | |
271 {"scope_mode", &cfg.scope_mode, TRUE}, | |
272 {"vu_mode", &cfg.vu_mode, TRUE}, | |
273 {"vis_refresh_rate", &cfg.vis_refresh, TRUE}, | |
274 {"analyzer_falloff", &cfg.analyzer_falloff, TRUE}, | |
275 {"peaks_falloff", &cfg.peaks_falloff, TRUE}, | |
276 {"playlist_x", &cfg.playlist_x, TRUE}, | |
277 {"playlist_y", &cfg.playlist_y, TRUE}, | |
278 {"playlist_width", &cfg.playlist_width, TRUE}, | |
279 {"playlist_height", &cfg.playlist_height, TRUE}, | |
280 {"playlist_position", &cfg.playlist_position, TRUE}, | |
281 {"equalizer_x", &cfg.equalizer_x, TRUE}, | |
282 {"equalizer_y", &cfg.equalizer_y, TRUE}, | |
283 {"snap_distance", &cfg.snap_distance, TRUE}, | |
284 {"pause_between_songs_time", &cfg.pause_between_songs_time, TRUE}, | |
285 {"mouse_wheel_change", &cfg.mouse_change, TRUE}, | |
286 {"scroll_pl_by", &cfg.scroll_pl_by, TRUE}, | |
287 {"titlestring_preset", &cfg.titlestring_preset, TRUE}, | |
288 }; | |
289 | |
290 static gint ncfgient = G_N_ELEMENTS(bmp_numents); | |
291 | |
292 static bmp_cfg_strent bmp_strents[] = { | |
293 {"playlist_font", &cfg.playlist_font, TRUE}, | |
294 {"mainwin_font", &cfg.mainwin_font, TRUE}, | |
295 {"eqpreset_default_file", &cfg.eqpreset_default_file, TRUE}, | |
296 {"eqpreset_extension", &cfg.eqpreset_extension, TRUE}, | |
297 {"skin", &cfg.skin, FALSE}, | |
298 {"output_plugin", &cfg.outputplugin, FALSE}, | |
299 {"disabled_iplugins", &cfg.disabled_iplugins, TRUE}, | |
300 {"enabled_gplugins", &cfg.enabled_gplugins, FALSE}, | |
301 {"enabled_vplugins", &cfg.enabled_vplugins, FALSE}, | |
302 {"enabled_eplugins", &cfg.enabled_eplugins, FALSE}, | |
303 {"filesel_path", &cfg.filesel_path, FALSE}, | |
304 {"playlist_path", &cfg.playlist_path, FALSE}, | |
305 {"generic_title_format", &cfg.gentitle_format, TRUE}, | |
306 }; | |
307 | |
308 static gint ncfgsent = G_N_ELEMENTS(bmp_strents); | |
309 | |
310 gchar *bmp_paths[BMP_PATH_COUNT] = {}; | |
311 | |
312 GList *dock_window_list = NULL; | |
313 | |
314 gboolean pposition_broken = FALSE; | |
315 | |
486 | 316 gboolean starting_up = TRUE; |
0 | 317 |
318 static GSList * | |
319 get_feature_list(void) | |
320 { | |
321 GSList *features = NULL; | |
322 | |
323 #ifdef HAVE_GNOME_VFS | |
324 features = g_slist_append(features, "GNOME VFS"); | |
325 #endif | |
326 | |
327 #ifdef HAVE_GCONF | |
328 features = g_slist_append(features, "GConf"); | |
329 #endif | |
330 | |
331 return features; | |
332 } | |
333 | |
334 static void | |
335 dump_version(void) | |
336 { | |
337 GSList *features; | |
338 | |
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
|
339 g_printf("%s %s [%s]", _(application_name), VERSION, svn_stamp); |
0 | 340 |
341 features = get_feature_list(); | |
342 | |
343 if (features) { | |
344 GSList *item; | |
345 | |
346 g_printf(" ("); | |
347 | |
348 for (item = features; g_slist_next(item); item = g_slist_next(item)) | |
349 g_printf("%s, ", (const gchar *) item->data); | |
350 | |
351 g_printf("%s)", (const gchar *) item->data); | |
352 | |
353 g_slist_free(features); | |
354 } | |
355 | |
356 g_printf("\n"); | |
357 } | |
358 | |
359 const gchar * | |
360 xmms_get_gentitle_format(void) | |
361 { | |
362 gint titlestring_preset = cfg.titlestring_preset; | |
363 | |
364 if (titlestring_preset < n_titlestring_presets) | |
365 return bmp_titlestring_presets[titlestring_preset]; | |
366 | |
367 return cfg.gentitle_format; | |
368 } | |
369 | |
370 static void | |
371 make_directory(const gchar * path, mode_t mode) | |
372 { | |
373 if (mkdir(path, mode) == 0) | |
374 return; | |
375 | |
376 if (errno == EEXIST) | |
377 return; | |
378 | |
379 g_printerr(_("Could not create directory (%s): %s"), path, | |
380 g_strerror(errno)); | |
381 } | |
382 | |
383 static void | |
384 bmp_make_user_dir(void) | |
385 { | |
386 const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; | |
387 | |
388 make_directory(bmp_paths[BMP_PATH_USER_DIR], mode755); | |
389 make_directory(bmp_paths[BMP_PATH_USER_PLUGIN_DIR], mode755); | |
390 make_directory(bmp_paths[BMP_PATH_USER_SKIN_DIR], mode755); | |
391 make_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR], mode755); | |
392 } | |
393 | |
394 static void | |
395 bmp_free_paths(void) | |
396 { | |
397 int i; | |
398 | |
399 for (i = 0; i < BMP_PATH_COUNT; i++) | |
400 { | |
401 g_free(bmp_paths[i]); | |
402 bmp_paths[i] = 0; | |
403 } | |
404 } | |
405 | |
406 | |
407 #define USER_PATH(path) \ | |
408 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], path, NULL); | |
409 | |
410 static void | |
411 bmp_init_paths(void) | |
412 { | |
413 bmp_paths[BMP_PATH_USER_DIR] = g_build_filename(g_get_home_dir(), BMP_RCPATH, NULL); | |
414 | |
415 bmp_paths[BMP_PATH_USER_PLUGIN_DIR] = USER_PATH(BMP_USER_PLUGIN_DIR_BASENAME); | |
416 bmp_paths[BMP_PATH_USER_SKIN_DIR] = USER_PATH(BMP_SKIN_DIR_BASENAME); | |
417 bmp_paths[BMP_PATH_SKIN_THUMB_DIR] = USER_PATH(BMP_SKIN_THUMB_DIR_BASENAME); | |
418 bmp_paths[BMP_PATH_CONFIG_FILE] = USER_PATH(BMP_CONFIG_BASENAME); | |
419 bmp_paths[BMP_PATH_PLAYLIST_FILE] = USER_PATH(BMP_PLAYLIST_BASENAME); | |
420 bmp_paths[BMP_PATH_ACCEL_FILE] = USER_PATH(BMP_ACCEL_BASENAME); | |
421 bmp_paths[BMP_PATH_LOG_FILE] = USER_PATH(BMP_LOG_BASENAME); | |
422 | |
423 g_atexit(bmp_free_paths); | |
424 } | |
425 | |
426 | |
427 void | |
428 bmp_config_load(void) | |
429 { | |
430 ConfigDb *db; | |
431 gint i, length; | |
432 | |
433 memcpy(&cfg, &bmp_default_config, sizeof(BmpConfig)); | |
434 | |
435 db = bmp_cfg_db_open(); | |
436 for (i = 0; i < ncfgbent; ++i) { | |
437 bmp_cfg_db_get_bool(db, NULL, | |
438 bmp_boolents[i].be_vname, | |
439 bmp_boolents[i].be_vloc); | |
440 } | |
441 | |
442 for (i = 0; i < ncfgient; ++i) { | |
443 bmp_cfg_db_get_int(db, NULL, | |
444 bmp_numents[i].ie_vname, | |
445 bmp_numents[i].ie_vloc); | |
446 } | |
447 | |
448 for (i = 0; i < ncfgsent; ++i) { | |
449 bmp_cfg_db_get_string(db, NULL, | |
450 bmp_strents[i].se_vname, | |
451 bmp_strents[i].se_vloc); | |
452 } | |
453 | |
454 /* Preset */ | |
455 bmp_cfg_db_get_float(db, NULL, "equalizer_preamp", &cfg.equalizer_preamp); | |
456 for (i = 0; i < 10; i++) { | |
457 gchar eqtext[18]; | |
458 | |
459 g_snprintf(eqtext, sizeof(eqtext), "equalizer_band%d", i); | |
460 bmp_cfg_db_get_float(db, NULL, eqtext, &cfg.equalizer_bands[i]); | |
461 } | |
462 | |
463 /* History */ | |
464 if (bmp_cfg_db_get_int(db, NULL, "url_history_length", &length)) { | |
465 for (i = 1; i <= length; i++) { | |
466 gchar str[19], *tmp; | |
467 | |
468 g_snprintf(str, sizeof(str), "url_history%d", i); | |
469 if (bmp_cfg_db_get_string(db, NULL, str, &tmp)) | |
470 cfg.url_history = g_list_append(cfg.url_history, tmp); | |
471 } | |
472 } | |
473 | |
474 bmp_cfg_db_close(db); | |
475 | |
476 | |
477 if (cfg.playlist_font && strlen(cfg.playlist_font) == 0) { | |
478 g_free(cfg.playlist_font); | |
479 cfg.playlist_font = NULL; | |
480 } | |
481 | |
482 if (cfg.mainwin_font && strlen(cfg.mainwin_font) == 0) { | |
483 g_free(cfg.mainwin_font); | |
484 cfg.mainwin_font = NULL; | |
485 } | |
486 | |
487 if (!cfg.playlist_font) | |
488 cfg.playlist_font = g_strdup(PLAYLISTWIN_DEFAULT_FONT); | |
489 | |
490 if (!cfg.mainwin_font) | |
491 cfg.mainwin_font = g_strdup(MAINWIN_DEFAULT_FONT); | |
492 | |
493 if (!cfg.gentitle_format) | |
534
ba0608cbbdaa
[svn] artist - album - title is now the default title format.
nenolod
parents:
530
diff
changeset
|
494 cfg.gentitle_format = g_strdup("%p - %a - %t"); |
0 | 495 |
496 if (!cfg.outputplugin) { | |
497 #ifdef HAVE_OSS | |
498 cfg.outputplugin = g_build_filename(PLUGIN_DIR, plugin_dir_list[0], | |
499 PLUGIN_FILENAME("OSS"), NULL); | |
500 #else | |
501 /* FIXME: This implicitly means the output plugin that is | |
502 * first in the alphabet will be used (usually the disk writer | |
503 * plugin) */ | |
504 cfg.outputplugin = g_strdup(""); | |
505 #endif | |
506 } | |
507 | |
508 if (!cfg.eqpreset_default_file) | |
509 cfg.eqpreset_default_file = g_strdup(EQUALIZER_DEFAULT_DIR_PRESET); | |
510 | |
511 if (!cfg.eqpreset_extension) | |
512 cfg.eqpreset_extension = g_strdup(EQUALIZER_DEFAULT_PRESET_EXT); | |
513 } | |
514 | |
515 | |
516 void | |
517 bmp_config_save(void) | |
518 { | |
519 GList *node; | |
520 gchar *str; | |
521 gint i; | |
522 ConfigDb *db; | |
523 | |
524 cfg.disabled_iplugins = input_stringify_disabled_list(); | |
525 | |
526 | |
527 db = bmp_cfg_db_open(); | |
528 | |
529 for (i = 0; i < ncfgbent; ++i) | |
530 if (bmp_boolents[i].be_wrt) | |
531 bmp_cfg_db_set_bool(db, NULL, | |
532 bmp_boolents[i].be_vname, | |
533 *bmp_boolents[i].be_vloc); | |
534 | |
535 /* HACK: Work-around for bug #129 */ | |
80 | 536 /* |
0 | 537 bmp_cfg_db_set_bool(db, NULL, "playlist_shaded", |
538 FALSE); | |
80 | 539 */ |
0 | 540 for (i = 0; i < ncfgient; ++i) |
541 if (bmp_numents[i].ie_wrt) | |
542 bmp_cfg_db_set_int(db, NULL, | |
543 bmp_numents[i].ie_vname, | |
544 *bmp_numents[i].ie_vloc); | |
545 | |
546 /* This is a bit lame .. it'll end up being written twice, | |
547 * could do with being done a bit neater. -larne */ | |
548 bmp_cfg_db_set_int(db, NULL, "playlist_position", | |
549 playlist_get_position()); | |
550 | |
207
e152a92d3f45
[svn] Save the preference to enable or disable bitmap fonts.
nenolod
parents:
198
diff
changeset
|
551 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
|
552 cfg.mainwin_use_xfont); |
e152a92d3f45
[svn] Save the preference to enable or disable bitmap fonts.
nenolod
parents:
198
diff
changeset
|
553 |
0 | 554 for (i = 0; i < ncfgsent; ++i) { |
555 if (bmp_strents[i].se_wrt) | |
556 bmp_cfg_db_set_string(db, NULL, | |
557 bmp_strents[i].se_vname, | |
558 *bmp_strents[i].se_vloc); | |
559 } | |
560 | |
561 bmp_cfg_db_set_float(db, NULL, "equalizer_preamp", cfg.equalizer_preamp); | |
562 | |
563 for (i = 0; i < 10; i++) { | |
564 str = g_strdup_printf("equalizer_band%d", i); | |
565 bmp_cfg_db_set_float(db, NULL, str, cfg.equalizer_bands[i]); | |
566 g_free(str); | |
567 } | |
568 | |
196 | 569 if (bmp_active_skin != NULL) |
570 { | |
571 if (bmp_active_skin->path) | |
572 bmp_cfg_db_set_string(db, NULL, "skin", bmp_active_skin->path); | |
573 else | |
574 bmp_cfg_db_unset_key(db, NULL, "skin"); | |
575 } | |
0 | 576 |
577 if (get_current_output_plugin()) | |
578 bmp_cfg_db_set_string(db, NULL, "output_plugin", | |
579 get_current_output_plugin()->filename); | |
580 else | |
581 bmp_cfg_db_unset_key(db, NULL, "output_plugin"); | |
582 | |
583 str = general_stringify_enabled_list(); | |
584 if (str) { | |
585 bmp_cfg_db_set_string(db, NULL, "enabled_gplugins", str); | |
586 g_free(str); | |
587 } | |
588 else | |
589 bmp_cfg_db_unset_key(db, NULL, "enabled_gplugins"); | |
590 | |
591 str = vis_stringify_enabled_list(); | |
592 if (str) { | |
593 bmp_cfg_db_set_string(db, NULL, "enabled_vplugins", str); | |
594 g_free(str); | |
595 } | |
596 else | |
597 bmp_cfg_db_unset_key(db, NULL, "enabled_vplugins"); | |
598 | |
599 str = effect_stringify_enabled_list(); | |
600 if (str) { | |
601 bmp_cfg_db_set_string(db, NULL, "enabled_eplugins", str); | |
602 g_free(str); | |
603 } | |
604 else | |
605 bmp_cfg_db_unset_key(db, NULL, "enabled_eplugins"); | |
606 | |
607 if (cfg.filesel_path) | |
608 bmp_cfg_db_set_string(db, NULL, "filesel_path", cfg.filesel_path); | |
609 | |
610 if (cfg.playlist_path) | |
611 bmp_cfg_db_set_string(db, NULL, "playlist_path", cfg.playlist_path); | |
612 | |
613 bmp_cfg_db_set_int(db, NULL, "url_history_length", | |
614 g_list_length(cfg.url_history)); | |
615 | |
616 for (node = cfg.url_history, i = 1; node; node = g_list_next(node), i++) { | |
617 str = g_strdup_printf("url_history%d", i); | |
618 bmp_cfg_db_set_string(db, NULL, str, node->data); | |
619 g_free(str); | |
620 } | |
621 | |
622 bmp_cfg_db_close(db); | |
623 | |
624 playlist_save(bmp_paths[BMP_PATH_PLAYLIST_FILE], FALSE); | |
625 } | |
626 | |
627 static void | |
628 bmp_set_default_icon(void) | |
629 { | |
630 GdkPixbuf *icon; | |
631 | |
120 | 632 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) audacious_player_xpm); |
0 | 633 gtk_window_set_default_icon(icon); |
634 g_object_unref(icon); | |
635 } | |
636 | |
637 static void | |
638 display_usage(void) | |
639 { | |
44 | 640 g_print(_("Usage: audacious [options] [files] ...\n\n" |
0 | 641 "Options:\n" |
642 "--------\n")); | |
643 g_print("\n-h, --help "); | |
644 /* -h, --help switch */ | |
645 g_print(_("Display this text and exit")); | |
646 g_print("\n-n, --session "); | |
647 /* -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
|
648 g_print(_("Select Audacious/BMP/XMMS session (Default: 0)")); |
0 | 649 g_print("\n-r, --rew "); |
650 /* -r, --rew switch */ | |
651 g_print(_("Skip backwards in playlist")); | |
652 g_print("\n-p, --play "); | |
653 /* -p, --play switch */ | |
654 g_print(_("Start playing current playlist")); | |
655 g_print("\n-u, --pause "); | |
656 /* -u, --pause switch */ | |
657 g_print(_("Pause current song")); | |
658 g_print("\n-s, --stop "); | |
659 /* -s, --stop switch */ | |
660 g_print(_("Stop current song")); | |
661 g_print("\n-t, --play-pause "); | |
662 /* -t, --play-pause switch */ | |
663 g_print(_("Pause if playing, play otherwise")); | |
664 g_print("\n-f, --fwd "); | |
665 /* -f, --fwd switch */ | |
666 g_print(_("Skip forward in playlist")); | |
667 g_print("\n-e, --enqueue "); | |
668 /* -e, --enqueue switch */ | |
669 g_print(_("Don't clear the playlist")); | |
670 g_print("\n-m, --show-main-window "); | |
671 /* -m, --show-main-window switch */ | |
672 g_print(_("Show the main window")); | |
673 g_print("\n-a, --activate "); | |
674 /* -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
|
675 g_print(_("Activate Audacious")); |
0 | 676 g_print("\n-i, --sm-client-id "); |
677 /* -i, --sm-client-id switch */ | |
678 g_print(_("Previous session ID")); | |
316
950f104f2e11
[svn] Fix spacing in --help output, patch by Mikachu.
chainsaw
parents:
284
diff
changeset
|
679 g_print("\n-H, --headless "); |
193 | 680 /* -h, --headless switch */ |
681 g_print(_("Headless operation [experimental]")); | |
0 | 682 g_print("\n-v, --version "); |
683 /* -v, --version switch */ | |
684 g_print(_("Print version number and exit\n")); | |
685 | |
686 exit(EXIT_SUCCESS); | |
687 } | |
688 | |
689 static void | |
690 parse_cmd_line(gint argc, | |
691 gchar ** argv, | |
692 BmpCmdLineOpt * options) | |
693 { | |
694 static struct option long_options[] = { | |
695 {"help", 0, NULL, 'h'}, | |
696 {"session", 1, NULL, 'n'}, | |
697 {"rew", 0, NULL, 'r'}, | |
698 {"play", 0, NULL, 'p'}, | |
699 {"pause", 0, NULL, 'u'}, | |
700 {"play-pause", 0, NULL, 't'}, | |
701 {"stop", 0, NULL, 's'}, | |
702 {"fwd", 0, NULL, 'f'}, | |
703 {"enqueue", 0, NULL, 'e'}, | |
704 {"show-main-window", 0, NULL, 'm'}, | |
705 {"activate", 0, NULL, 'a'}, | |
706 {"version", 0, NULL, 'v'}, | |
707 {"sm-client-id", 1, NULL, 'i'}, | |
708 {"xmms", 0, NULL, 'x'}, | |
191 | 709 {"headless", 0, NULL, 'H'}, |
0 | 710 {0, 0, 0, 0} |
711 }; | |
712 | |
713 gchar *filename, *current_dir; | |
714 gint c, i; | |
715 | |
716 memset(options, 0, sizeof(BmpCmdLineOpt)); | |
717 options->session = -1; | |
718 | |
191 | 719 while ((c = getopt_long(argc, argv, "chn:HrpusfemavtLS", long_options, |
0 | 720 NULL)) != -1) { |
721 switch (c) { | |
722 case 'h': | |
723 display_usage(); | |
724 break; | |
725 case 'n': | |
726 options->session = atoi(optarg); | |
727 break; | |
191 | 728 case 'H': |
729 options->headless = TRUE; | |
730 break; | |
0 | 731 case 'r': |
732 options->rew = TRUE; | |
733 break; | |
734 case 'p': | |
735 options->play = TRUE; | |
736 break; | |
737 case 'u': | |
738 options->pause = TRUE; | |
739 break; | |
740 case 's': | |
741 options->stop = TRUE; | |
742 break; | |
743 case 'f': | |
744 options->fwd = TRUE; | |
745 break; | |
746 case 't': | |
747 options->play_pause = TRUE; | |
748 break; | |
749 case 'm': | |
750 options->mainwin = TRUE; | |
751 break; | |
752 case 'a': | |
753 options->activate = TRUE; | |
754 break; | |
755 case 'e': | |
756 options->enqueue = TRUE; | |
757 break; | |
758 case 'v': | |
759 dump_version(); | |
760 exit(EXIT_SUCCESS); | |
761 break; | |
762 case 'i': | |
763 options->previous_session_id = g_strdup(optarg); | |
764 break; | |
765 case 'c': | |
766 options->playcd = TRUE; | |
767 break; | |
768 case 'S': | |
769 options->load_skins = TRUE; | |
770 break; | |
771 } | |
772 } | |
773 | |
774 current_dir = g_get_current_dir(); | |
775 | |
776 for (i = optind; i < argc; i++) { | |
777 if (argv[i][0] == '/' || strstr(argv[i], "://")) | |
778 filename = g_strdup(argv[i]); | |
779 else | |
780 filename = g_build_filename(current_dir, argv[i], NULL); | |
781 | |
782 options->filenames = g_list_prepend(options->filenames, filename); | |
783 } | |
784 | |
785 options->filenames = g_list_reverse(options->filenames); | |
786 | |
787 g_free(current_dir); | |
788 } | |
789 | |
790 static void | |
791 handle_cmd_line_options(BmpCmdLineOpt * options, | |
792 gboolean remote) | |
793 { | |
794 GList *filenames = options->filenames; | |
795 gint session = options->session; | |
796 | |
797 if (session == -1) { | |
798 if (!remote) | |
799 session = ctrlsocket_get_session_id(); | |
800 else | |
801 session = 0; | |
802 } | |
803 | |
804 if (filenames) { | |
805 gint pos = 0; | |
806 | |
807 if (options->load_skins) { | |
808 xmms_remote_set_skin(session, filenames->data); | |
809 skin_install_skin(filenames->data); | |
810 } | |
811 else { | |
812 if (options->enqueue && options->play) | |
813 pos = xmms_remote_get_playlist_length(session); | |
814 | |
815 if (!options->enqueue) | |
816 xmms_remote_playlist_clear(session); | |
817 | |
818 xmms_remote_playlist_add(session, filenames); | |
819 | |
820 if (options->enqueue && options->play && | |
821 xmms_remote_get_playlist_length(session) > pos) | |
822 xmms_remote_set_playlist_pos(session, pos); | |
823 | |
824 if (!options->enqueue) | |
825 xmms_remote_play(session); | |
826 } | |
827 | |
828 g_list_foreach(filenames, (GFunc) g_free, NULL); | |
829 g_list_free(filenames); | |
830 } | |
831 | |
832 if (options->rew) | |
833 xmms_remote_playlist_prev(session); | |
834 | |
835 if (options->play) | |
836 xmms_remote_play(session); | |
837 | |
838 if (options->pause) | |
839 xmms_remote_pause(session); | |
840 | |
841 if (options->stop) | |
842 xmms_remote_stop(session); | |
843 | |
844 if (options->fwd) | |
845 xmms_remote_playlist_next(session); | |
846 | |
847 if (options->play_pause) | |
848 xmms_remote_play_pause(session); | |
849 | |
850 if (options->mainwin) | |
851 xmms_remote_main_win_toggle(session, TRUE); | |
852 | |
853 if (options->activate) | |
854 xmms_remote_activate(session); | |
855 | |
856 if (options->playcd) | |
857 play_medium(); | |
858 } | |
859 | |
860 static void | |
861 segfault_handler(gint sig) | |
862 { | |
863 g_printerr(_("\nReceived SIGSEGV\n\n" | |
27
d160ae2251e9
[svn] Update SIGSEGV message, contained the BMP mailing information.
nenolod
parents:
0
diff
changeset
|
864 "This could be a bug in Audacious. If you don't know why this happened, " |
d160ae2251e9
[svn] Update SIGSEGV message, contained the BMP mailing information.
nenolod
parents:
0
diff
changeset
|
865 "file a bug at http://bugs.nenolod.net/\n\n")); |
0 | 866 #ifdef HANDLE_SIGSEGV |
867 exit(EXIT_FAILURE); | |
868 #else | |
869 abort(); | |
870 #endif | |
871 } | |
872 | |
873 static void | |
874 bmp_setup_logger(void) | |
875 { | |
876 if (!bmp_logger_start(bmp_paths[BMP_PATH_LOG_FILE])) | |
877 return; | |
878 | |
879 g_atexit(bmp_logger_stop); | |
880 } | |
881 | |
882 static void | |
883 run_load_skin_error_dialog(const gchar * skin_path) | |
884 { | |
885 const gchar *markup = | |
886 N_("<b><big>Unable to load skin.</big></b>\n" | |
887 "\n" | |
888 "Check that skin at '%s' is usable and default skin is properly " | |
889 "installed at '%s'\n"); | |
890 | |
891 GtkWidget *dialog = | |
892 gtk_message_dialog_new_with_markup(NULL, | |
893 GTK_DIALOG_MODAL, | |
894 GTK_MESSAGE_ERROR, | |
895 GTK_BUTTONS_CLOSE, | |
896 _(markup), | |
897 skin_path, | |
898 BMP_DEFAULT_SKIN_PATH); | |
899 gtk_dialog_run(GTK_DIALOG(dialog)); | |
900 gtk_widget_destroy(dialog); | |
901 } | |
902 | |
903 gint | |
904 main(gint argc, gchar ** argv) | |
905 { | |
906 BmpCmdLineOpt options; | |
44 | 907 gboolean gtk_init_check_ok; |
0 | 908 |
909 /* Setup l10n early so we can print localized error messages */ | |
910 gtk_set_locale(); | |
911 bindtextdomain(PACKAGE, LOCALEDIR); | |
912 bind_textdomain_codeset(PACKAGE, "UTF-8"); | |
913 textdomain(PACKAGE); | |
914 | |
915 bmp_init_paths(); | |
916 bmp_make_user_dir(); | |
917 bmp_setup_logger(); | |
918 | |
919 /* Check GTK version. Really, this is only needed for binary | |
920 * distribution since configure already checks. */ | |
921 if (!GTK_CHECK_VERSION(2, 4, 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
|
922 g_printerr(_("Sorry, your GTK+ version (%d.%d.%d) does not work with Audacious.\n" |
0 | 923 "Please use GTK+ %s or newer.\n"), |
924 gtk_major_version, gtk_minor_version, gtk_micro_version, | |
925 "2.4.0"); | |
926 exit(EXIT_FAILURE); | |
927 } | |
928 | |
929 g_set_application_name(_(application_name)); | |
930 | |
931 g_thread_init(NULL); | |
932 if (!g_thread_supported()) { | |
933 g_printerr(_("Sorry, threads isn't supported on your platform.\n\n" | |
934 "If you're on a libc5 based linux system and installed Glib & GTK+ before you\n" | |
935 "installed LinuxThreads you need to recompile Glib & GTK+.\n")); | |
936 exit(EXIT_FAILURE); | |
937 } | |
938 | |
939 gdk_threads_init(); | |
940 | |
44 | 941 gtk_init_check_ok = gtk_init_check(&argc, &argv); |
942 /* Now let's parse the command line options first. */ | |
943 parse_cmd_line(argc, argv, &options); | |
944 if (!gtk_init_check_ok) { | |
945 // if (!gtk_init_check(&argc, &argv)) { | |
0 | 946 if (argc < 2) { |
947 /* GTK check failed, and no arguments passed to indicate | |
948 that user is intending to only remote control a running | |
949 session */ | |
44 | 950 g_printerr(_("audacious: Unable to open display, exiting.\n")); |
0 | 951 exit(EXIT_FAILURE); |
952 } | |
953 | |
954 handle_cmd_line_options(&options, TRUE); | |
191 | 955 |
956 /* we could be running headless, so GTK probably wont matter */ | |
957 if (options.headless != 1) | |
958 exit(EXIT_SUCCESS); | |
0 | 959 } |
960 | |
961 if (!vfs_init()) { | |
962 g_printerr(Q_("Could not initialize VFS.\n")); | |
963 exit(EXIT_FAILURE); | |
964 } | |
965 | |
966 signal(SIGPIPE, SIG_IGN); /* for controlsocket.c */ | |
967 signal(SIGSEGV, segfault_handler); | |
968 | |
969 g_random_set_seed(time(NULL)); | |
970 | |
971 bmp_config_load(); | |
972 | |
973 if (options.session != -1 || !ctrlsocket_setup()) { | |
974 handle_cmd_line_options(&options, TRUE); | |
975 exit(EXIT_SUCCESS); | |
976 } | |
977 | |
191 | 978 if (options.headless != 1) |
979 { | |
980 bmp_set_default_icon(); | |
0 | 981 |
191 | 982 gtk_accel_map_load(bmp_paths[BMP_PATH_ACCEL_FILE]); |
0 | 983 |
191 | 984 mainwin_create(); |
985 playlistwin_create(); | |
986 equalizerwin_create(); | |
0 | 987 |
191 | 988 if (!init_skins(cfg.skin)) { |
989 run_load_skin_error_dialog(cfg.skin); | |
990 exit(EXIT_FAILURE); | |
991 } | |
992 | |
993 GDK_THREADS_ENTER(); | |
0 | 994 } |
995 | |
996 plugin_system_init(); | |
997 | |
998 playlist_load(bmp_paths[BMP_PATH_PLAYLIST_FILE]); | |
999 playlist_set_position(cfg.playlist_position); | |
1000 | |
1001 /* this needs to be called after all 3 windows are created and | |
191 | 1002 * input plugins are setup'ed |
1003 * but not if we're running headless --nenolod | |
1004 */ | |
0 | 1005 mainwin_setup_menus(); |
1006 | |
191 | 1007 if (options.headless != 1) |
1008 GDK_THREADS_LEAVE(); | |
0 | 1009 |
1010 ctrlsocket_start(); | |
1011 | |
1012 handle_cmd_line_options(&options, FALSE); | |
1013 | |
191 | 1014 if (options.headless != 1) |
1015 { | |
1016 GDK_THREADS_ENTER(); | |
0 | 1017 |
191 | 1018 read_volume(VOLSET_STARTUP); |
1019 mainwin_set_info_text(); | |
1020 | |
1021 /* FIXME: delayed, because it deals directly with the plugin | |
1022 * interface to set menu items */ | |
1023 create_prefs_window(); | |
0 | 1024 |
191 | 1025 if (cfg.player_visible) |
1026 mainwin_show(TRUE); | |
1027 else if (!cfg.playlist_visible && !cfg.equalizer_visible) | |
1028 mainwin_show(TRUE); | |
125 | 1029 |
191 | 1030 if (cfg.equalizer_visible) |
1031 equalizerwin_show(TRUE); | |
1032 | |
1033 if (cfg.playlist_visible) | |
1034 playlistwin_show(); | |
0 | 1035 |
191 | 1036 hint_set_always(cfg.always_on_top); |
0 | 1037 |
191 | 1038 playlist_start_get_info_thread(); |
1039 mainwin_attach_idle_func(); | |
1040 | |
486 | 1041 starting_up = FALSE; |
1042 | |
191 | 1043 gtk_main(); |
1044 | |
1045 GDK_THREADS_LEAVE(); | |
0 | 1046 |
191 | 1047 return EXIT_SUCCESS; |
1048 } | |
1049 else | |
1050 { | |
1051 mainwin_set_info_text(); | |
1052 playlist_start_get_info_thread(); | |
0 | 1053 |
486 | 1054 starting_up = FALSE; |
1055 | |
191 | 1056 for (;;) |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
191
diff
changeset
|
1057 { |
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
|
1058 /* 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
|
1059 audcore_generic_events(); |
198 | 1060 free_vis_data(); /* to prevent buffer overflow -- paranoia */ |
191 | 1061 xmms_usleep(10000); |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
191
diff
changeset
|
1062 } |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
191
diff
changeset
|
1063 |
191 | 1064 return EXIT_SUCCESS; |
1065 } | |
0 | 1066 } |