annotate audacious/main.c @ 2261:bdb2983612f0 trunk

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