annotate src/audacious/main.c @ 2690:62579e205746 trunk

[svn] - temporal workaround for a bug which introduced in r4360. without this patch, cuesheet plugin endlessly adds entries in a cue sheet to the current playlist.
author yaz
date Fri, 27 Apr 2007 10:22:03 -0700
parents c3cd6e47faf6
children c2b82432c1b6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1 /* Audacious - Cross-platform multimedia player
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
2 * Copyright (C) 2005-2007 Audacious development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
3 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
4 * Based on BMP:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
5 * Copyright (C) 2003-2004 BMP development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
6 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
7 * Based on XMMS:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
8 * Copyright (C) 1998-2003 XMMS development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
9 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
12 * the Free Software Foundation; under version 2 of the License.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
13 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
17 * GNU General Public License for more details.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
18 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
22 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
23
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24 #ifdef HAVE_CONFIG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25 # include "config.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28 #include "main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
31 #include <glib/gi18n.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
32 #include <glib/gprintf.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33 #include <gdk/gdk.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 #include <stdlib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 #include <getopt.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37 #include <ctype.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38 #include <time.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40 #include <unistd.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 #include <errno.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 #include <sys/types.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
43 #include <sys/stat.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44 #include <signal.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
46 #include "platform/smartinclude.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48 #include "libaudacious/configdb.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
49 #include "libaudacious/beepctrl.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
50 #include "vfs.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
52 #include "controlsocket.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
53 #include "dnd.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
54 #include "effect.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
55 #include "ui_equalizer.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56 #include "general.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
57 #include "genevent.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
58 #include "hints.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59 #include "input.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
60 #include "logger.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61 #include "ui_main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 #include "ui_manager.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63 #include "output.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
64 #include "playback.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
65 #include "playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
66 #include "ui_playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67 #include "ui_preferences.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68 #include "pluginenum.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
69 #include "ui_skinselector.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
70 #include "util.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
71 #include "visualization.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
72 #include "build_stamp.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
73 #include "ui_fileinfo.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
74 #include "signals.h"
2530
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
75 #include "ui_skinned_window.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
76
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
77 #include "icons-csource.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
78 #include "icons-stock.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
79 #include "images/audacious_player.xpm"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
80
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
81 gboolean has_x11_connection = FALSE; /* do we have an X11 connection? */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
82
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
83 /* Translatable string for beep.desktop's comment field */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
84 const gchar *desktop_comment = N_("Audacious");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
85
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
86 const gchar *application_name = N_("Audacious");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
87
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
88
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
89 struct _BmpCmdLineOpt {
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
90 gchar **filenames;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
91 gint session;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
92 gboolean play, stop, pause, fwd, rew, play_pause, playcd, show_jump_box;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
93 gboolean enqueue, mainwin, remote, activate;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
94 gboolean load_skins;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
95 gboolean headless;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
96 gboolean no_log;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
97 gboolean enqueue_to_temp;
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
98 gboolean version;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
99 gchar *previous_session_id;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
100 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
101
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
102 typedef struct _BmpCmdLineOpt BmpCmdLineOpt;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
103
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
104 BmpCmdLineOpt options;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
105
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
106 BmpConfig cfg;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
107
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
108 BmpConfig bmp_default_config = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
109 MAINWIN_DEFAULT_POS_X, /* mainwin x position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
110 MAINWIN_DEFAULT_POS_Y, /* mainwin y position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
111 EQUALIZER_DEFAULT_POS_X, /* equalizer x position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
112 EQUALIZER_DEFAULT_POS_Y, /* equalizer y position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
113 PLAYLISTWIN_DEFAULT_POS_X, /* playlistwin x position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
114 PLAYLISTWIN_DEFAULT_POS_Y, /* playlistwin y position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
115 PLAYLISTWIN_DEFAULT_WIDTH, /* playlistwin width */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
116 PLAYLISTWIN_DEFAULT_HEIGHT, /* playlistwin height */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
117 10, /* snap distance */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
118 FALSE, /* real-time priority */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
119 FALSE, FALSE, /* shuffle, repeat */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
120 FALSE, /* UNUSED (double size) */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
121 TRUE, /* autoscroll */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
122 TRUE, /* analyzer peaks */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
123 FALSE, /* equalizer autoload */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
124 FALSE, /* easy move */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
125 FALSE, /* equalizer active */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
126 FALSE, /* playlistwin visible */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
127 FALSE, /* equalizer visible */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
128 TRUE, /* player visible */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
129 FALSE, /* player shaded */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
130 FALSE, /* playlistwin shaded */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
131 FALSE, /* equalizer shaded */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
132 FALSE, /* allow multiple instances */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
133 TRUE, /* always show cb */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
134 TRUE, TRUE, TRUE, /* convert '_', %20 and '\' */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
135 TRUE, /* show numbers in playlist */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
136 TRUE, /* snap windows */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
137 TRUE, /* save window positions */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
138 TRUE, /* dim titlebar */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
139 FALSE, /* get playlist info on load */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
140 TRUE, /* get playlist info on demand */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
141 TRUE, /* UNUSED (equalizer doublesize linked) */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142 FALSE, /* sort jump to file */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
143 FALSE, /* use effect plugins */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
144 FALSE, /* always on top */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
145 FALSE, /* sticky */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
146 FALSE, /* no playlist advance */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
147 FALSE, /* stop after current song */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
148 TRUE, /* refresh file list */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
149 TRUE, /* UNUSED (smooth title scrolling) */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
150 TRUE, /* use playlist metadata */
2662
09b404d61ebd [svn] - remove the unplayable files dialog. it is more annoying than useful.
nenolod
parents: 2651
diff changeset
151 TRUE, /* deprecated */
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
152 TRUE, /* warn about windows visibility */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
153 FALSE, /* use \ as directory delimiter */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
154 FALSE, /* random skin on play */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
155 FALSE, /* use fontsets */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
156 FALSE, /* use X font for mainwin */
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
157 TRUE, /* use custom cursors */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
158 TRUE, /* close dialog on open */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
159 TRUE, /* close dialog on add */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
160 0.0, /* equalizer preamp */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
161 {0, 0, 0, 0, 0, /* equalizer bands */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
162 0, 0, 0, 0, 0},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
163 NULL, /* skin */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
164 NULL, /* output plugin */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
165 NULL, /* file selector path */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
166 NULL, /* playlist path */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
167 NULL, /* playlist font */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
168 NULL, /* mainwin font */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
169 NULL, /* disabled input plugins */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
170 NULL, /* enabled general plugins */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
171 NULL, /* enabled visualization plugins */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
172 NULL, /* enabled effect plugins */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
173 NULL, /* equalizer preset default file */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
174 NULL, /* equalizer preset extension */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
175 NULL, /* URL history */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
176 0, /* timer mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
177 VIS_ANALYZER, /* visualizer type */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
178 ANALYZER_NORMAL, /* analyzer mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
179 ANALYZER_BARS, /* analyzer type */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
180 SCOPE_DOT, /* scope mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
181 VOICEPRINT_NORMAL, /* voiceprint mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
182 VU_SMOOTH, /* VU mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
183 REFRESH_FULL, /* visualizer refresh rate */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
184 FALLOFF_FAST, /* analyzer fall off rate */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
185 FALLOFF_SLOW, /* peaks fall off rate */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
186 0, /* playlist position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
187 2, /* pause between songs time */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
188 FALSE, /* pause between songs */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
189 FALSE, /* show window decorations */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
190 8, /* mouse wheel scroll step */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
191 FALSE, /* playlist transparent */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
192 2, /* 3rd preset (ARTIST - ALBUM - TITLE) */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
193 NULL, /* title format */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
194 FALSE, /* software volume control enabled */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
195 TRUE, /* UNUSED (XMMS compatibility mode) */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
196 TRUE, /* extra eq filtering */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
197 3, /* scroll pl by */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
198 FALSE, /* resume playback on startup */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
199 -1, /* resume playback on startup time */
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
200 TRUE, /* show seperators in pl */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
201 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
202 NULL,
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
203 3000, /* audio buffer size */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
204 FALSE, /* whether or not to postpone format detection on initial add */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
205 TRUE, /* show filepopup for tuple */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
206 NULL, /* words identifying covers */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
207 NULL, /* words that might not show up in cover names */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
208 FALSE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
209 0,
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
210 NULL, /* default session uri base (non-NULL = custom session uri base) */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
211 150, /* short side length of the picture in the filepopup */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
212 20, /* delay until the filepopup comes up */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
213 FALSE, /* use filename.jpg for coverart */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
214 FALSE, /* use XMMS-style file selection */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
215 TRUE, /* use extension probing */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
216 255, 255, 255, /* colorize r, g, b */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
217 FALSE, /* internal: whether or not to terminate */
2405
15fc0d852633 [svn] enhancement to popup information settings
yaz
parents: 2388
diff changeset
218 TRUE, /* whether show progress bar in filepopup or not */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
219 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
220
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
221 typedef struct bmp_cfg_boolent_t {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
222 char const *be_vname;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
223 gboolean *be_vloc;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
224 gboolean be_wrt;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
225 } bmp_cfg_boolent;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
226
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
227 typedef struct bmp_cfg_nument_t {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
228 char const *ie_vname;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
229 gint *ie_vloc;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
230 gboolean ie_wrt;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
231 } bmp_cfg_nument;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
232
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
233 typedef struct bmp_cfg_strent_t {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
234 char const *se_vname;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
235 char **se_vloc;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
236 gboolean se_wrt;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
237 } bmp_cfg_strent;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
238
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
239 const gchar *bmp_titlestring_presets[] = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
240 "%t",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
241 "%{p:%p - %}%t",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
242 "%{p:%p - %}%{a:%a - %}%t",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
243 "%{p:%p - %}%{a:%a - %}%{n:%n. %}%t",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
244 "%{p:%p %}%{a:[ %a ] %}%{p:- %}%{n:%n. %}%{t:%t%}",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
245 "%{a:%a - %}%t"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
246 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
247
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
248 const guint n_titlestring_presets = G_N_ELEMENTS(bmp_titlestring_presets);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
249
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
250 const gchar *chardet_detector_presets[] = {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
251 "None",
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
252 "Japanese",
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
253 "Taiwanese",
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
254 "Chinese",
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
255 "Korean",
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
256 "Russian",
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
257 #ifdef HAVE_UDET
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
258 "Universal"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
259 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
260 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
261
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
262 const guint n_chardet_detector_presets = G_N_ELEMENTS(chardet_detector_presets);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
263
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
264 static bmp_cfg_boolent bmp_boolents[] = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
265 {"allow_multiple_instances", &cfg.allow_multiple_instances, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
266 {"use_realtime", &cfg.use_realtime, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
267 {"always_show_cb", &cfg.always_show_cb, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
268 {"convert_underscore", &cfg.convert_underscore, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
269 {"convert_twenty", &cfg.convert_twenty, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
270 {"convert_slash", &cfg.convert_slash, TRUE },
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
271 {"show_numbers_in_pl", &cfg.show_numbers_in_pl, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
272 {"show_separator_in_pl", &cfg.show_separator_in_pl, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
273 {"snap_windows", &cfg.snap_windows, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
274 {"save_window_positions", &cfg.save_window_position, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
275 {"dim_titlebar", &cfg.dim_titlebar, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
276 {"get_info_on_load", &cfg.get_info_on_load, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
277 {"get_info_on_demand", &cfg.get_info_on_demand, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
278 {"eq_doublesize_linked", &cfg.eq_doublesize_linked, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
279 {"no_playlist_advance", &cfg.no_playlist_advance, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
280 {"refresh_file_list", &cfg.refresh_file_list, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
281 {"sort_jump_to_file", &cfg.sort_jump_to_file, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
282 {"use_pl_metadata", &cfg.use_pl_metadata, TRUE},
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
283 {"warn_about_win_visibility", &cfg.warn_about_win_visibility, TRUE},
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
284 {"use_backslash_as_dir_delimiter", &cfg.use_backslash_as_dir_delimiter, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
285 {"player_shaded", &cfg.player_shaded, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
286 {"player_visible", &cfg.player_visible, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
287 {"shuffle", &cfg.shuffle, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
288 {"repeat", &cfg.repeat, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
289 {"doublesize", &cfg.doublesize, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
290 {"autoscroll_songname", &cfg.autoscroll, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
291 {"stop_after_current_song", &cfg.stopaftersong, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
292 {"playlist_shaded", &cfg.playlist_shaded, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
293 {"playlist_visible", &cfg.playlist_visible, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
294 {"use_fontsets", &cfg.use_fontsets, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
295 {"mainwin_use_xfont", &cfg.mainwin_use_xfont, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
296 {"equalizer_visible", &cfg.equalizer_visible, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
297 {"equalizer_active", &cfg.equalizer_active, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
298 {"equalizer_shaded", &cfg.equalizer_shaded, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
299 {"equalizer_autoload", &cfg.equalizer_autoload, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
300 {"easy_move", &cfg.easy_move, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
301 {"use_eplugins", &cfg.use_eplugins, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
302 {"always_on_top", &cfg.always_on_top, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
303 {"sticky", &cfg.sticky, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
304 {"random_skin_on_play", &cfg.random_skin_on_play, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
305 {"pause_between_songs", &cfg.pause_between_songs, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
306 {"show_wm_decorations", &cfg.show_wm_decorations, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
307 {"eq_extra_filtering", &cfg.eq_extra_filtering, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
308 {"analyzer_peaks", &cfg.analyzer_peaks, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
309 {"custom_cursors", &cfg.custom_cursors, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
310 {"close_dialog_open", &cfg.close_dialog_open, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
311 {"close_dialog_add", &cfg.close_dialog_add, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
312 {"resume_playback_on_startup", &cfg.resume_playback_on_startup, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
313 {"playlist_detect", &cfg.playlist_detect, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
314 {"show_filepopup_for_tuple", &cfg.show_filepopup_for_tuple, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
315 {"recurse_for_cover", &cfg.recurse_for_cover, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
316 {"use_file_cover", &cfg.use_file_cover, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
317 {"use_xmms_style_fileselector", &cfg.use_xmms_style_fileselector, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
318 {"use_extension_probing", &cfg.use_extension_probing, TRUE},
2405
15fc0d852633 [svn] enhancement to popup information settings
yaz
parents: 2388
diff changeset
319 {"filepopup_showprogressbar", &cfg.filepopup_showprogressbar, TRUE},
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
320 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
321
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
322 static gint ncfgbent = G_N_ELEMENTS(bmp_boolents);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
323
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
324 static bmp_cfg_nument bmp_numents[] = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
325 {"player_x", &cfg.player_x, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
326 {"player_y", &cfg.player_y, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
327 {"timer_mode", &cfg.timer_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
328 {"vis_type", &cfg.vis_type, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
329 {"analyzer_mode", &cfg.analyzer_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
330 {"analyzer_type", &cfg.analyzer_type, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
331 {"scope_mode", &cfg.scope_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
332 {"vu_mode", &cfg.vu_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
333 {"voiceprint_mode", &cfg.voiceprint_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
334 {"vis_refresh_rate", &cfg.vis_refresh, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
335 {"analyzer_falloff", &cfg.analyzer_falloff, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
336 {"peaks_falloff", &cfg.peaks_falloff, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
337 {"playlist_x", &cfg.playlist_x, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
338 {"playlist_y", &cfg.playlist_y, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
339 {"playlist_width", &cfg.playlist_width, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
340 {"playlist_height", &cfg.playlist_height, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
341 {"playlist_position", &cfg.playlist_position, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
342 {"equalizer_x", &cfg.equalizer_x, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
343 {"equalizer_y", &cfg.equalizer_y, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
344 {"snap_distance", &cfg.snap_distance, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
345 {"pause_between_songs_time", &cfg.pause_between_songs_time, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
346 {"mouse_wheel_change", &cfg.mouse_change, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
347 {"scroll_pl_by", &cfg.scroll_pl_by, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
348 {"titlestring_preset", &cfg.titlestring_preset, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
349 {"resume_playback_on_startup_time", &cfg.resume_playback_on_startup_time, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
350 {"output_buffer_size", &cfg.output_buffer_size, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
351 {"recurse_for_cover_depth", &cfg.recurse_for_cover_depth, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
352 {"filepopup_pixelsize", &cfg.filepopup_pixelsize, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
353 {"filepopup_delay", &cfg.filepopup_delay, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
354 {"colorize_r", &cfg.colorize_r, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
355 {"colorize_g", &cfg.colorize_g, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
356 {"colorize_b", &cfg.colorize_b, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
357 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
358
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
359 static gint ncfgient = G_N_ELEMENTS(bmp_numents);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
360
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
361 static bmp_cfg_strent bmp_strents[] = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
362 {"playlist_font", &cfg.playlist_font, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
363 {"mainwin_font", &cfg.mainwin_font, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
364 {"eqpreset_default_file", &cfg.eqpreset_default_file, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
365 {"eqpreset_extension", &cfg.eqpreset_extension, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
366 {"skin", &cfg.skin, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
367 {"output_plugin", &cfg.outputplugin, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
368 {"disabled_iplugins", &cfg.disabled_iplugins, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
369 {"enabled_gplugins", &cfg.enabled_gplugins, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
370 {"enabled_vplugins", &cfg.enabled_vplugins, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
371 {"enabled_eplugins", &cfg.enabled_eplugins, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
372 {"filesel_path", &cfg.filesel_path, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
373 {"playlist_path", &cfg.playlist_path, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
374 {"generic_title_format", &cfg.gentitle_format, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
375 {"chardet_detector", &cfg.chardet_detector, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
376 {"chardet_fallback", &cfg.chardet_fallback, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
377 {"cover_name_include", &cfg.cover_name_include, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
378 {"cover_name_exclude", &cfg.cover_name_exclude, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
379 {"session_uri_base", &cfg.session_uri_base, TRUE}
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
380 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
381
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
382 static gint ncfgsent = G_N_ELEMENTS(bmp_strents);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
383
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
384 gchar *bmp_paths[BMP_PATH_COUNT] = {};
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
385
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
386 GList *dock_window_list = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
387
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
388 gboolean pposition_broken = FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
389
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
390 gboolean starting_up = TRUE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
391
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
392 /* XXX: case-sensitivity is bad for lazy nenolods. :( -nenolod */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
393 static gchar *pl_candidates[] = {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
394 PLUGIN_FILENAME("ALSA"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
395 PLUGIN_FILENAME("coreaudio"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
396 PLUGIN_FILENAME("OSS"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
397 PLUGIN_FILENAME("sun"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
398 PLUGIN_FILENAME("ESD"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
399 PLUGIN_FILENAME("pulse_audio"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
400 PLUGIN_FILENAME("disk_writer"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
401 NULL
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
402 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
403
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
404 GCond *cond_scan;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
405 GMutex *mutex_scan;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
406
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
407 static GSList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
408 get_feature_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
409 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
410 GSList *features = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
411
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
412 #ifdef HAVE_GCONF
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
413 features = g_slist_append(features, "GConf");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
414 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
415
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
416 return features;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
417 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
418
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
419 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
420 dump_version(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
421 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
422 GSList *features;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
423
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
424 g_printf("%s %s [%s]", _(application_name), VERSION, svn_stamp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
425
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
426 features = get_feature_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
427
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
428 if (features) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
429 GSList *item;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
430
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
431 g_printf(" (");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
432
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
433 for (item = features; g_slist_next(item); item = g_slist_next(item))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
434 g_printf("%s, ", (const gchar *) item->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
435
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
436 g_printf("%s)", (const gchar *) item->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
437
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
438 g_slist_free(features);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
439 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
440
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
441 g_printf("\n");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
442 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
443
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
444 const gchar *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
445 xmms_get_gentitle_format(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
446 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
447 guint titlestring_preset = cfg.titlestring_preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
448
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
449 if (titlestring_preset < n_titlestring_presets)
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
450 return bmp_titlestring_presets[titlestring_preset];
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
451
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
452 return cfg.gentitle_format;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
453 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
454
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
455 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
456 make_directory(const gchar * path, mode_t mode)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
457 {
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
458 if (g_mkdir_with_parents(path, mode) == 0)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
459 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
460
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
461 g_printerr(_("Could not create directory (%s): %s\n"), path,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
462 g_strerror(errno));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
463 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
464
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
465 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
466 bmp_make_user_dir(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
467 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
468 const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
469
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
470 make_directory(bmp_paths[BMP_PATH_USER_DIR], mode755);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
471 make_directory(bmp_paths[BMP_PATH_USER_PLUGIN_DIR], mode755);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
472 make_directory(bmp_paths[BMP_PATH_USER_SKIN_DIR], mode755);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
473 make_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR], mode755);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
474 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
475
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
476 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
477 bmp_free_paths(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
478 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
479 int i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
480
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
481 for (i = 0; i < BMP_PATH_COUNT; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
482 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
483 g_free(bmp_paths[i]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
484 bmp_paths[i] = 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
485 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
486 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
487
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
488 static void
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
489 bmp_init_paths()
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
490 {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
491 char *xdg_config_home;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
492 char *xdg_data_home;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
493 char *xdg_cache_home;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
494
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
495 xdg_config_home = (getenv("XDG_CONFIG_HOME") == NULL
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
496 ? g_build_filename(g_get_home_dir(), ".config", NULL)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
497 : g_strdup(getenv("XDG_CONFIG_HOME")));
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
498 xdg_data_home = (getenv("XDG_DATA_HOME") == NULL
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
499 ? g_build_filename(g_get_home_dir(), ".local", "share", NULL)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
500 : g_strdup(getenv("XDG_DATA_HOME")));
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
501 xdg_cache_home = (getenv("XDG_CACHE_HOME") == NULL
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
502 ? g_build_filename(g_get_home_dir(), ".cache", NULL)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
503 : g_strdup(getenv("XDG_CACHE_HOME")));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
504
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
505 bmp_paths[BMP_PATH_USER_DIR] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
506 g_build_filename(xdg_config_home, "audacious", NULL);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
507 bmp_paths[BMP_PATH_USER_SKIN_DIR] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
508 g_build_filename(xdg_data_home, "audacious", "Skins", NULL);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
509 bmp_paths[BMP_PATH_USER_PLUGIN_DIR] =
2506
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
510 g_build_filename(xdg_data_home, "audacious", "Plugins", NULL);
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
511
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
512 bmp_paths[BMP_PATH_SKIN_THUMB_DIR] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
513 g_build_filename(xdg_cache_home, "audacious", "thumbs", NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
514
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
515 bmp_paths[BMP_PATH_CONFIG_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
516 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "config", NULL);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
517 #ifdef HAVE_XSPF_PLAYLIST
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
518 bmp_paths[BMP_PATH_PLAYLIST_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
519 g_build_filename(bmp_paths[BMP_PATH_USER_DIR],
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
520 "playlist.xspf", NULL);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
521 #else
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
522 bmp_paths[BMP_PATH_PLAYLIST_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
523 g_build_filename(bmp_paths[BMP_PATH_USER_DIR],
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
524 "playlist.m3u", NULL);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
525 #endif
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
526 bmp_paths[BMP_PATH_ACCEL_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
527 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "accels", NULL);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
528 bmp_paths[BMP_PATH_LOG_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
529 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "log", NULL);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
530
2463
e32be86095aa [svn] - re-add support for gtkrc files
nenolod
parents: 2461
diff changeset
531 bmp_paths[BMP_PATH_GTKRC_FILE] =
2570
7b1b52eb663b [svn] - Minor cleanups
mf0102
parents: 2551
diff changeset
532 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "gtkrc", NULL);
2463
e32be86095aa [svn] - re-add support for gtkrc files
nenolod
parents: 2461
diff changeset
533
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
534 g_free(xdg_config_home);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
535 g_free(xdg_data_home);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
536 g_free(xdg_cache_home);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
537
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
538 g_atexit(bmp_free_paths);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
539 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
540
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
541 void
2682
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
542 bmp_config_free(void)
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
543 {
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
544 gint i;
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
545 for (i = 0; i < ncfgsent; ++i) {
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
546 if ( *(bmp_strents[i].se_vloc) != NULL )
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
547 {
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
548 g_free( *(bmp_strents[i].se_vloc) );
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
549 *(bmp_strents[i].se_vloc) = NULL;
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
550 }
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
551 }
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
552 }
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
553
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
554 void
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
555 bmp_config_load(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
556 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
557 ConfigDb *db;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
558 gint i, length;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
559
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
560 memcpy(&cfg, &bmp_default_config, sizeof(BmpConfig));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
561
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
562 db = bmp_cfg_db_open();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
563 for (i = 0; i < ncfgbent; ++i) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
564 bmp_cfg_db_get_bool(db, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
565 bmp_boolents[i].be_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
566 bmp_boolents[i].be_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
567 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
568
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
569 for (i = 0; i < ncfgient; ++i) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
570 bmp_cfg_db_get_int(db, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
571 bmp_numents[i].ie_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
572 bmp_numents[i].ie_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
573 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
574
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
575 for (i = 0; i < ncfgsent; ++i) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
576 bmp_cfg_db_get_string(db, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
577 bmp_strents[i].se_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
578 bmp_strents[i].se_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
579 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
580
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
581 /* Preset */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
582 bmp_cfg_db_get_float(db, NULL, "equalizer_preamp", &cfg.equalizer_preamp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
583 for (i = 0; i < 10; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
584 gchar eqtext[18];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
585
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
586 g_snprintf(eqtext, sizeof(eqtext), "equalizer_band%d", i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
587 bmp_cfg_db_get_float(db, NULL, eqtext, &cfg.equalizer_bands[i]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
588 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
589
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
590 /* History */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
591 if (bmp_cfg_db_get_int(db, NULL, "url_history_length", &length)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
592 for (i = 1; i <= length; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
593 gchar str[19], *tmp;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
594
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
595 g_snprintf(str, sizeof(str), "url_history%d", i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
596 if (bmp_cfg_db_get_string(db, NULL, str, &tmp))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
597 cfg.url_history = g_list_append(cfg.url_history, tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
598 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
599 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
600
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
601 bmp_cfg_db_close(db);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
602
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
603
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
604 if (cfg.playlist_font && strlen(cfg.playlist_font) == 0) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
605 g_free(cfg.playlist_font);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
606 cfg.playlist_font = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
607 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
608
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
609 if (cfg.mainwin_font && strlen(cfg.mainwin_font) == 0) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
610 g_free(cfg.mainwin_font);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
611 cfg.mainwin_font = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
612 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
613
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
614 if (!cfg.playlist_font)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
615 cfg.playlist_font = g_strdup(PLAYLISTWIN_DEFAULT_FONT);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
616
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
617 if (!cfg.mainwin_font)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
618 cfg.mainwin_font = g_strdup(MAINWIN_DEFAULT_FONT);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
619
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
620 if (!cfg.gentitle_format)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
621 cfg.gentitle_format = g_strdup("%{p:%p - %}%{a:%a - %}%t");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
622
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
623 if (!cfg.outputplugin) {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
624 gint iter;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
625 gchar *pl_path = g_build_filename(PLUGIN_DIR, plugin_dir_list[0], NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
626
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
627 for (iter = 0; pl_candidates[iter] != NULL && cfg.outputplugin == NULL; iter++)
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
628 {
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
629 cfg.outputplugin = find_file_recursively(pl_path, pl_candidates[iter]);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
630 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
631
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
632 g_free(pl_path);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
633 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
634
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
635 if (!cfg.eqpreset_default_file)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
636 cfg.eqpreset_default_file = g_strdup(EQUALIZER_DEFAULT_DIR_PRESET);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
637
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
638 if (!cfg.eqpreset_extension)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
639 cfg.eqpreset_extension = g_strdup(EQUALIZER_DEFAULT_PRESET_EXT);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
640
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
641 if (!cfg.chardet_detector)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
642 cfg.chardet_detector = g_strdup("");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
643
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
644 if (!cfg.chardet_fallback)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
645 cfg.chardet_fallback = g_strdup("");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
646
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
647 if (!cfg.cover_name_include)
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
648 cfg.cover_name_include = g_strdup("");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
649
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
650 if (!cfg.cover_name_exclude)
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
651 cfg.cover_name_exclude = g_strdup("back");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
652
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
653 if (!cfg.session_uri_base)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
654 cfg.session_uri_base = g_strdup("");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
655
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
656 /* at least one of these should be true */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
657 if ((!cfg.get_info_on_demand) && (!cfg.get_info_on_load))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
658 cfg.get_info_on_demand = TRUE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
659 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
660
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
661
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
662 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
663 bmp_config_save(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
664 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
665 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
666 gchar *str;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
667 gint i, cur_pb_time;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
668 ConfigDb *db;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
669 Playlist *playlist = playlist_get_active();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
670
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
671 cfg.disabled_iplugins = input_stringify_disabled_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
672
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
673
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
674 db = bmp_cfg_db_open();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
675
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
676 for (i = 0; i < ncfgbent; ++i)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
677 if (bmp_boolents[i].be_wrt)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
678 bmp_cfg_db_set_bool(db, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
679 bmp_boolents[i].be_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
680 *bmp_boolents[i].be_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
681
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
682 for (i = 0; i < ncfgient; ++i)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
683 if (bmp_numents[i].ie_wrt)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
684 bmp_cfg_db_set_int(db, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
685 bmp_numents[i].ie_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
686 *bmp_numents[i].ie_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
687
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
688 /* This is a bit lame .. it'll end up being written twice,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
689 * could do with being done a bit neater. -larne */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
690 bmp_cfg_db_set_int(db, NULL, "playlist_position",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
691 playlist_get_position(playlist));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
692
2530
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
693 /* FIXME: we're looking up SkinnedWindow::x &c ourselves here.
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
694 * this isn't exactly right. -nenolod
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
695 */
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
696 if ( SKINNED_WINDOW(playlistwin)->x != -1 &&
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
697 SKINNED_WINDOW(playlistwin)->y != -1 )
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
698 {
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
699 bmp_cfg_db_set_int(db, NULL, "playlist_x",
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
700 SKINNED_WINDOW(playlistwin)->x);
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
701 bmp_cfg_db_set_int(db, NULL, "playlist_y",
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
702 SKINNED_WINDOW(playlistwin)->y);
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
703 }
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
704
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
705 if ( SKINNED_WINDOW(mainwin)->x != -1 &&
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
706 SKINNED_WINDOW(mainwin)->y != -1 )
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
707 {
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
708 bmp_cfg_db_set_int(db, NULL, "player_x",
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
709 SKINNED_WINDOW(mainwin)->x);
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
710 bmp_cfg_db_set_int(db, NULL, "player_y",
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
711 SKINNED_WINDOW(mainwin)->y);
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
712 }
2530
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
713
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
714 if ( SKINNED_WINDOW(equalizerwin)->x != -1 &&
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
715 SKINNED_WINDOW(equalizerwin)->y != -1 )
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
716 {
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
717 bmp_cfg_db_set_int(db, NULL, "equalizer_x",
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
718 SKINNED_WINDOW(equalizerwin)->x);
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
719 bmp_cfg_db_set_int(db, NULL, "equalizer_y",
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
720 SKINNED_WINDOW(equalizerwin)->y);
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
721 }
2530
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
722
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
723 bmp_cfg_db_set_bool(db, NULL, "mainwin_use_xfont",
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
724 cfg.mainwin_use_xfont);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
725
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
726 for (i = 0; i < ncfgsent; ++i) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
727 if (bmp_strents[i].se_wrt)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
728 bmp_cfg_db_set_string(db, NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
729 bmp_strents[i].se_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
730 *bmp_strents[i].se_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
731 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
732
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
733 bmp_cfg_db_set_float(db, NULL, "equalizer_preamp", cfg.equalizer_preamp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
734
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
735 for (i = 0; i < 10; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
736 str = g_strdup_printf("equalizer_band%d", i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
737 bmp_cfg_db_set_float(db, NULL, str, cfg.equalizer_bands[i]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
738 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
739 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
740
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
741 if (bmp_active_skin != NULL)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
742 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
743 if (bmp_active_skin->path)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
744 bmp_cfg_db_set_string(db, NULL, "skin", bmp_active_skin->path);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
745 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
746 bmp_cfg_db_unset_key(db, NULL, "skin");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
747 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
748
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
749 if (get_current_output_plugin())
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
750 bmp_cfg_db_set_string(db, NULL, "output_plugin",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
751 get_current_output_plugin()->filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
752 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
753 bmp_cfg_db_unset_key(db, NULL, "output_plugin");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
754
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
755 str = general_stringify_enabled_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
756 if (str) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
757 bmp_cfg_db_set_string(db, NULL, "enabled_gplugins", str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
758 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
759 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
760 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
761 bmp_cfg_db_unset_key(db, NULL, "enabled_gplugins");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
762
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
763 str = vis_stringify_enabled_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
764 if (str) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
765 bmp_cfg_db_set_string(db, NULL, "enabled_vplugins", str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
766 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
767 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
768 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
769 bmp_cfg_db_unset_key(db, NULL, "enabled_vplugins");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
770
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
771 str = effect_stringify_enabled_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
772 if (str) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
773 bmp_cfg_db_set_string(db, NULL, "enabled_eplugins", str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
774 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
775 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
776 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
777 bmp_cfg_db_unset_key(db, NULL, "enabled_eplugins");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
778
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
779 if (cfg.filesel_path)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
780 bmp_cfg_db_set_string(db, NULL, "filesel_path", cfg.filesel_path);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
781
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
782 if (cfg.playlist_path)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
783 bmp_cfg_db_set_string(db, NULL, "playlist_path", cfg.playlist_path);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
784
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
785 bmp_cfg_db_set_int(db, NULL, "url_history_length",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
786 g_list_length(cfg.url_history));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
787
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
788 for (node = cfg.url_history, i = 1; node; node = g_list_next(node), i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
789 str = g_strdup_printf("url_history%d", i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
790 bmp_cfg_db_set_string(db, NULL, str, node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
791 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
792 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
793
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
794 if (playback_get_playing()) {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
795 cur_pb_time = playback_get_time();
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
796 } else
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
797 cur_pb_time = -1;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
798 cfg.resume_playback_on_startup_time = cur_pb_time;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
799 bmp_cfg_db_set_int(db, NULL, "resume_playback_on_startup_time",
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
800 cfg.resume_playback_on_startup_time);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
801
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
802 bmp_cfg_db_close(db);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
803
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
804 playlist_save(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
805 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
806
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
807 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
808 bmp_set_default_icon(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
809 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
810 GdkPixbuf *icon;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
811
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
812 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) audacious_player_xpm);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
813 gtk_window_set_default_icon(icon);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
814 g_object_unref(icon);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
815 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
816
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
817 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
818 register_aud_stock_icons(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
819 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
820 GtkIconFactory *iconfactory = gtk_icon_factory_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
821 GtkIconSet *iconset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
822 GdkPixbuf *pixbuf;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
823
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
824 /* pick images in icons-csource.h */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
825 pixbuf = gdk_pixbuf_new_from_inline( -1 , removedups_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
826 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
827 gtk_icon_factory_add( iconfactory , AUD_STOCK_REMOVEDUPS , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
828 pixbuf = gdk_pixbuf_new_from_inline( -1 , removeunavail_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
829 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
830 gtk_icon_factory_add( iconfactory , AUD_STOCK_REMOVEUNAVAIL , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
831 pixbuf = gdk_pixbuf_new_from_inline( -1 , randomizepl_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
832 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
833 gtk_icon_factory_add( iconfactory , AUD_STOCK_RANDOMIZEPL , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
834 pixbuf = gdk_pixbuf_new_from_inline( -1 , sortbytitle_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
835 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
836 gtk_icon_factory_add( iconfactory , AUD_STOCK_SORTBYTITLE , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
837 pixbuf = gdk_pixbuf_new_from_inline( -1 , sortbyfilename_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
838 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
839 gtk_icon_factory_add( iconfactory , AUD_STOCK_SORTBYFILENAME , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
840 pixbuf = gdk_pixbuf_new_from_inline( -1 , sortbyartist_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
841 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
842 gtk_icon_factory_add( iconfactory , AUD_STOCK_SORTBYARTIST , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
843 pixbuf = gdk_pixbuf_new_from_inline( -1 , sortbypathfile_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
844 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
845 gtk_icon_factory_add( iconfactory , AUD_STOCK_SORTBYPATHFILE , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
846 pixbuf = gdk_pixbuf_new_from_inline( -1 , selectnone_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
847 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
848 gtk_icon_factory_add( iconfactory , AUD_STOCK_SELECTNONE , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
849 pixbuf = gdk_pixbuf_new_from_inline( -1 , selectall_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
850 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
851 gtk_icon_factory_add( iconfactory , AUD_STOCK_SELECTALL , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
852 pixbuf = gdk_pixbuf_new_from_inline( -1 , selectinvert_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
853 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
854 gtk_icon_factory_add( iconfactory , AUD_STOCK_SELECTINVERT , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
855 pixbuf = gdk_pixbuf_new_from_inline( -1 , invertpl_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
856 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
857 gtk_icon_factory_add( iconfactory , AUD_STOCK_INVERTPL , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
858 pixbuf = gdk_pixbuf_new_from_inline( -1 , queuetoggle_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
859 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
860 gtk_icon_factory_add( iconfactory , AUD_STOCK_QUEUETOGGLE , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
861 pixbuf = gdk_pixbuf_new_from_inline( -1 , info_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
862 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
863 gtk_icon_factory_add( iconfactory , AUD_STOCK_INFO , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
864 pixbuf = gdk_pixbuf_new_from_inline( -1 , playlist_pixbuf , FALSE , NULL );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
865 iconset = gtk_icon_set_new_from_pixbuf( pixbuf ); g_object_unref( pixbuf );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
866 gtk_icon_factory_add( iconfactory , AUD_STOCK_PLAYLIST , iconset );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
867
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
868 gtk_icon_factory_add_default( iconfactory );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
869 g_object_unref( iconfactory );
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
870 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
871
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
872 static GOptionEntry cmd_entries[] = {
2448
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
873 {"session", 'n', 0, G_OPTION_ARG_INT, &options.session, N_("Select which Audacious session ID to use"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
874 {"rew", 'r', 0, G_OPTION_ARG_NONE, &options.rew, N_("Skip backwards in playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
875 {"play", 'p', 0, G_OPTION_ARG_NONE, &options.play, N_("Start playing current playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
876 {"pause", 'u', 0, G_OPTION_ARG_NONE, &options.pause, N_("Pause current song"), NULL},
2475
5fcdef6e3754 [svn] - fix audacious -s, closes #778.
nenolod
parents: 2463
diff changeset
877 {"stop", 's', 0, G_OPTION_ARG_NONE, &options.stop, N_("Stop current song"), NULL},
2551
cea3528b2996 [svn] Fix --play-pause commandline option, by Alex "Monkey" Maclean in #gentoo-x86
chainsaw
parents: 2530
diff changeset
878 {"play-pause", 't', 0, G_OPTION_ARG_NONE, &options.play_pause, N_("Pause if playing, play otherwise"), NULL},
2448
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
879 {"fwd", 'f', 0, G_OPTION_ARG_NONE, &options.fwd, N_("Skip forward in playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
880 {"show-jump-box", 'j', 0, G_OPTION_ARG_NONE, &options.show_jump_box, N_("Display Jump to File dialog"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
881 {"enqueue", 'e', 0, G_OPTION_ARG_NONE, &options.enqueue, N_("Don't clear the playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
882 {"enqueue-to-temp", 'E', 0, G_OPTION_ARG_NONE, &options.enqueue_to_temp, N_("Add new files to a temporary playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
883 {"show-main-window", 'm', 0, G_OPTION_ARG_NONE, &options.mainwin, N_("Display the main window"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
884 {"activate", 'a', 0, G_OPTION_ARG_NONE, &options.activate, N_("Display all open Audacious windows"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
885 {"headless", 'H', 0, G_OPTION_ARG_NONE, &options.headless, N_("Enable headless operation"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
886 {"no-log", 'N', 0, G_OPTION_ARG_NONE, &options.no_log, N_("Print all errors and warnings to stdout"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
887 {"version", 'v', 0, G_OPTION_ARG_NONE, &options.version, N_("Show version and builtin features"), NULL},
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
888 {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &options.filenames, N_("FILE..."), NULL},
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
889 {NULL},
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
890 };
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
891
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
892 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
893 handle_cmd_line_options(BmpCmdLineOpt * options,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
894 gboolean remote)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
895 {
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
896 gchar **filenames = options->filenames;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
897 gint session = options->session;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
898
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
899 if (options->version)
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
900 {
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
901 dump_version();
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
902 exit(EXIT_SUCCESS);
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
903 }
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
904
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
905 if (session == -1) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
906 if (!remote)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
907 session = ctrlsocket_get_session_id();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
908 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
909 session = 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
910 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
911
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
912 if (filenames != NULL)
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
913 {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
914 gint pos = 0;
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
915 gint i = 0;
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
916 GList *fns = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
917
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
918 for (i = 0; filenames[i] != NULL; i++)
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
919 {
2570
7b1b52eb663b [svn] - Minor cleanups
mf0102
parents: 2551
diff changeset
920 gchar *filename;
2512
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
921 gchar *current_dir = g_get_current_dir();
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
922
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
923 if (filenames[i][0] == '/' || strstr(filenames[i], "://"))
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
924 filename = g_strdup(filenames[i]);
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
925 else
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
926 filename = g_build_filename(current_dir, filenames[i], NULL);
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
927
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
928 fns = g_list_prepend(fns, filename);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
929
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
930 g_free(current_dir);
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
931 }
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
932
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
933 fns = g_list_reverse(fns);
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
934
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
935 if (options->load_skins)
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
936 {
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
937 xmms_remote_set_skin(session, filenames[0]);
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
938 skin_install_skin(filenames[0]);
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
939 }
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
940 else
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
941 {
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
942 if (options->enqueue_to_temp)
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
943 xmms_remote_playlist_enqueue_to_temp(session, filenames[0]);
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
944
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
945 if (options->enqueue && options->play)
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
946 pos = xmms_remote_get_playlist_length(session);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
947
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
948 if (!options->enqueue)
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
949 {
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
950 xmms_remote_playlist_clear(session);
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
951 xmms_remote_stop(session);
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
952 }
2512
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
953
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
954 xmms_remote_playlist_add(session, fns);
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
955
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
956 if (options->enqueue && options->play &&
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
957 xmms_remote_get_playlist_length(session) > pos)
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
958 xmms_remote_set_playlist_pos(session, pos);
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
959
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
960 if (!options->enqueue)
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
961 xmms_remote_play(session);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
962 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
963
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
964 g_list_foreach(fns, (GFunc) g_free, NULL);
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
965 g_list_free(fns);
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
966
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
967 g_strfreev(filenames);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
968 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
969
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
970 if (options->rew)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
971 xmms_remote_playlist_prev(session);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
972
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
973 if (options->play)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
974 xmms_remote_play(session);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
975
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
976 if (options->pause)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
977 xmms_remote_pause(session);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
978
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
979 if (options->stop)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
980 xmms_remote_stop(session);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
981
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
982 if (options->fwd)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
983 xmms_remote_playlist_next(session);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
984
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
985 if (options->play_pause)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
986 xmms_remote_play_pause(session);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
987
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
988 if (options->show_jump_box)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
989 xmms_remote_show_jtf_box(session);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
990
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
991 if (options->mainwin)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
992 xmms_remote_main_win_toggle(session, TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
993
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
994 if (options->activate)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
995 xmms_remote_activate(session);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
996
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
997 if (options->playcd)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
998 play_medium();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
999 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1000
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1001 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1002 bmp_setup_logger(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1003 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1004 if (!bmp_logger_start(bmp_paths[BMP_PATH_LOG_FILE]))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1005 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1006
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1007 g_atexit(bmp_logger_stop);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1008 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1009
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1010 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1011 run_load_skin_error_dialog(const gchar * skin_path)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1012 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1013 const gchar *markup =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1014 N_("<b><big>Unable to load skin.</big></b>\n"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1015 "\n"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1016 "Check that skin at '%s' is usable and default skin is properly "
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1017 "installed at '%s'\n");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1018
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1019 GtkWidget *dialog =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1020 gtk_message_dialog_new_with_markup(NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1021 GTK_DIALOG_MODAL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1022 GTK_MESSAGE_ERROR,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1023 GTK_BUTTONS_CLOSE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1024 _(markup),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1025 skin_path,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1026 BMP_DEFAULT_SKIN_PATH);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1027 gtk_dialog_run(GTK_DIALOG(dialog));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1028 gtk_widget_destroy(dialog);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1029 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1030
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1031 // use a format string?
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1032 void report_error(const gchar *error_text)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1033 {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1034 fprintf(stderr, error_text);
2570
7b1b52eb663b [svn] - Minor cleanups
mf0102
parents: 2551
diff changeset
1035
7b1b52eb663b [svn] - Minor cleanups
mf0102
parents: 2551
diff changeset
1036 if (options.headless != 1)
7b1b52eb663b [svn] - Minor cleanups
mf0102
parents: 2551
diff changeset
1037 {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1038 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(err),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1039 error_text);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1040 gtk_dialog_run(GTK_DIALOG(err));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1041 gtk_widget_hide(err);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1042 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1043 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1044
2369
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1045 static gboolean
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1046 aud_headless_iteration(gpointer unused)
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1047 {
2506
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1048 audcore_generic_events();
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1049 free_vis_data();
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1050 return TRUE;
2369
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1051 }
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1052
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1053 gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1054 main(gint argc, gchar ** argv)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1055 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1056 gboolean gtk_init_check_ok;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1057 Playlist *playlist;
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1058 GOptionContext *context;
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1059 GError *error = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1060
2644
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1061 /* glib-2.13.0 requires g_thread_init() to be called before all
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1062 other GLib functions */
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1063 g_thread_init(NULL);
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1064 if (!g_thread_supported()) {
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1065 g_printerr(_("Sorry, threads isn't supported on your platform.\n\n"
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1066 "If you're on a libc5 based linux system and installed Glib & GTK+ before you\n"
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1067 "installed LinuxThreads you need to recompile Glib & GTK+.\n"));
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1068 exit(EXIT_FAILURE);
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1069 }
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1070
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1071 gdk_threads_init();
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1072
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1073 /* Setup l10n early so we can print localized error messages */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1074 gtk_set_locale();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1075 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1076 bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
2388
52bcc18eb8bb [svn] - attempt to bind the audacious-plugins domain
nenolod
parents: 2369
diff changeset
1077 bindtextdomain(PACKAGE_NAME "-plugins", LOCALEDIR);
52bcc18eb8bb [svn] - attempt to bind the audacious-plugins domain
nenolod
parents: 2369
diff changeset
1078 bind_textdomain_codeset(PACKAGE_NAME "-plugins", "UTF-8");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1079 textdomain(PACKAGE_NAME);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1080
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1081 bmp_init_paths();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1082 bmp_make_user_dir();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1083
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1084 /* Check GTK version. Really, this is only needed for binary
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1085 * distribution since configure already checks. */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1086 if (!GTK_CHECK_VERSION(2, 6, 0)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1087 g_printerr(_("Sorry, your GTK+ version (%d.%d.%d) does not work with Audacious.\n"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1088 "Please use GTK+ %s or newer.\n"),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1089 gtk_major_version, gtk_minor_version, gtk_micro_version,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1090 "2.6.0");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1091 exit(EXIT_FAILURE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1092 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1093
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1094 g_set_application_name(_(application_name));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1095
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1096 cond_scan = g_cond_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1097 mutex_scan = g_mutex_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1098
2463
e32be86095aa [svn] - re-add support for gtkrc files
nenolod
parents: 2461
diff changeset
1099 gtk_rc_add_default_file(bmp_paths[BMP_PATH_GTKRC_FILE]);
e32be86095aa [svn] - re-add support for gtkrc files
nenolod
parents: 2461
diff changeset
1100
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1101 gtk_init_check_ok = gtk_init_check(&argc, &argv);
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1102
2413
86777d94dc7a [svn] - default settings for options.session
nenolod
parents: 2412
diff changeset
1103 memset(&options, '\0', sizeof(BmpCmdLineOpt));
86777d94dc7a [svn] - default settings for options.session
nenolod
parents: 2412
diff changeset
1104 options.session = -1;
86777d94dc7a [svn] - default settings for options.session
nenolod
parents: 2412
diff changeset
1105
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1106 context = g_option_context_new(_("- play multimedia files"));
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1107 g_option_context_add_main_entries(context, cmd_entries, PACKAGE_NAME);
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1108 g_option_context_add_group(context, gtk_get_option_group(TRUE));
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1109 g_option_context_parse(context, &argc, &argv, &error);
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1110
2412
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1111 if (error != NULL)
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1112 {
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1113 g_printerr(_("%s: %s\nTry `%s --help' for more information.\n"), argv[0], error->message, argv[0]);
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1114 exit(EXIT_FAILURE);
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1115 }
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1116
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1117 if (!gtk_init_check_ok) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1118 if (argc < 2) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1119 /* GTK check failed, and no arguments passed to indicate
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1120 that user is intending to only remote control a running
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1121 session */
2412
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1122 g_printerr(_("%s: Unable to open display, exiting.\n"), argv[0]);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1123 exit(EXIT_FAILURE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1124 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1125
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1126 handle_cmd_line_options(&options, TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1127
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1128 /* we could be running headless, so GTK probably wont matter */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1129 if (options.headless != 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1130 exit(EXIT_SUCCESS);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1131 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1132
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1133 if (options.no_log == FALSE)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1134 bmp_setup_logger();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1135
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1136 signal_handlers_init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1137
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1138 g_random_set_seed(time(NULL));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1139
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1140 bmp_config_load();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1141
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1142 if (options.session != -1 || !ctrlsocket_setup()) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1143 handle_cmd_line_options(&options, TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1144 exit(EXIT_SUCCESS);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1145 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1146
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1147 plugin_system_init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1148
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1149 /* Initialize the playlist system. */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1150 playlist_init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1151
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1152 if (options.headless != 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1153 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1154 /* register icons in stock */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1155 register_aud_stock_icons();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1156
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1157 bmp_set_default_icon();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1158
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1159 gtk_accel_map_load(bmp_paths[BMP_PATH_ACCEL_FILE]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1160
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1161 /* uimanager */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1162 ui_manager_init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1163 ui_manager_create_menus();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1164
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1165 if (!init_skins(cfg.skin)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1166 run_load_skin_error_dialog(cfg.skin);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1167 exit(EXIT_FAILURE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1168 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1169
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1170 GDK_THREADS_ENTER();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1171 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1172
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1173 /* Load the default playlist in. */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1174 playlist = playlist_get_active();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1175 playlist_load(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1176 playlist_set_position(playlist, cfg.playlist_position);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1177
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1178 /* this needs to be called after all 3 windows are created and
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1179 * input plugins are setup'ed
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1180 * but not if we're running headless --nenolod
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1181 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1182 mainwin_setup_menus();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1183
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1184 if (options.headless != 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1185 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1186
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1187 ctrlsocket_start();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1188
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1189 handle_cmd_line_options(&options, FALSE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1190
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1191 if (options.headless != 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1192 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1193 GDK_THREADS_ENTER();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1194
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1195 read_volume(VOLSET_STARTUP);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1196 mainwin_set_info_text();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1197
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1198 /* FIXME: delayed, because it deals directly with the plugin
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1199 * interface to set menu items */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1200 create_prefs_window();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1201
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1202 create_fileinfo_window();
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1203
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1204
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1205 if (cfg.player_visible)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1206 mainwin_show(TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1207 else if (!cfg.playlist_visible && !cfg.equalizer_visible)
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
1208 {
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
1209 /* all of the windows are hidden... warn user about this */
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
1210 mainwin_show_visibility_warning();
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
1211 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1212
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1213 if (cfg.equalizer_visible)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1214 equalizerwin_show(TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1215
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1216 if (cfg.playlist_visible)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1217 playlistwin_show();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1218
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1219 hint_set_always(cfg.always_on_top);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1220
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1221 playlist_start_get_info_thread();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1222 mainwin_attach_idle_func();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1223
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1224
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1225 starting_up = FALSE;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1226 has_x11_connection = TRUE;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1227
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1228 if (cfg.resume_playback_on_startup)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1229 {
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1230 if (cfg.resume_playback_on_startup_time != -1 &&
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1231 playlist_get_length(playlist) > 0)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1232 {
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1233 int i;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1234 gint l = 0, r = 0;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1235 while (gtk_events_pending()) gtk_main_iteration();
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1236 output_get_volume(&l, &r);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1237 output_set_volume(0,0);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1238 playback_initiate();
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1239
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1240 /* Busy wait; loop is fairly tight to minimize duration of
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1241 * "frozen" GUI. Feel free to tune. --chainsaw */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1242 for (i = 0; i < 20; i++)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1243 {
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1244 g_usleep(1000);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1245 if (!ip_data.playing)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1246 break;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1247 }
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1248 playback_seek(cfg.resume_playback_on_startup_time / 1000);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1249 output_set_volume(l, r);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1250 }
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1251 }
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1252
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1253 gtk_main();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1254
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1255 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1256
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1257 g_cond_free(cond_scan);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1258 g_mutex_free(mutex_scan);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1259
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1260 return EXIT_SUCCESS;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1261 }
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1262 // if we are running headless
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1263 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1264 {
2506
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1265 GMainLoop *loop;
2369
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1266
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1267 mainwin_set_info_text();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1268 playlist_start_get_info_thread();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1269
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1270 starting_up = FALSE;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1271
2506
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1272 loop = g_main_loop_new(NULL, TRUE);
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1273 g_timeout_add(10, aud_headless_iteration, NULL);
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1274 g_main_loop_run(loop);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1275
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1276 return EXIT_SUCCESS;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1277 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1278 }