annotate src/audacious/main.c @ 4236:1ab015fe2ade

RG icon added. some changes
author Eugene Zagidullin <e.asphyx@gmail.com>
date Thu, 31 Jan 2008 21:43:51 +0300
parents b293ce14a01a
children b0ca963fd965
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1 /* Audacious - Cross-platform multimedia player
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
2 * Copyright (C) 2005-2007 Audacious development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
3 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
4 * Based on BMP:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
5 * Copyright (C) 2003-2004 BMP development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
6 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
7 * Based on XMMS:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
8 * Copyright (C) 1998-2003 XMMS development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
9 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 2973
diff changeset
12 * the Free Software Foundation; under version 3 of the License.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
13 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
17 * GNU General Public License for more details.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
18 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 2973
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses>.
3123
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
21 *
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
22 * The Audacious team does not consider modular code linking to
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
23 * Audacious or using our public API to be a derived work.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26 #ifdef HAVE_CONFIG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27 # include "config.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30 #include "main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
31
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
32 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33 #include <glib/gi18n.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 #include <glib/gprintf.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 #include <gdk/gdk.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 #include <stdlib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38 #include <getopt.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39 #include <ctype.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40 #include <time.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 #include <unistd.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
43 #include <errno.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44 #include <sys/types.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45 #include <sys/stat.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
46 #include <signal.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48 #include "platform/smartinclude.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
49
2717
6884a2144a01 [svn] - make audacious build again
nenolod
parents: 2711
diff changeset
50 #include "configdb.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51 #include "vfs.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
52
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents: 2682
diff changeset
53 #ifdef USE_DBUS
2711
c35913222440 [svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents: 2709
diff changeset
54 # include "dbus-service.h"
2785
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2736
diff changeset
55 # include "audctrl.h"
2694
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents: 2682
diff changeset
56 #endif
c2b82432c1b6 [svn] Added basic DBus support, disabled by default with a configuration option to enable it. The general and playback information/manipulation methods are currently the only ones implemented. That is version, play, pause, stop, playing, paused, stopped, status, and seek. There are stubs for many unimplemented methods.
magma
parents: 2682
diff changeset
57
3251
f02623377013 goodbye widgets directory
Tomasz Mon <desowin@gmail.com>
parents: 3229
diff changeset
58 #include "skin.h"
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
59 #include "auddrct.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
60 #include "dnd.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61 #include "effect.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 #include "ui_equalizer.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63 #include "general.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
64 #include "hints.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
65 #include "input.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
66 #include "logger.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67 #include "ui_main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68 #include "ui_manager.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
69 #include "output.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
70 #include "playback.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
71 #include "playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
72 #include "ui_playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
73 #include "ui_preferences.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
74 #include "pluginenum.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
75 #include "ui_skinselector.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
76 #include "util.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
77 #include "visualization.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
78 #include "build_stamp.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
79 #include "ui_fileinfo.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
80 #include "signals.h"
2530
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
81 #include "ui_skinned_window.h"
4234
b293ce14a01a partially works...
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4232
diff changeset
82 #include "libSAD.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
83
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
84 #include "icons-stock.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
85 #include "images/audacious_player.xpm"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
86
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
87 gboolean has_x11_connection = FALSE; /* do we have an X11 connection? */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
88
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
89 /* Translatable string for beep.desktop's comment field */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
90 const gchar *desktop_comment = N_("Audacious");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
91
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
92 const gchar *application_name = N_("Audacious");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
93
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
94
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
95 struct _BmpCmdLineOpt {
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
96 gchar **filenames;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
97 gint session;
3351
7a4fcf84a34f Removed the hardcoded Add/Play CD menu entry
Calin Crisan ccrisan@gmail.com
parents: 3346
diff changeset
98 gboolean play, stop, pause, fwd, rew, play_pause, show_jump_box;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
99 gboolean enqueue, mainwin, remote, activate;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
100 gboolean load_skins;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
101 gboolean headless;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
102 gboolean no_log;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
103 gboolean enqueue_to_temp;
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
104 gboolean version;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
105 gchar *previous_session_id;
4200
c010163b6286 It's now a .app on MacOS
Chris Fuenty <zimmy@atheme.org>
parents: 4193
diff changeset
106 gboolean macpack;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
107 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
108
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
109 typedef struct _BmpCmdLineOpt BmpCmdLineOpt;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
110
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
111 BmpCmdLineOpt options;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
112
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
113 BmpConfig cfg;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
114
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
115 BmpConfig bmp_default_config = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
116 MAINWIN_DEFAULT_POS_X, /* mainwin x position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
117 MAINWIN_DEFAULT_POS_Y, /* mainwin y position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
118 EQUALIZER_DEFAULT_POS_X, /* equalizer x position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
119 EQUALIZER_DEFAULT_POS_Y, /* equalizer y position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
120 PLAYLISTWIN_DEFAULT_POS_X, /* playlistwin x position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
121 PLAYLISTWIN_DEFAULT_POS_Y, /* playlistwin y position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
122 PLAYLISTWIN_DEFAULT_WIDTH, /* playlistwin width */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
123 PLAYLISTWIN_DEFAULT_HEIGHT, /* playlistwin height */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
124 10, /* snap distance */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
125 FALSE, /* real-time priority */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
126 FALSE, FALSE, /* shuffle, repeat */
4218
f1074a07ec09 mostly works, but the VIS is broken, and the eq window is too large...more bugs
Cristi Magherusan <majeru@atheme.org>
parents: 4216
diff changeset
127 FALSE, /* scaling */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
128 TRUE, /* autoscroll */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
129 TRUE, /* analyzer peaks */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
130 FALSE, /* equalizer autoload */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
131 FALSE, /* easy move */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
132 FALSE, /* equalizer active */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
133 FALSE, /* playlistwin visible */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
134 FALSE, /* equalizer visible */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
135 TRUE, /* player visible */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
136 FALSE, /* player shaded */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
137 FALSE, /* playlistwin shaded */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
138 FALSE, /* equalizer shaded */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
139 FALSE, /* allow multiple instances */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
140 TRUE, /* always show cb */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
141 TRUE, TRUE, TRUE, /* convert '_', %20 and '\' */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142 TRUE, /* show numbers in playlist */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
143 TRUE, /* snap windows */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
144 TRUE, /* save window positions */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
145 TRUE, /* dim titlebar */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
146 FALSE, /* get playlist info on load */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
147 TRUE, /* get playlist info on demand */
4218
f1074a07ec09 mostly works, but the VIS is broken, and the eq window is too large...more bugs
Cristi Magherusan <majeru@atheme.org>
parents: 4216
diff changeset
148 TRUE, /* equalizer scale linked */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
149 FALSE, /* sort jump to file */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
150 FALSE, /* use effect plugins */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
151 FALSE, /* always on top */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
152 FALSE, /* sticky */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
153 FALSE, /* no playlist advance */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
154 FALSE, /* stop after current song */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
155 TRUE, /* refresh file list */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
156 TRUE, /* UNUSED (smooth title scrolling) */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
157 TRUE, /* use playlist metadata */
2662
09b404d61ebd [svn] - remove the unplayable files dialog. it is more annoying than useful.
nenolod
parents: 2651
diff changeset
158 TRUE, /* deprecated */
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
159 TRUE, /* warn about windows visibility */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
160 FALSE, /* use \ as directory delimiter */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
161 FALSE, /* random skin on play */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
162 FALSE, /* use fontsets */
4121
bb35123048fb oops, this should get commited together with 4204b0a6aeb2
Tomasz Mon <desowin@gmail.com>
parents: 4116
diff changeset
163 TRUE, /* use bitmap font for mainwin */
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
164 TRUE, /* use custom cursors */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
165 TRUE, /* close dialog on open */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
166 TRUE, /* close dialog on add */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
167 0.0, /* equalizer preamp */
3229
5e12e740c66c default value for "enabled discovery plugins" was missing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3216
diff changeset
168 {0.0, 0.0, 0.0, 0.0, 0.0, /* equalizer bands */
5e12e740c66c default value for "enabled discovery plugins" was missing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3216
diff changeset
169 0.0, 0.0, 0.0, 0.0, 0.0},
4223
2c9c2b5caaee changed the hardcoded scale to 1.2 and set some dither and interpolation
Cristi Magherusan <majeru@atheme.org>
parents: 4218
diff changeset
170 1.2, /* GUI scale factor, hardcoded for testing purposes --majeru */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
171 NULL, /* skin */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
172 NULL, /* output plugin */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
173 NULL, /* file selector path */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
174 NULL, /* playlist path */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
175 NULL, /* playlist font */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
176 NULL, /* mainwin font */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
177 NULL, /* disabled input plugins */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
178 NULL, /* enabled general plugins */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
179 NULL, /* enabled visualization plugins */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
180 NULL, /* enabled effect plugins */
3229
5e12e740c66c default value for "enabled discovery plugins" was missing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3216
diff changeset
181 NULL, /* enabled discovery plugins */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
182 NULL, /* equalizer preset default file */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
183 NULL, /* equalizer preset extension */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
184 NULL, /* URL history */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
185 0, /* timer mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
186 VIS_ANALYZER, /* visualizer type */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
187 ANALYZER_NORMAL, /* analyzer mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
188 ANALYZER_BARS, /* analyzer type */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
189 SCOPE_DOT, /* scope mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
190 VOICEPRINT_NORMAL, /* voiceprint mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
191 VU_SMOOTH, /* VU mode */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
192 REFRESH_FULL, /* visualizer refresh rate */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
193 FALLOFF_FAST, /* analyzer fall off rate */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
194 FALLOFF_SLOW, /* peaks fall off rate */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
195 0, /* playlist position */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
196 2, /* pause between songs time */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
197 FALSE, /* pause between songs */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
198 FALSE, /* show window decorations */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
199 8, /* mouse wheel scroll step */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
200 FALSE, /* playlist transparent */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
201 2, /* 3rd preset (ARTIST - ALBUM - TITLE) */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
202 NULL, /* title format */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
203 FALSE, /* software volume control enabled */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
204 TRUE, /* UNUSED (XMMS compatibility mode) */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
205 TRUE, /* extra eq filtering */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
206 3, /* scroll pl by */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
207 FALSE, /* resume playback on startup */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
208 -1, /* resume playback on startup time */
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
209 TRUE, /* show seperators in pl */
3229
5e12e740c66c default value for "enabled discovery plugins" was missing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3216
diff changeset
210 NULL, /* chardet_detector */
5e12e740c66c default value for "enabled discovery plugins" was missing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3216
diff changeset
211 NULL, /* chardet_fallback */
3959
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3883
diff changeset
212 500, /* audio buffer size */
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3883
diff changeset
213 TRUE, /* whether or not to postpone format detection on initial add */
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
214 TRUE, /* show filepopup for tuple */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
215 NULL, /* words identifying covers */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
216 NULL, /* words that might not show up in cover names */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
217 FALSE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
218 0,
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
219 NULL, /* default session uri base (non-NULL = custom session uri base) */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
220 150, /* short side length of the picture in the filepopup */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
221 20, /* delay until the filepopup comes up */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
222 FALSE, /* use filename.jpg for coverart */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
223 FALSE, /* use XMMS-style file selection */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
224 TRUE, /* use extension probing */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
225 255, 255, 255, /* colorize r, g, b */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
226 FALSE, /* internal: whether or not to terminate */
2405
15fc0d852633 [svn] enhancement to popup information settings
yaz
parents: 2388
diff changeset
227 TRUE, /* whether show progress bar in filepopup or not */
2806
0646111a7217 [svn] - add default value for close_jtf_dialog.
yaz
parents: 2805
diff changeset
228 TRUE, /* close jtf dialog on jump */
3543
6b8c8e051c1b Add new configuration option: Software Volume Control.
William Pitcock <nenolod@atheme.org>
parents: 3530
diff changeset
229 TRUE, /* use back and forth scroll */
6b8c8e051c1b Add new configuration option: Software Volume Control.
William Pitcock <nenolod@atheme.org>
parents: 3530
diff changeset
230 FALSE, /* use software volume control */
3965
aea8b763b134 Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents: 3959
diff changeset
231 .warn_about_broken_gtk_engines = TRUE, /* warn about broken gtk themes */
aea8b763b134 Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents: 3959
diff changeset
232 FALSE, /* disable inline themes */
4116
5853d43e539a remember filter entry in jtf dialog is extremely useful when jtf deals with large playlist. now this feature is configurable.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 4112
diff changeset
233 TRUE, /* remember jtf text entry */
4232
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4224
diff changeset
234 16, /* output bit depth */
4236
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
235 TRUE, /* enable replay gain */
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
236 TRUE, /* enable clipping prevention */
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
237 TRUE, /* track mode */
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
238 FALSE, /* album mode */
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
239 FALSE, /* enable hard limiter */
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
240 0.0, /* preamp */
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
241 -9.0, /* default gain */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
242 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
243
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
244 typedef struct bmp_cfg_boolent_t {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
245 char const *be_vname;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
246 gboolean *be_vloc;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
247 gboolean be_wrt;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
248 } bmp_cfg_boolent;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
249
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
250 typedef struct bmp_cfg_nument_t {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
251 char const *ie_vname;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
252 gint *ie_vloc;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
253 gboolean ie_wrt;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
254 } bmp_cfg_nument;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
255
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
256 typedef struct bmp_cfg_strent_t {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
257 char const *se_vname;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
258 char **se_vloc;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
259 gboolean se_wrt;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
260 } bmp_cfg_strent;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
261
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
262 const gchar *bmp_titlestring_presets[] = {
3296
c1f506c2b1d0 new format strings
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
263 "${title}",
c1f506c2b1d0 new format strings
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
264 "${?artist:${artist} - }${title}",
c1f506c2b1d0 new format strings
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
265 "${?artist:${artist} - }${?album:${album} - }${title}",
c1f506c2b1d0 new format strings
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
266 "${?artist:${artist} - }${?album:${album} - }${?track-number:${track-number}. }${title}",
c1f506c2b1d0 new format strings
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
267 "${?artist:${artist} }${?album:[ ${album} ] }${?artist:- }${?track-number:${track-number}. }${title}",
c1f506c2b1d0 new format strings
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
268 "${?album:${album} - }${title}"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
269 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
270
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
271 const guint n_titlestring_presets = G_N_ELEMENTS(bmp_titlestring_presets);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
272
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
273 const gchar *chardet_detector_presets[] = {
4043
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
274 N_("None"),
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
275 N_("Japanese"),
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
276 N_("Taiwanese"),
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
277 N_("Chinese"),
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
278 N_("Korean"),
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
279 N_("Russian"),
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
280 N_("Greek"),
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
281 N_("Hebrew"),
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
282 N_("Turkish"),
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
283 N_("Arabic"),
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
284 #ifdef HAVE_UDET
4043
c86f63f652aa made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
285 N_("Universal")
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
286 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
287 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
288
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
289 const guint n_chardet_detector_presets = G_N_ELEMENTS(chardet_detector_presets);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
290
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
291 static bmp_cfg_boolent bmp_boolents[] = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
292 {"allow_multiple_instances", &cfg.allow_multiple_instances, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
293 {"use_realtime", &cfg.use_realtime, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
294 {"always_show_cb", &cfg.always_show_cb, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
295 {"convert_underscore", &cfg.convert_underscore, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
296 {"convert_twenty", &cfg.convert_twenty, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
297 {"convert_slash", &cfg.convert_slash, TRUE },
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
298 {"show_numbers_in_pl", &cfg.show_numbers_in_pl, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
299 {"show_separator_in_pl", &cfg.show_separator_in_pl, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
300 {"snap_windows", &cfg.snap_windows, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
301 {"save_window_positions", &cfg.save_window_position, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
302 {"dim_titlebar", &cfg.dim_titlebar, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
303 {"get_info_on_load", &cfg.get_info_on_load, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
304 {"get_info_on_demand", &cfg.get_info_on_demand, TRUE},
4216
75d99359357b doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents: 4200
diff changeset
305 {"eq_scaled_linked", &cfg.eq_scaled_linked, TRUE},
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
306 {"no_playlist_advance", &cfg.no_playlist_advance, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
307 {"refresh_file_list", &cfg.refresh_file_list, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
308 {"sort_jump_to_file", &cfg.sort_jump_to_file, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
309 {"use_pl_metadata", &cfg.use_pl_metadata, TRUE},
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
310 {"warn_about_win_visibility", &cfg.warn_about_win_visibility, TRUE},
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
311 {"use_backslash_as_dir_delimiter", &cfg.use_backslash_as_dir_delimiter, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
312 {"player_shaded", &cfg.player_shaded, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
313 {"player_visible", &cfg.player_visible, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
314 {"shuffle", &cfg.shuffle, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
315 {"repeat", &cfg.repeat, TRUE},
4216
75d99359357b doublesize -> custom scale:
Cristi Magherusan <majeru@atheme.org>
parents: 4200
diff changeset
316 {"scaled", &cfg.scaled, TRUE}, /* toggles custom scale */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
317 {"autoscroll_songname", &cfg.autoscroll, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
318 {"stop_after_current_song", &cfg.stopaftersong, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
319 {"playlist_shaded", &cfg.playlist_shaded, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
320 {"playlist_visible", &cfg.playlist_visible, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
321 {"use_fontsets", &cfg.use_fontsets, TRUE},
4121
bb35123048fb oops, this should get commited together with 4204b0a6aeb2
Tomasz Mon <desowin@gmail.com>
parents: 4116
diff changeset
322 {"mainwin_use_bitmapfont", &cfg.mainwin_use_bitmapfont, TRUE},
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
323 {"equalizer_visible", &cfg.equalizer_visible, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
324 {"equalizer_active", &cfg.equalizer_active, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
325 {"equalizer_shaded", &cfg.equalizer_shaded, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
326 {"equalizer_autoload", &cfg.equalizer_autoload, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
327 {"easy_move", &cfg.easy_move, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
328 {"use_eplugins", &cfg.use_eplugins, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
329 {"always_on_top", &cfg.always_on_top, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
330 {"sticky", &cfg.sticky, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
331 {"random_skin_on_play", &cfg.random_skin_on_play, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
332 {"pause_between_songs", &cfg.pause_between_songs, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
333 {"show_wm_decorations", &cfg.show_wm_decorations, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
334 {"eq_extra_filtering", &cfg.eq_extra_filtering, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
335 {"analyzer_peaks", &cfg.analyzer_peaks, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
336 {"custom_cursors", &cfg.custom_cursors, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
337 {"close_dialog_open", &cfg.close_dialog_open, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
338 {"close_dialog_add", &cfg.close_dialog_add, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
339 {"resume_playback_on_startup", &cfg.resume_playback_on_startup, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
340 {"playlist_detect", &cfg.playlist_detect, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
341 {"show_filepopup_for_tuple", &cfg.show_filepopup_for_tuple, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
342 {"recurse_for_cover", &cfg.recurse_for_cover, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
343 {"use_file_cover", &cfg.use_file_cover, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
344 {"use_xmms_style_fileselector", &cfg.use_xmms_style_fileselector, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
345 {"use_extension_probing", &cfg.use_extension_probing, TRUE},
2405
15fc0d852633 [svn] enhancement to popup information settings
yaz
parents: 2388
diff changeset
346 {"filepopup_showprogressbar", &cfg.filepopup_showprogressbar, TRUE},
2805
6295535fbf49 [svn] - add toggle button to keep jtf dialog opened on jump.
yaz
parents: 2788
diff changeset
347 {"close_jtf_dialog", &cfg.close_jtf_dialog, TRUE},
2968
83f03505f819 add support for one-way text scroll.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2938
diff changeset
348 {"twoway_scroll", &cfg.twoway_scroll, TRUE},
3543
6b8c8e051c1b Add new configuration option: Software Volume Control.
William Pitcock <nenolod@atheme.org>
parents: 3530
diff changeset
349 {"software_volume_control", &cfg.software_volume_control, TRUE},
3965
aea8b763b134 Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents: 3959
diff changeset
350 {"warn_about_broken_gtk_engines", &cfg.warn_about_broken_gtk_engines, TRUE},
4088
2b1bba93f726 add option to disable inline gtk theme
Tomasz Mon <desowin@gmail.com>
parents: 4080
diff changeset
351 {"disable_inline_gtk", &cfg.disable_inline_gtk, TRUE},
4116
5853d43e539a remember filter entry in jtf dialog is extremely useful when jtf deals with large playlist. now this feature is configurable.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 4112
diff changeset
352 {"remember_jtf_entry", &cfg.remember_jtf_entry, TRUE},
4236
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
353 {"enable_replay_gain", &cfg.enable_replay_gain, TRUE},
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
354 {"enable_clipping_prevention", &cfg.enable_clipping_prevention, TRUE},
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
355 {"replay_gain_track", &cfg.replay_gain_track, TRUE},
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
356 {"replay_gain_album", &cfg.replay_gain_album, TRUE},
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
357 {"enable_hard_limiter", &cfg.enable_hard_limiter, TRUE},
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
358 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
359
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
360 static gint ncfgbent = G_N_ELEMENTS(bmp_boolents);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
361
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
362 static bmp_cfg_nument bmp_numents[] = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
363 {"player_x", &cfg.player_x, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
364 {"player_y", &cfg.player_y, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
365 {"timer_mode", &cfg.timer_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
366 {"vis_type", &cfg.vis_type, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
367 {"analyzer_mode", &cfg.analyzer_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
368 {"analyzer_type", &cfg.analyzer_type, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
369 {"scope_mode", &cfg.scope_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
370 {"vu_mode", &cfg.vu_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
371 {"voiceprint_mode", &cfg.voiceprint_mode, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
372 {"vis_refresh_rate", &cfg.vis_refresh, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
373 {"analyzer_falloff", &cfg.analyzer_falloff, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
374 {"peaks_falloff", &cfg.peaks_falloff, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
375 {"playlist_x", &cfg.playlist_x, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
376 {"playlist_y", &cfg.playlist_y, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
377 {"playlist_width", &cfg.playlist_width, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
378 {"playlist_height", &cfg.playlist_height, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
379 {"playlist_position", &cfg.playlist_position, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
380 {"equalizer_x", &cfg.equalizer_x, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
381 {"equalizer_y", &cfg.equalizer_y, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
382 {"snap_distance", &cfg.snap_distance, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
383 {"pause_between_songs_time", &cfg.pause_between_songs_time, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
384 {"mouse_wheel_change", &cfg.mouse_change, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
385 {"scroll_pl_by", &cfg.scroll_pl_by, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
386 {"titlestring_preset", &cfg.titlestring_preset, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
387 {"resume_playback_on_startup_time", &cfg.resume_playback_on_startup_time, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
388 {"output_buffer_size", &cfg.output_buffer_size, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
389 {"recurse_for_cover_depth", &cfg.recurse_for_cover_depth, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
390 {"filepopup_pixelsize", &cfg.filepopup_pixelsize, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
391 {"filepopup_delay", &cfg.filepopup_delay, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
392 {"colorize_r", &cfg.colorize_r, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
393 {"colorize_g", &cfg.colorize_g, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
394 {"colorize_b", &cfg.colorize_b, TRUE},
4232
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4224
diff changeset
395 {"output_bit_depth", &cfg.output_bit_depth, TRUE},
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
396 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
397
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
398 static gint ncfgient = G_N_ELEMENTS(bmp_numents);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
399
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
400 static bmp_cfg_strent bmp_strents[] = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
401 {"playlist_font", &cfg.playlist_font, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
402 {"mainwin_font", &cfg.mainwin_font, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
403 {"eqpreset_default_file", &cfg.eqpreset_default_file, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
404 {"eqpreset_extension", &cfg.eqpreset_extension, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
405 {"skin", &cfg.skin, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
406 {"output_plugin", &cfg.outputplugin, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
407 {"disabled_iplugins", &cfg.disabled_iplugins, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
408 {"enabled_gplugins", &cfg.enabled_gplugins, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
409 {"enabled_vplugins", &cfg.enabled_vplugins, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
410 {"enabled_eplugins", &cfg.enabled_eplugins, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
411 {"filesel_path", &cfg.filesel_path, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
412 {"playlist_path", &cfg.playlist_path, FALSE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
413 {"generic_title_format", &cfg.gentitle_format, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
414 {"chardet_detector", &cfg.chardet_detector, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
415 {"chardet_fallback", &cfg.chardet_fallback, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
416 {"cover_name_include", &cfg.cover_name_include, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
417 {"cover_name_exclude", &cfg.cover_name_exclude, TRUE},
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
418 {"session_uri_base", &cfg.session_uri_base, TRUE}
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
419 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
420
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
421 static gint ncfgsent = G_N_ELEMENTS(bmp_strents);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
422
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
423 gchar *bmp_paths[BMP_PATH_COUNT] = {};
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
424
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
425 GList *dock_window_list = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
426
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
427 /* XXX: case-sensitivity is bad for lazy nenolods. :( -nenolod */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
428 static gchar *pl_candidates[] = {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
429 PLUGIN_FILENAME("ALSA"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
430 PLUGIN_FILENAME("coreaudio"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
431 PLUGIN_FILENAME("OSS"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
432 PLUGIN_FILENAME("sun"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
433 PLUGIN_FILENAME("ESD"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
434 PLUGIN_FILENAME("pulse_audio"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
435 PLUGIN_FILENAME("disk_writer"),
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
436 NULL
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
437 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
438
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
439 GCond *cond_scan;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
440 GMutex *mutex_scan;
3346
71d8d93f1bad Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents: 3334
diff changeset
441 #ifdef USE_DBUS
71d8d93f1bad Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents: 3334
diff changeset
442 MprisPlayer *mpris;
71d8d93f1bad Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents: 3334
diff changeset
443 #endif
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
444
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
445 static GSList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
446 get_feature_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
447 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
448 GSList *features = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
449
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
450 #ifdef HAVE_GCONF
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
451 features = g_slist_append(features, "GConf");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
452 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
453
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
454 return features;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
455 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
456
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
457 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
458 dump_version(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
459 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
460 GSList *features;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
461
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
462 g_printf("%s %s [%s]", _(application_name), VERSION, svn_stamp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
463
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
464 features = get_feature_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
465
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
466 if (features) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
467 GSList *item;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
468
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
469 g_printf(" (");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
470
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
471 for (item = features; g_slist_next(item); item = g_slist_next(item))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
472 g_printf("%s, ", (const gchar *) item->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
473
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
474 g_printf("%s)", (const gchar *) item->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
475
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
476 g_slist_free(features);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
477 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
478
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
479 g_printf("\n");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
480 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
481
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
482 const gchar *
3334
ea806daf3ef0 rename xmms_get_gentitle_format() to get_gentitle_format().
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3317
diff changeset
483 get_gentitle_format(void)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
484 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
485 guint titlestring_preset = cfg.titlestring_preset;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
486
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
487 if (titlestring_preset < n_titlestring_presets)
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
488 return bmp_titlestring_presets[titlestring_preset];
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
489
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
490 return cfg.gentitle_format;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
491 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
492
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
493 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
494 make_directory(const gchar * path, mode_t mode)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
495 {
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
496 if (g_mkdir_with_parents(path, mode) == 0)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
497 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
498
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
499 g_printerr(_("Could not create directory (%s): %s\n"), path,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
500 g_strerror(errno));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
501 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
502
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
503 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
504 bmp_make_user_dir(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
505 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
506 const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
507
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
508 make_directory(bmp_paths[BMP_PATH_USER_DIR], mode755);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
509 make_directory(bmp_paths[BMP_PATH_USER_PLUGIN_DIR], mode755);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
510 make_directory(bmp_paths[BMP_PATH_USER_SKIN_DIR], mode755);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
511 make_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR], mode755);
3400
8764498b75ed Add new playlists directory to paths
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3351
diff changeset
512 make_directory(bmp_paths[BMP_PATH_PLAYLISTS_DIR], mode755);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
513 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
514
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
515 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
516 bmp_free_paths(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
517 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
518 int i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
519
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
520 for (i = 0; i < BMP_PATH_COUNT; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
521 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
522 g_free(bmp_paths[i]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
523 bmp_paths[i] = 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
524 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
525 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
526
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
527 static void
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
528 bmp_init_paths()
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
529 {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
530 char *xdg_config_home;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
531 char *xdg_data_home;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
532 char *xdg_cache_home;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
533
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
534 xdg_config_home = (getenv("XDG_CONFIG_HOME") == NULL
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
535 ? g_build_filename(g_get_home_dir(), ".config", NULL)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
536 : g_strdup(getenv("XDG_CONFIG_HOME")));
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
537 xdg_data_home = (getenv("XDG_DATA_HOME") == NULL
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
538 ? g_build_filename(g_get_home_dir(), ".local", "share", NULL)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
539 : g_strdup(getenv("XDG_DATA_HOME")));
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
540 xdg_cache_home = (getenv("XDG_CACHE_HOME") == NULL
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
541 ? g_build_filename(g_get_home_dir(), ".cache", NULL)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
542 : g_strdup(getenv("XDG_CACHE_HOME")));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
543
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
544 bmp_paths[BMP_PATH_USER_DIR] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
545 g_build_filename(xdg_config_home, "audacious", NULL);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
546 bmp_paths[BMP_PATH_USER_SKIN_DIR] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
547 g_build_filename(xdg_data_home, "audacious", "Skins", NULL);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
548 bmp_paths[BMP_PATH_USER_PLUGIN_DIR] =
2506
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
549 g_build_filename(xdg_data_home, "audacious", "Plugins", NULL);
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
550
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
551 bmp_paths[BMP_PATH_SKIN_THUMB_DIR] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
552 g_build_filename(xdg_cache_home, "audacious", "thumbs", NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
553
3400
8764498b75ed Add new playlists directory to paths
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3351
diff changeset
554 bmp_paths[BMP_PATH_PLAYLISTS_DIR] =
8764498b75ed Add new playlists directory to paths
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3351
diff changeset
555 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "playlists", NULL);
8764498b75ed Add new playlists directory to paths
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3351
diff changeset
556
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
557 bmp_paths[BMP_PATH_CONFIG_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
558 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "config", NULL);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
559 #ifdef HAVE_XSPF_PLAYLIST
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
560 bmp_paths[BMP_PATH_PLAYLIST_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
561 g_build_filename(bmp_paths[BMP_PATH_USER_DIR],
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
562 "playlist.xspf", NULL);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
563 #else
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
564 bmp_paths[BMP_PATH_PLAYLIST_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
565 g_build_filename(bmp_paths[BMP_PATH_USER_DIR],
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
566 "playlist.m3u", NULL);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
567 #endif
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
568 bmp_paths[BMP_PATH_ACCEL_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
569 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "accels", NULL);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
570 bmp_paths[BMP_PATH_LOG_FILE] =
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
571 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "log", NULL);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
572
2463
e32be86095aa [svn] - re-add support for gtkrc files
nenolod
parents: 2461
diff changeset
573 bmp_paths[BMP_PATH_GTKRC_FILE] =
2570
7b1b52eb663b [svn] - Minor cleanups
mf0102
parents: 2551
diff changeset
574 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "gtkrc", NULL);
2463
e32be86095aa [svn] - re-add support for gtkrc files
nenolod
parents: 2461
diff changeset
575
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
576 g_free(xdg_config_home);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
577 g_free(xdg_data_home);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
578 g_free(xdg_cache_home);
2317
49d285f6008b [svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents: 2313
diff changeset
579
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
580 g_atexit(bmp_free_paths);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
581 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
582
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
583 void
2682
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
584 bmp_config_free(void)
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
585 {
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
586 gint i;
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
587 for (i = 0; i < ncfgsent; ++i) {
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
588 if ( *(bmp_strents[i].se_vloc) != NULL )
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
589 {
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
590 g_free( *(bmp_strents[i].se_vloc) );
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
591 *(bmp_strents[i].se_vloc) = NULL;
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
592 }
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
593 }
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
594 }
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
595
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2662
diff changeset
596 void
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
597 bmp_config_load(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
598 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
599 ConfigDb *db;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
600 gint i, length;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
601
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
602 memcpy(&cfg, &bmp_default_config, sizeof(BmpConfig));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
603
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
604 db = cfg_db_open();
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
605 for (i = 0; i < ncfgbent; ++i) {
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
606 cfg_db_get_bool(db, NULL,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
607 bmp_boolents[i].be_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
608 bmp_boolents[i].be_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
609 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
610
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
611 for (i = 0; i < ncfgient; ++i) {
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
612 cfg_db_get_int(db, NULL,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
613 bmp_numents[i].ie_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
614 bmp_numents[i].ie_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
615 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
616
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
617 for (i = 0; i < ncfgsent; ++i) {
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
618 cfg_db_get_string(db, NULL,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
619 bmp_strents[i].se_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
620 bmp_strents[i].se_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
621 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
622
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
623 /* Preset */
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
624 cfg_db_get_float(db, NULL, "equalizer_preamp", &cfg.equalizer_preamp);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
625 for (i = 0; i < 10; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
626 gchar eqtext[18];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
627
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
628 g_snprintf(eqtext, sizeof(eqtext), "equalizer_band%d", i);
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
629 cfg_db_get_float(db, NULL, eqtext, &cfg.equalizer_bands[i]);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
630 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
631
4224
9b8d6438e00f load/save the scale value
Cristi Magherusan <majeru@atheme.org>
parents: 4223
diff changeset
632 /* custom scale factor */
9b8d6438e00f load/save the scale value
Cristi Magherusan <majeru@atheme.org>
parents: 4223
diff changeset
633 cfg_db_get_float(db, NULL, "scale_factor", &cfg.scale_factor);
9b8d6438e00f load/save the scale value
Cristi Magherusan <majeru@atheme.org>
parents: 4223
diff changeset
634
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
635 /* History */
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
636 if (cfg_db_get_int(db, NULL, "url_history_length", &length)) {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
637 for (i = 1; i <= length; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
638 gchar str[19], *tmp;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
639
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
640 g_snprintf(str, sizeof(str), "url_history%d", i);
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
641 if (cfg_db_get_string(db, NULL, str, &tmp))
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
642 cfg.url_history = g_list_append(cfg.url_history, tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
643 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
644 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
645
4236
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
646 /* RG settings */
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
647 cfg_db_get_float(db, NULL, "replay_gain_preamp", &cfg.replay_gain_preamp);
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
648 cfg_db_get_float(db, NULL, "default_gain", &cfg.default_gain);
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
649
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
650 cfg_db_close(db);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
651
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
652
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
653 if (cfg.playlist_font && strlen(cfg.playlist_font) == 0) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
654 g_free(cfg.playlist_font);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
655 cfg.playlist_font = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
656 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
657
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
658 if (cfg.mainwin_font && strlen(cfg.mainwin_font) == 0) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
659 g_free(cfg.mainwin_font);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
660 cfg.mainwin_font = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
661 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
662
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
663 if (!cfg.playlist_font)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
664 cfg.playlist_font = g_strdup(PLAYLISTWIN_DEFAULT_FONT);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
665
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
666 if (!cfg.mainwin_font)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
667 cfg.mainwin_font = g_strdup(MAINWIN_DEFAULT_FONT);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
668
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
669 if (!cfg.gentitle_format)
3317
d18d66f1b1d0 whoops...
William Pitcock <nenolod@atheme-project.org>
parents: 3306
diff changeset
670 cfg.gentitle_format = g_strdup("${?artist:${artist} - }${?album:${album} - }${title}");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
671
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
672 if (!cfg.outputplugin) {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
673 gint iter;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
674 gchar *pl_path = g_build_filename(PLUGIN_DIR, plugin_dir_list[0], NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
675
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
676 for (iter = 0; pl_candidates[iter] != NULL && cfg.outputplugin == NULL; iter++)
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
677 {
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
678 cfg.outputplugin = find_file_recursively(pl_path, pl_candidates[iter]);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
679 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
680
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
681 g_free(pl_path);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
682 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
683
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
684 if (!cfg.eqpreset_default_file)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
685 cfg.eqpreset_default_file = g_strdup(EQUALIZER_DEFAULT_DIR_PRESET);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
686
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
687 if (!cfg.eqpreset_extension)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
688 cfg.eqpreset_extension = g_strdup(EQUALIZER_DEFAULT_PRESET_EXT);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
689
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
690 if (!cfg.chardet_detector)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
691 cfg.chardet_detector = g_strdup("");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
692
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
693 if (!cfg.chardet_fallback)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
694 cfg.chardet_fallback = g_strdup("");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
695
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
696 if (!cfg.cover_name_include)
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
697 cfg.cover_name_include = g_strdup("");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
698
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
699 if (!cfg.cover_name_exclude)
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
700 cfg.cover_name_exclude = g_strdup("back");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
701
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
702 if (!cfg.session_uri_base)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
703 cfg.session_uri_base = g_strdup("");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
704
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
705 /* at least one of these should be true */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
706 if ((!cfg.get_info_on_demand) && (!cfg.get_info_on_load))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
707 cfg.get_info_on_demand = TRUE;
4104
7b01df6730eb cfg.playlist_width and cfg.playlist_height can't be smaller than minimum values for those; fixes #11
Tomasz Mon <desowin@gmail.com>
parents: 4088
diff changeset
708
7b01df6730eb cfg.playlist_width and cfg.playlist_height can't be smaller than minimum values for those; fixes #11
Tomasz Mon <desowin@gmail.com>
parents: 4088
diff changeset
709 /* playlist width and height can't be smaller than minimum */
7b01df6730eb cfg.playlist_width and cfg.playlist_height can't be smaller than minimum values for those; fixes #11
Tomasz Mon <desowin@gmail.com>
parents: 4088
diff changeset
710 cfg.playlist_width = MAX(cfg.playlist_width, PLAYLISTWIN_MIN_WIDTH);
7b01df6730eb cfg.playlist_width and cfg.playlist_height can't be smaller than minimum values for those; fixes #11
Tomasz Mon <desowin@gmail.com>
parents: 4088
diff changeset
711 cfg.playlist_height = MAX(cfg.playlist_height, PLAYLISTWIN_MIN_HEIGHT);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
712 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
713
3481
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
714 static gboolean
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
715 save_extra_playlist(const gchar * path, const gchar * basename,
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
716 gpointer savedlist)
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
717 {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
718 GList *playlists, *iter;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
719 GList **saved;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
720 Playlist *playlist;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
721 int found;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
722 gchar *filename;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
723
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
724 playlists = playlist_get_playlists();
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
725 saved = (GList **) savedlist;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
726
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
727 found = 0;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
728 for (iter = playlists; iter; iter = iter->next) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
729 playlist = (Playlist *) iter->data;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
730 if (g_list_find(*saved, playlist)) continue;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
731 filename = playlist_filename_get(playlist);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
732 if (!filename) continue;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
733 if (strcmp(filename, path) == 0) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
734 /* Save playlist */
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
735 playlist_save(playlist, path);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
736 *saved = g_list_prepend(*saved, playlist);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
737 found = 1;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
738 g_free(filename);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
739 break;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
740 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
741 g_free(filename);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
742 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
743
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
744 if(!found) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
745 /* Remove playlist */
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
746 unlink(path);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
747 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
748
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
749 return FALSE; /* process other playlists */
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
750 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
751
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
752 static void
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
753 save_other_playlists(GList *saved)
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
754 {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
755 GList *playlists, *iter;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
756 Playlist *playlist;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
757 gchar *pos, *ext, *basename, *filename, *newbasename;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
758 int i, num, isdigits;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
759
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
760 playlists = playlist_get_playlists();
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
761 for(iter = playlists; iter; iter = iter->next) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
762 playlist = (Playlist *) iter->data;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
763 if (g_list_find(saved, playlist)) continue;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
764 filename = playlist_filename_get(playlist);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
765 if (!filename || !filename[0]
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
766 || g_file_test(filename, G_FILE_TEST_IS_DIR)) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
767 /* default basename */
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
768 #ifdef HAVE_XSPF_PLAYLIST
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
769 basename = g_strdup("playlist_01.xspf");
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
770 #else
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
771 basename = g_strdup("playlist_01.m3u");
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
772 #endif
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
773 } else {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
774 basename = g_path_get_basename(filename);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
775 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
776 g_free(filename);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
777 if ((pos = strrchr(basename, '.'))) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
778 *pos = '\0';
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
779 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
780 #ifdef HAVE_XSPF_PLAYLIST
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
781 ext = ".xspf";
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
782 #else
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
783 ext = ".m3u";
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
784 #endif
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
785 num = -1;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
786 if ((pos = strrchr(basename, '_'))) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
787 isdigits = 0;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
788 for (i=1; pos[i]; i++) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
789 if (!g_ascii_isdigit(pos[i])) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
790 isdigits = 0;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
791 break;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
792 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
793 isdigits = 1;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
794 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
795 if (isdigits) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
796 num = atoi(pos+1) + 1;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
797 *pos = '\0';
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
798 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
799 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
800 /* attempt to generate unique filename */
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
801 filename = NULL;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
802 do {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
803 g_free(filename);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
804 if (num < 0) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
805 /* try saving without number first */
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
806 newbasename = g_strdup_printf("%s%s", basename, ext);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
807 num = 1;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
808 } else {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
809 newbasename = g_strdup_printf("%s_%02d%s", basename, num, ext);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
810 num++;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
811 if (num < 0) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
812 g_warning("Playlist number in filename overflowed."
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
813 " Not saving playlist.\n");
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
814 goto cleanup;
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
815 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
816 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
817 filename = g_build_filename(bmp_paths[BMP_PATH_PLAYLISTS_DIR],
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
818 newbasename, NULL);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
819 g_free(newbasename);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
820 } while (g_file_test(filename, G_FILE_TEST_EXISTS));
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
821
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
822 playlist_save(playlist, filename);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
823 cleanup:
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
824 g_free(filename);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
825 g_free(basename);
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
826 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
827 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
828
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
829 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
830 bmp_config_save(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
831 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
832 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
833 gchar *str;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
834 gint i, cur_pb_time;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
835 ConfigDb *db;
3481
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
836 GList *saved;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
837 Playlist *playlist = playlist_get_active();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
838
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
839 cfg.disabled_iplugins = input_stringify_disabled_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
840
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
841
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
842 db = cfg_db_open();
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
843
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
844 for (i = 0; i < ncfgbent; ++i)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
845 if (bmp_boolents[i].be_wrt)
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
846 cfg_db_set_bool(db, NULL,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
847 bmp_boolents[i].be_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
848 *bmp_boolents[i].be_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
849
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
850 for (i = 0; i < ncfgient; ++i)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
851 if (bmp_numents[i].ie_wrt)
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
852 cfg_db_set_int(db, NULL,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
853 bmp_numents[i].ie_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
854 *bmp_numents[i].ie_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
855
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
856 /* This is a bit lame .. it'll end up being written twice,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
857 * could do with being done a bit neater. -larne */
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
858 cfg_db_set_int(db, NULL, "playlist_position",
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
859 playlist_get_position(playlist));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
860
2530
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
861 /* FIXME: we're looking up SkinnedWindow::x &c ourselves here.
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
862 * this isn't exactly right. -nenolod
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
863 */
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
864 if ( SKINNED_WINDOW(playlistwin)->x != -1 &&
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
865 SKINNED_WINDOW(playlistwin)->y != -1 )
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
866 {
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
867 cfg_db_set_int(db, NULL, "playlist_x",
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
868 SKINNED_WINDOW(playlistwin)->x);
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
869 cfg_db_set_int(db, NULL, "playlist_y",
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
870 SKINNED_WINDOW(playlistwin)->y);
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
871 }
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
872
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
873 if ( SKINNED_WINDOW(mainwin)->x != -1 &&
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
874 SKINNED_WINDOW(mainwin)->y != -1 )
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
875 {
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
876 cfg_db_set_int(db, NULL, "player_x",
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
877 SKINNED_WINDOW(mainwin)->x);
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
878 cfg_db_set_int(db, NULL, "player_y",
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
879 SKINNED_WINDOW(mainwin)->y);
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
880 }
2530
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
881
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
882 if ( SKINNED_WINDOW(equalizerwin)->x != -1 &&
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
883 SKINNED_WINDOW(equalizerwin)->y != -1 )
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
884 {
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
885 cfg_db_set_int(db, NULL, "equalizer_x",
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
886 SKINNED_WINDOW(equalizerwin)->x);
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
887 cfg_db_set_int(db, NULL, "equalizer_y",
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
888 SKINNED_WINDOW(equalizerwin)->y);
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
889 }
2530
7c6ce705adda [svn] - manually save player positions.
nenolod
parents: 2512
diff changeset
890
4080
1e754514065d introduce WIDGET_FONT_BTN
Tomasz Mon <desowin@gmail.com>
parents: 4053
diff changeset
891 cfg_db_set_bool(db, NULL, "mainwin_use_bitmapfont",
1e754514065d introduce WIDGET_FONT_BTN
Tomasz Mon <desowin@gmail.com>
parents: 4053
diff changeset
892 cfg.mainwin_use_bitmapfont);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
893
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
894 for (i = 0; i < ncfgsent; ++i) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
895 if (bmp_strents[i].se_wrt)
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
896 cfg_db_set_string(db, NULL,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
897 bmp_strents[i].se_vname,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
898 *bmp_strents[i].se_vloc);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
899 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
900
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
901 cfg_db_set_float(db, NULL, "equalizer_preamp", cfg.equalizer_preamp);
4236
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
902
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
903 /* RG settings */
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
904 cfg_db_set_float(db, NULL, "replay_gain_preamp", cfg.replay_gain_preamp);
1ab015fe2ade RG icon added. some changes
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4234
diff changeset
905 cfg_db_set_float(db, NULL, "default_gain", cfg.default_gain);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
906
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
907 for (i = 0; i < 10; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
908 str = g_strdup_printf("equalizer_band%d", i);
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
909 cfg_db_set_float(db, NULL, str, cfg.equalizer_bands[i]);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
910 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
911 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
912
4224
9b8d6438e00f load/save the scale value
Cristi Magherusan <majeru@atheme.org>
parents: 4223
diff changeset
913 cfg_db_set_float(db, NULL, "scale_factor", cfg.scale_factor);
9b8d6438e00f load/save the scale value
Cristi Magherusan <majeru@atheme.org>
parents: 4223
diff changeset
914
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
915 if (bmp_active_skin != NULL)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
916 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
917 if (bmp_active_skin->path)
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
918 cfg_db_set_string(db, NULL, "skin", bmp_active_skin->path);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
919 else
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
920 cfg_db_unset_key(db, NULL, "skin");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
921 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
922
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
923 if (get_current_output_plugin())
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
924 cfg_db_set_string(db, NULL, "output_plugin",
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
925 get_current_output_plugin()->filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
926 else
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
927 cfg_db_unset_key(db, NULL, "output_plugin");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
928
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
929 str = general_stringify_enabled_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
930 if (str) {
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
931 cfg_db_set_string(db, NULL, "enabled_gplugins", str);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
932 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
933 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
934 else
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
935 cfg_db_unset_key(db, NULL, "enabled_gplugins");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
936
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
937 str = vis_stringify_enabled_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
938 if (str) {
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
939 cfg_db_set_string(db, NULL, "enabled_vplugins", str);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
940 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
941 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
942 else
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
943 cfg_db_unset_key(db, NULL, "enabled_vplugins");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
944
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
945 str = effect_stringify_enabled_list();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
946 if (str) {
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
947 cfg_db_set_string(db, NULL, "enabled_eplugins", str);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
948 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
949 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
950 else
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
951 cfg_db_unset_key(db, NULL, "enabled_eplugins");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
952
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
953 if (cfg.filesel_path)
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
954 cfg_db_set_string(db, NULL, "filesel_path", cfg.filesel_path);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
955
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
956 if (cfg.playlist_path)
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
957 cfg_db_set_string(db, NULL, "playlist_path", cfg.playlist_path);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
958
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
959 cfg_db_set_int(db, NULL, "url_history_length",
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
960 g_list_length(cfg.url_history));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
961
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
962 for (node = cfg.url_history, i = 1; node; node = g_list_next(node), i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
963 str = g_strdup_printf("url_history%d", i);
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
964 cfg_db_set_string(db, NULL, str, node->data);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
965 g_free(str);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
966 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
967
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
968 if (playback_get_playing()) {
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
969 cur_pb_time = playback_get_time();
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
970 } else
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
971 cur_pb_time = -1;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
972 cfg.resume_playback_on_startup_time = cur_pb_time;
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
973 cfg_db_set_int(db, NULL, "resume_playback_on_startup_time",
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
974 cfg.resume_playback_on_startup_time);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
975
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3679
diff changeset
976 cfg_db_close(db);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
977
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
978 playlist_save(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]);
3481
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
979
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
980 /* Save extra playlists that were loaded from PLAYLISTS_DIR */
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
981 saved = NULL;
3530
08dae20c75f0 Don't store default playlist in the playlists/ directory.
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3526
diff changeset
982 saved = g_list_prepend(saved, playlist); /* don't save default again */
3481
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
983 if(!dir_foreach(bmp_paths[BMP_PATH_PLAYLISTS_DIR], save_extra_playlist,
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
984 &saved, NULL)) {
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
985 g_warning("Could not save extra playlists\n");
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
986 }
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
987
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
988 /* Save other playlists to PLAYLISTS_DIR */
308e5fb348db Save extra playlists on exit
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3480
diff changeset
989 save_other_playlists(saved);
4112
11f33d0e1c34 Fixes memory leak in bmp_config_save() by freeing temporary saved playlists list. (Bugzilla #41)
Jussi Judin <jjudin+audacious@iki.fi>
parents: 4104
diff changeset
990 g_list_free(saved);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
991 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
992
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
993 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
994 bmp_set_default_icon(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
995 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
996 GdkPixbuf *icon;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
997
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
998 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) audacious_player_xpm);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
999 gtk_window_set_default_icon(icon);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1000 g_object_unref(icon);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1001 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1002
3525
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1003 #ifdef GDK_WINDOWING_QUARTZ
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1004 static void
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1005 set_dock_icon(void)
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1006 {
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1007 GdkPixbuf *icon, *pixbuf;
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1008 CGColorSpaceRef colorspace;
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1009 CGDataProviderRef data_provider;
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1010 CGImageRef image;
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1011 gpointer data;
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1012 gint rowstride, pixbuf_width, pixbuf_height;
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1013 gboolean has_alpha;
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1014
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1015 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) audacious_player_xpm);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1016 pixbuf = gdk_pixbuf_scale_simple(icon, 128, 128, GDK_INTERP_BILINEAR);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1017
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1018 data = gdk_pixbuf_get_pixels(pixbuf);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1019 pixbuf_width = gdk_pixbuf_get_width(pixbuf);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1020 pixbuf_height = gdk_pixbuf_get_height(pixbuf);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1021 rowstride = gdk_pixbuf_get_rowstride(pixbuf);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1022 has_alpha = gdk_pixbuf_get_has_alpha(pixbuf);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1023
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1024 /* create the colourspace for the CGImage. */
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1025 colorspace = CGColorSpaceCreateDeviceRGB();
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1026 data_provider = CGDataProviderCreateWithData(NULL, data, pixbuf_height * rowstride, NULL);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1027 image = CGImageCreate(pixbuf_width, pixbuf_height, 8,
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1028 has_alpha ? 32 : 24, rowstride, colorspace,
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1029 has_alpha ? kCGImageAlphaLast : 0,
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1030 data_provider, NULL, FALSE,
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1031 kCGRenderingIntentDefault);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1032
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1033 /* release the colourspace and data provider, we have what we want. */
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1034 CGDataProviderRelease(data_provider);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1035 CGColorSpaceRelease(colorspace);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1036
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1037 /* set the dock tile images */
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1038 SetApplicationDockTileImage(image);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1039
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1040 #if 0
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1041 /* and release */
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1042 CGImageRelease(image);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1043 g_object_unref(icon);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1044 g_object_unref(pixbuf);
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1045 #endif
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1046 }
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1047 #endif
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1048
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1049 static GOptionEntry cmd_entries[] = {
2448
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1050 {"rew", 'r', 0, G_OPTION_ARG_NONE, &options.rew, N_("Skip backwards in playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1051 {"play", 'p', 0, G_OPTION_ARG_NONE, &options.play, N_("Start playing current playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1052 {"pause", 'u', 0, G_OPTION_ARG_NONE, &options.pause, N_("Pause current song"), NULL},
2475
5fcdef6e3754 [svn] - fix audacious -s, closes #778.
nenolod
parents: 2463
diff changeset
1053 {"stop", 's', 0, G_OPTION_ARG_NONE, &options.stop, N_("Stop current song"), NULL},
2551
cea3528b2996 [svn] Fix --play-pause commandline option, by Alex "Monkey" Maclean in #gentoo-x86
chainsaw
parents: 2530
diff changeset
1054 {"play-pause", 't', 0, G_OPTION_ARG_NONE, &options.play_pause, N_("Pause if playing, play otherwise"), NULL},
2448
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1055 {"fwd", 'f', 0, G_OPTION_ARG_NONE, &options.fwd, N_("Skip forward in playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1056 {"show-jump-box", 'j', 0, G_OPTION_ARG_NONE, &options.show_jump_box, N_("Display Jump to File dialog"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1057 {"enqueue", 'e', 0, G_OPTION_ARG_NONE, &options.enqueue, N_("Don't clear the playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1058 {"enqueue-to-temp", 'E', 0, G_OPTION_ARG_NONE, &options.enqueue_to_temp, N_("Add new files to a temporary playlist"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1059 {"show-main-window", 'm', 0, G_OPTION_ARG_NONE, &options.mainwin, N_("Display the main window"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1060 {"activate", 'a', 0, G_OPTION_ARG_NONE, &options.activate, N_("Display all open Audacious windows"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1061 {"headless", 'H', 0, G_OPTION_ARG_NONE, &options.headless, N_("Enable headless operation"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1062 {"no-log", 'N', 0, G_OPTION_ARG_NONE, &options.no_log, N_("Print all errors and warnings to stdout"), NULL},
ff135e2ba10e [svn] - mark some strings used by GOption as translatable
nenolod
parents: 2420
diff changeset
1063 {"version", 'v', 0, G_OPTION_ARG_NONE, &options.version, N_("Show version and builtin features"), NULL},
4200
c010163b6286 It's now a .app on MacOS
Chris Fuenty <zimmy@atheme.org>
parents: 4193
diff changeset
1064 #ifdef GDK_WINDOWING_QUARTZ
c010163b6286 It's now a .app on MacOS
Chris Fuenty <zimmy@atheme.org>
parents: 4193
diff changeset
1065 {"macpack", 'n', 0, G_OPTION_ARG_NONE, &options.macpack, N_("Used in macpacking"), NULL}, /* Make this hidden */
c010163b6286 It's now a .app on MacOS
Chris Fuenty <zimmy@atheme.org>
parents: 4193
diff changeset
1066 #endif
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1067 {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &options.filenames, N_("FILE..."), NULL},
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1068 {NULL},
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1069 };
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1070
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1071 static gboolean
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1072 aud_start_playback(gpointer unused)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1073 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1074 drct_play();
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1075 return FALSE;
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1076 }
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1077
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1078 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1079 handle_cmd_line_options(BmpCmdLineOpt * options,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1080 gboolean remote)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1081 {
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1082 gchar **filenames = options->filenames;
2785
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2736
diff changeset
1083 #ifdef USE_DBUS
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2736
diff changeset
1084 DBusGProxy *session = audacious_get_dbus_proxy();
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1085 gboolean is_running = audacious_remote_is_running(session);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1086 #else
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1087 gboolean is_running = FALSE;
2727
14f9a629ba9c [svn] - rename xmms_remote namespace to audacious_remote namespace
nenolod
parents: 2717
diff changeset
1088 #endif
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1089
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1090 if (options->version)
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1091 {
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1092 dump_version();
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1093 exit(EXIT_SUCCESS);
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1094 }
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1095
2788
b2b920b165ad [svn] - exclude codes which use session if USE_DBUS is not defined.
yaz
parents: 2786
diff changeset
1096 #ifdef USE_DBUS
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1097 if (is_running)
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1098 {
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1099 if (filenames != NULL)
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1100 {
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1101 gint pos = 0;
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1102 gint i = 0;
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1103 GList *fns = NULL;
2512
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
1104
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1105 for (i = 0; filenames[i] != NULL; i++)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1106 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1107 gchar *filename;
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1108 gchar *current_dir = g_get_current_dir();
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1109
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1110 if (!strstr(filenames[i], "://"))
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1111 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1112 if (filenames[i][0] == '/')
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1113 filename = g_strdup_printf("file:///%s", filenames[i]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1114 else
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1115 filename = g_strdup_printf("file:///%s/%s", current_dir, filenames[i]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1116 }
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1117 else
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1118 filename = g_strdup(filenames[i]);
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1119
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1120 fns = g_list_prepend(fns, filename);
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1121
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1122 g_free(current_dir);
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1123 }
2512
3a1fc6f7c187 [svn] - unbreak relative path support. closes #791.
nenolod
parents: 2506
diff changeset
1124
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1125 fns = g_list_reverse(fns);
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
1126
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1127 if (options->load_skins)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1128 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1129 audacious_remote_set_skin(session, filenames[0]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1130 skin_install_skin(filenames[0]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1131 }
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1132 else
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1133 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1134 GList *i;
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1135
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1136 if (options->enqueue_to_temp)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1137 audacious_remote_playlist_enqueue_to_temp(session, filenames[0]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1138
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1139 if (options->enqueue && options->play)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1140 pos = audacious_remote_get_playlist_length(session);
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
1141
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1142 if (!options->enqueue)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1143 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1144 audacious_remote_playlist_clear(session);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1145 audacious_remote_stop(session);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1146 }
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1147
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1148 for (i = fns; i != NULL; i = i->next)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1149 audacious_remote_playlist_add_url_string(session, i->data);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1150
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1151 if (options->enqueue && options->play &&
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1152 audacious_remote_get_playlist_length(session) > pos)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1153 audacious_remote_set_playlist_pos(session, pos);
2605
1ceaf00f9c6d [svn] - fix handling of multiple files on the command line.
nenolod
parents: 2574
diff changeset
1154
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1155 if (!options->enqueue)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1156 audacious_remote_play(session);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1157 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1158
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1159 g_list_foreach(fns, (GFunc) g_free, NULL);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1160 g_list_free(fns);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1161
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1162 g_strfreev(filenames);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1163 } /* filename */
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1164
2832
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1165 if (options->rew)
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1166 audacious_remote_playlist_prev(session);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1167
2832
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1168 if (options->play)
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1169 audacious_remote_play(session);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1170
2832
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1171 if (options->pause)
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1172 audacious_remote_pause(session);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1173
2832
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1174 if (options->stop)
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1175 audacious_remote_stop(session);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1176
2832
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1177 if (options->fwd)
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1178 audacious_remote_playlist_next(session);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1179
2832
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1180 if (options->play_pause)
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1181 audacious_remote_play_pause(session);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1182
2832
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1183 if (options->show_jump_box)
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1184 audacious_remote_show_jtf_box(session);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1185
2832
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1186 if (options->mainwin)
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1187 audacious_remote_main_win_toggle(session, TRUE);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1188
2832
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1189 if (options->activate)
a6f541819bbc [svn] fixed bug #972
magma
parents: 2806
diff changeset
1190 audacious_remote_activate(session);
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1191
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1192 exit(EXIT_SUCCESS);
4026
17bf734f8187 avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3978
diff changeset
1193 } /* is_running */
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1194 else
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1195 #endif
4026
17bf734f8187 avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3978
diff changeset
1196 { /* !is_running */
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1197 if (filenames != NULL)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1198 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1199 gint pos = 0;
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1200 gint i = 0;
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1201 GList *fns = NULL;
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1202
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1203 for (i = 0; filenames[i] != NULL; i++)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1204 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1205 gchar *filename;
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1206 gchar *current_dir = g_get_current_dir();
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1207
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1208 if (!strstr(filenames[i], "://"))
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1209 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1210 if (filenames[i][0] == '/')
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1211 filename = g_strdup_printf("file:///%s", filenames[i]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1212 else
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1213 filename = g_strdup_printf("file:///%s/%s", current_dir, filenames[i]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1214 }
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1215 else
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1216 filename = g_strdup(filenames[i]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1217
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1218 fns = g_list_prepend(fns, filename);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1219
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1220 g_free(current_dir);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1221 }
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1222
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1223 fns = g_list_reverse(fns);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1224
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1225 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1226 if (options->enqueue_to_temp)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1227 drct_pl_enqueue_to_temp(filenames[0]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1228
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1229 if (options->enqueue && options->play)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1230 pos = drct_pl_get_length();
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1231
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1232 if (!options->enqueue)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1233 {
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1234 drct_pl_clear();
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1235 drct_stop();
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1236 }
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1237
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1238 drct_pl_add(fns);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1239
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1240 if (options->enqueue && options->play &&
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1241 drct_pl_get_length() > pos)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1242 drct_pl_set_pos(pos);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1243
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1244 if (!options->enqueue)
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1245 g_idle_add(aud_start_playback, NULL);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1246 }
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1247
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1248 g_list_foreach(fns, (GFunc) g_free, NULL);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1249 g_list_free(fns);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1250
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1251 g_strfreev(filenames);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1252 } /* filename */
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1253
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1254 if (options->rew)
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1255 drct_pl_prev();
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1256
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1257 if (options->play)
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1258 drct_play();
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1259
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1260 if (options->pause)
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1261 drct_pause();
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1262
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1263 if (options->stop)
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1264 drct_stop();
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1265
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1266 if (options->fwd)
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1267 drct_pl_next();
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1268
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1269 if (options->play_pause) {
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1270 if (drct_get_paused())
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1271 drct_play();
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1272 else
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1273 drct_pause();
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1274 }
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1275
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1276 if (options->show_jump_box)
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1277 drct_jtf_show();
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1278
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1279 if (options->mainwin)
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1280 drct_main_win_toggle(TRUE);
2845
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1281
a124656d4423 added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents: 2838
diff changeset
1282 if (options->activate)
3753
22d71f986b86 export AudDRCT API.
William Pitcock <nenolod@atheme.org>
parents: 3686
diff changeset
1283 drct_activate();
4026
17bf734f8187 avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3978
diff changeset
1284 } /* !is_running */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1285 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1286
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1287 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1288 bmp_setup_logger(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1289 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1290 if (!bmp_logger_start(bmp_paths[BMP_PATH_LOG_FILE]))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1291 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1292
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1293 g_atexit(bmp_logger_stop);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1294 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1295
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1296 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1297 run_load_skin_error_dialog(const gchar * skin_path)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1298 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1299 const gchar *markup =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1300 N_("<b><big>Unable to load skin.</big></b>\n"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1301 "\n"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1302 "Check that skin at '%s' is usable and default skin is properly "
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1303 "installed at '%s'\n");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1304
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1305 GtkWidget *dialog =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1306 gtk_message_dialog_new_with_markup(NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1307 GTK_DIALOG_MODAL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1308 GTK_MESSAGE_ERROR,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1309 GTK_BUTTONS_CLOSE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1310 _(markup),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1311 skin_path,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1312 BMP_DEFAULT_SKIN_PATH);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1313 gtk_dialog_run(GTK_DIALOG(dialog));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1314 gtk_widget_destroy(dialog);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1315 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1316
2908
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1317 void report_error(const gchar *error_message, ...)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1318 {
2908
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1319 gchar *buf;
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1320 va_list va;
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1321
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1322 va_start(va, error_message);
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1323 buf = g_strdup_vprintf(error_message, va);
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1324 va_end(va);
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1325
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1326 fprintf(stderr, buf);
2570
7b1b52eb663b [svn] - Minor cleanups
mf0102
parents: 2551
diff changeset
1327
7b1b52eb663b [svn] - Minor cleanups
mf0102
parents: 2551
diff changeset
1328 if (options.headless != 1)
7b1b52eb663b [svn] - Minor cleanups
mf0102
parents: 2551
diff changeset
1329 {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1330 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(err),
2908
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1331 buf);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1332 gtk_dialog_run(GTK_DIALOG(err));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1333 gtk_widget_hide(err);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1334 }
2908
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1335
6a474a7954a0 Allow for printf-style format strings to be passed to report_error() via g_strdup_vprintf().
William Pitcock <nenolod@atheme.org>
parents: 2907
diff changeset
1336 g_free(buf);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1337 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1338
2369
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1339 static gboolean
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1340 aud_headless_iteration(gpointer unused)
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1341 {
2506
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1342 free_vis_data();
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1343 return TRUE;
2369
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1344 }
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1345
3480
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1346 static gboolean
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1347 load_extra_playlist(const gchar * path, const gchar * basename,
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1348 gpointer def)
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1349 {
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1350 const gchar *title;
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1351 Playlist *playlist;
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1352 Playlist *deflist;
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1353
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1354 deflist = (Playlist *)def;
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1355 playlist = playlist_new();
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1356 if (!playlist) {
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1357 g_warning("Couldn't create new playlist\n");
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1358 return FALSE;
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1359 }
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1360
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1361 playlist_add_playlist(playlist);
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1362 playlist_load(playlist, path);
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1363
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1364 title = playlist_get_current_name(playlist);
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1365
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1366 return FALSE; /* keep loading other playlists */
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1367 }
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1368
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1369 gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1370 main(gint argc, gchar ** argv)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1371 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1372 gboolean gtk_init_check_ok;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1373 Playlist *playlist;
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1374 GOptionContext *context;
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1375 GError *error = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1376
2644
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1377 /* glib-2.13.0 requires g_thread_init() to be called before all
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1378 other GLib functions */
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1379 g_thread_init(NULL);
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1380 if (!g_thread_supported()) {
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1381 g_printerr(_("Sorry, threads isn't supported on your platform.\n\n"
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1382 "If you're on a libc5 based linux system and installed Glib & GTK+ before you\n"
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1383 "installed LinuxThreads you need to recompile Glib & GTK+.\n"));
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1384 exit(EXIT_FAILURE);
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1385 }
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1386
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1387 gdk_threads_init();
67082557b2c4 [svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents: 2605
diff changeset
1388
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1389 /* Setup l10n early so we can print localized error messages */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1390 gtk_set_locale();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1391 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1392 bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
2388
52bcc18eb8bb [svn] - attempt to bind the audacious-plugins domain
nenolod
parents: 2369
diff changeset
1393 bindtextdomain(PACKAGE_NAME "-plugins", LOCALEDIR);
52bcc18eb8bb [svn] - attempt to bind the audacious-plugins domain
nenolod
parents: 2369
diff changeset
1394 bind_textdomain_codeset(PACKAGE_NAME "-plugins", "UTF-8");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1395 textdomain(PACKAGE_NAME);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1396
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1397 bmp_init_paths();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1398 bmp_make_user_dir();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1399
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1400 g_set_application_name(_(application_name));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1401
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1402 cond_scan = g_cond_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1403 mutex_scan = g_mutex_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1404
2463
e32be86095aa [svn] - re-add support for gtkrc files
nenolod
parents: 2461
diff changeset
1405 gtk_rc_add_default_file(bmp_paths[BMP_PATH_GTKRC_FILE]);
e32be86095aa [svn] - re-add support for gtkrc files
nenolod
parents: 2461
diff changeset
1406
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1407 gtk_init_check_ok = gtk_init_check(&argc, &argv);
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1408
2413
86777d94dc7a [svn] - default settings for options.session
nenolod
parents: 2412
diff changeset
1409 memset(&options, '\0', sizeof(BmpCmdLineOpt));
86777d94dc7a [svn] - default settings for options.session
nenolod
parents: 2412
diff changeset
1410 options.session = -1;
86777d94dc7a [svn] - default settings for options.session
nenolod
parents: 2412
diff changeset
1411
2411
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1412 context = g_option_context_new(_("- play multimedia files"));
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1413 g_option_context_add_main_entries(context, cmd_entries, PACKAGE_NAME);
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1414 g_option_context_add_group(context, gtk_get_option_group(TRUE));
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1415 g_option_context_parse(context, &argc, &argv, &error);
ffbac11b3a77 [svn] - use GOption instead of getopt.
nenolod
parents: 2405
diff changeset
1416
2412
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1417 if (error != NULL)
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1418 {
4193
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1419 if(error->message)
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1420 { /* checking for MacOS X -psn_0_* errors*/
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1421 char* s = g_strrstr(error->message,"-psn_0_");
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1422 if(!s)
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1423 {
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1424 g_printerr(_("%s: %s\nTry `%s --help' for more information.\n"),
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1425 argv[0], error->message, argv[0]);
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1426 exit(EXIT_FAILURE);
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1427 }
f6da5b8d401e made it ignore -psn_0_* arguments, passed by MacOS X
Cristi Magherusan <majeru@atheme.org>
parents: 4180
diff changeset
1428 }
2412
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1429 }
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1430
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1431 if (!gtk_init_check_ok) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1432 if (argc < 2) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1433 /* GTK check failed, and no arguments passed to indicate
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1434 that user is intending to only remote control a running
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1435 session */
2412
f0d65a33bf64 [svn] - handle unknown options
nenolod
parents: 2411
diff changeset
1436 g_printerr(_("%s: Unable to open display, exiting.\n"), argv[0]);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1437 exit(EXIT_FAILURE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1438 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1439
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1440 handle_cmd_line_options(&options, TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1441
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1442 /* we could be running headless, so GTK probably wont matter */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1443 if (options.headless != 1)
2938
1cdfc508d758 Fix adding files when Audacious is running.
Jonathan Schleifer <js@h3c.de>
parents: 2914
diff changeset
1444 exit(EXIT_SUCCESS);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1445 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1446
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1447 if (options.no_log == FALSE)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1448 bmp_setup_logger();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1449
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1450 signal_handlers_init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1451
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1452 g_random_set_seed(time(NULL));
4234
b293ce14a01a partially works...
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4232
diff changeset
1453 SAD_dither_init_rand((gint32)time(NULL));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1454
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1455 bmp_config_load();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1456
2856
c4d07471f647 Added a mowgli_init() call
Cristi Magherusan <majeru@gentoo.ro>
parents: 2846
diff changeset
1457 mowgli_init();
3306
404ffedef3e1 added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents: 3296
diff changeset
1458
404ffedef3e1 added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents: 3296
diff changeset
1459 if (options.headless != 1)
404ffedef3e1 added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents: 3296
diff changeset
1460 {
3965
aea8b763b134 Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents: 3959
diff changeset
1461 ui_main_check_theme_engine();
aea8b763b134 Work around the issues with broken Gtk-Qt-Engine and Modern skins with inline GTK.
William Pitcock <nenolod@atheme.org>
parents: 3959
diff changeset
1462
3978
40db2fe8d073 - fixed custom stock icons that were not displayed
Giacomo Lozito <james@develia.org>
parents: 3965
diff changeset
1463 /* register icons in stock
40db2fe8d073 - fixed custom stock icons that were not displayed
Giacomo Lozito <james@develia.org>
parents: 3965
diff changeset
1464 NOTE: should be called before UIManager */
40db2fe8d073 - fixed custom stock icons that were not displayed
Giacomo Lozito <james@develia.org>
parents: 3965
diff changeset
1465 register_aud_stock_icons();
40db2fe8d073 - fixed custom stock icons that were not displayed
Giacomo Lozito <james@develia.org>
parents: 3965
diff changeset
1466
3306
404ffedef3e1 added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents: 3296
diff changeset
1467 /* UIManager
404ffedef3e1 added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents: 3296
diff changeset
1468 NOTE: this needs to be called before plugin init, cause
3978
40db2fe8d073 - fixed custom stock icons that were not displayed
Giacomo Lozito <james@develia.org>
parents: 3965
diff changeset
1469 plugin init functions may want to add custom menu entries */
3306
404ffedef3e1 added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents: 3296
diff changeset
1470 ui_manager_init();
404ffedef3e1 added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents: 3296
diff changeset
1471 ui_manager_create_menus();
404ffedef3e1 added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents: 3296
diff changeset
1472 }
404ffedef3e1 added support for plugin-customizable menus; plugins can add their own entries (and even submenus) in main and playlist popup menus
Giacomo Lozito <james@develia.org>
parents: 3296
diff changeset
1473
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1474 plugin_system_init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1475
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1476 /* Initialize the playlist system. */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1477 playlist_init();
3883
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1478 playlist = playlist_get_active();
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1479 playlist_load(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1480 playlist_set_position(playlist, cfg.playlist_position);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1481
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1482 handle_cmd_line_options(&options, TRUE);
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1483
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1484 #ifdef USE_DBUS
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1485 init_dbus();
6aaf5476b765 commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents: 3753
diff changeset
1486 #endif
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1487
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1488 if (options.headless != 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1489 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1490 bmp_set_default_icon();
3525
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1491 #ifdef GDK_WINDOWING_QUARTZ
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1492 set_dock_icon();
540e49d1d87c macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents: 3400
diff changeset
1493 #endif
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1494
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1495 gtk_accel_map_load(bmp_paths[BMP_PATH_ACCEL_FILE]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1496
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1497 if (!init_skins(cfg.skin)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1498 run_load_skin_error_dialog(cfg.skin);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1499 exit(EXIT_FAILURE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1500 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1501
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1502 GDK_THREADS_ENTER();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1503 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1504
3480
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1505 /* Load extra playlists */
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1506 if(!dir_foreach(bmp_paths[BMP_PATH_PLAYLISTS_DIR], load_extra_playlist,
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1507 playlist, NULL)) {
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1508 g_warning("Could not load extra playlists\n");
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1509 }
3f4ad59a5c02 Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents: 3443
diff changeset
1510
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1511 /* this needs to be called after all 3 windows are created and
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1512 * input plugins are setup'ed
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1513 * but not if we're running headless --nenolod
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1514 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1515 mainwin_setup_menus();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1516
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1517 if (options.headless != 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1518 {
3678
e82ad057d1db Get rid of read_volume() craq. Add ui_main_set_initial_volume() to replace the only necessary remaining code.
William Pitcock <nenolod@atheme.org>
parents: 3543
diff changeset
1519 ui_main_set_initial_volume();
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1520
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1521 /* FIXME: delayed, because it deals directly with the plugin
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1522 * interface to set menu items */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1523 create_prefs_window();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1524
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1525 create_fileinfo_window();
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1526
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1527
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1528 if (cfg.player_visible)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1529 mainwin_show(TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1530 else if (!cfg.playlist_visible && !cfg.equalizer_visible)
2651
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
1531 {
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
1532 /* all of the windows are hidden... warn user about this */
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
1533 mainwin_show_visibility_warning();
4d5e6a8717dd [svn] - allow the player to start with all of its windows hidden (but give a warning to the user, whose display can be disabled); also, try to remember player windows positions when they stay hidden between sessions
giacomo
parents: 2644
diff changeset
1534 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1535
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1536 if (cfg.equalizer_visible)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1537 equalizerwin_show(TRUE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1538
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1539 if (cfg.playlist_visible)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1540 playlistwin_show();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1541
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1542 hint_set_always(cfg.always_on_top);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1543
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1544 playlist_start_get_info_thread();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1545
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1546 has_x11_connection = TRUE;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1547
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1548 if (cfg.resume_playback_on_startup)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1549 {
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1550 if (cfg.resume_playback_on_startup_time != -1 &&
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1551 playlist_get_length(playlist) > 0)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1552 {
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1553 int i;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1554 gint l = 0, r = 0;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1555 while (gtk_events_pending()) gtk_main_iteration();
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1556 output_get_volume(&l, &r);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1557 output_set_volume(0,0);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1558 playback_initiate();
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1559
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1560 /* Busy wait; loop is fairly tight to minimize duration of
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1561 * "frozen" GUI. Feel free to tune. --chainsaw */
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1562 for (i = 0; i < 20; i++)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1563 {
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1564 g_usleep(1000);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1565 if (!ip_data.playing)
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1566 break;
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1567 }
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1568 playback_seek(cfg.resume_playback_on_startup_time / 1000);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1569 output_set_volume(l, r);
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1570 }
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1571 }
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1572
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1573 gtk_main();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1574
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1575 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1576
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1577 g_cond_free(cond_scan);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1578 g_mutex_free(mutex_scan);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1579
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1580 return EXIT_SUCCESS;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1581 }
2364
85ddfad4f55e [svn] beautify and comment main.c
mf0102
parents: 2348
diff changeset
1582 // if we are running headless
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1583 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1584 {
2506
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1585 GMainLoop *loop;
2369
847213941224 [svn] - new headless event loop
nenolod
parents: 2364
diff changeset
1586
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1587 playlist_start_get_info_thread();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1588
2506
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1589 loop = g_main_loop_new(NULL, TRUE);
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1590 g_timeout_add(10, aud_headless_iteration, NULL);
630910fd140f [svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents: 2475
diff changeset
1591 g_main_loop_run(loop);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1592
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1593 return EXIT_SUCCESS;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1594 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1595 }