Mercurial > audlegacy
annotate src/audacious/main.c @ 4385:88d8f699359a
moved some stuff around to increase headless support
author | mf0102 <0102@gmx.at> |
---|---|
date | Sat, 29 Mar 2008 13:35:02 +0100 |
parents | 335f4ac3993a |
children | 628926f505f8 |
rev | line source |
---|---|
2313 | 1 /* Audacious - Cross-platform multimedia player |
2 * Copyright (C) 2005-2007 Audacious development team. | |
3 * | |
4 * Based on BMP: | |
5 * Copyright (C) 2003-2004 BMP development team. | |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2003 XMMS development team. | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
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 | 13 * |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
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 | 24 */ |
25 | |
26 #ifdef HAVE_CONFIG_H | |
27 # include "config.h" | |
28 #endif | |
29 | |
30 #include "main.h" | |
31 | |
32 #include <glib.h> | |
33 #include <glib/gi18n.h> | |
34 #include <glib/gprintf.h> | |
35 #include <gdk/gdk.h> | |
36 #include <stdlib.h> | |
37 #include <string.h> | |
38 #include <getopt.h> | |
39 #include <ctype.h> | |
40 #include <time.h> | |
41 | |
42 #include <unistd.h> | |
43 #include <errno.h> | |
44 #include <sys/types.h> | |
45 #include <sys/stat.h> | |
46 #include <signal.h> | |
47 | |
4267
a41fb6bc632a
- src stuff traveled to src_flow.c
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4256
diff
changeset
|
48 #ifdef USE_SRC |
a41fb6bc632a
- src stuff traveled to src_flow.c
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4256
diff
changeset
|
49 # include <samplerate.h> |
a41fb6bc632a
- src stuff traveled to src_flow.c
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4256
diff
changeset
|
50 #endif |
a41fb6bc632a
- src stuff traveled to src_flow.c
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4256
diff
changeset
|
51 |
2313 | 52 #include "platform/smartinclude.h" |
53 | |
2717 | 54 #include "configdb.h" |
2313 | 55 #include "vfs.h" |
56 | |
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
|
57 #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
|
58 # include "dbus-service.h" |
2785 | 59 # 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
|
60 #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
|
61 |
2845
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
62 #include "auddrct.h" |
4347 | 63 #include "build_stamp.h" |
2313 | 64 #include "dnd.h" |
65 #include "hints.h" | |
66 #include "input.h" | |
67 #include "logger.h" | |
68 #include "output.h" | |
69 #include "playback.h" | |
70 #include "playlist.h" | |
4347 | 71 #include "pluginenum.h" |
72 #include "signals.h" | |
73 #include "skin.h" | |
74 #include "ui_equalizer.h" | |
75 #include "ui_fileinfo.h" | |
76 #include "ui_main.h" | |
77 #include "ui_manager.h" | |
2313 | 78 #include "ui_playlist.h" |
79 #include "ui_preferences.h" | |
80 #include "ui_skinselector.h" | |
81 #include "util.h" | |
4347 | 82 |
4234 | 83 #include "libSAD.h" |
4315
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
4286
diff
changeset
|
84 #include "eggsmclient.h" |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
4286
diff
changeset
|
85 #include "eggdesktopfile.h" |
2313 | 86 |
87 #include "icons-stock.h" | |
88 #include "images/audacious_player.xpm" | |
89 | |
2364 | 90 gboolean has_x11_connection = FALSE; /* do we have an X11 connection? */ |
2313 | 91 const gchar *application_name = N_("Audacious"); |
92 | |
4350
8071e599916d
renamed BmpCmdLineOpt to AudCmdLineOpt (greatest commit EVAR! ;-)
mf0102 <0102@gmx.at>
parents:
4347
diff
changeset
|
93 struct _AudCmdLineOpt { |
2411 | 94 gchar **filenames; |
2313 | 95 gint session; |
3351
7a4fcf84a34f
Removed the hardcoded Add/Play CD menu entry
Calin Crisan ccrisan@gmail.com
parents:
3346
diff
changeset
|
96 gboolean play, stop, pause, fwd, rew, play_pause, show_jump_box; |
2313 | 97 gboolean enqueue, mainwin, remote, activate; |
98 gboolean load_skins; | |
99 gboolean headless; | |
100 gboolean no_log; | |
101 gboolean enqueue_to_temp; | |
2411 | 102 gboolean version; |
2313 | 103 gchar *previous_session_id; |
4355 | 104 gboolean macpack; |
2313 | 105 }; |
106 | |
4350
8071e599916d
renamed BmpCmdLineOpt to AudCmdLineOpt (greatest commit EVAR! ;-)
mf0102 <0102@gmx.at>
parents:
4347
diff
changeset
|
107 typedef struct _AudCmdLineOpt AudCmdLineOpt; |
2313 | 108 |
4350
8071e599916d
renamed BmpCmdLineOpt to AudCmdLineOpt (greatest commit EVAR! ;-)
mf0102 <0102@gmx.at>
parents:
4347
diff
changeset
|
109 AudCmdLineOpt options; |
2313 | 110 |
111 BmpConfig cfg; | |
112 | |
113 const gchar *bmp_titlestring_presets[] = { | |
3296
c1f506c2b1d0
new format strings
William Pitcock <nenolod@atheme-project.org>
parents:
3251
diff
changeset
|
114 "${title}", |
c1f506c2b1d0
new format strings
William Pitcock <nenolod@atheme-project.org>
parents:
3251
diff
changeset
|
115 "${?artist:${artist} - }${title}", |
c1f506c2b1d0
new format strings
William Pitcock <nenolod@atheme-project.org>
parents:
3251
diff
changeset
|
116 "${?artist:${artist} - }${?album:${album} - }${title}", |
c1f506c2b1d0
new format strings
William Pitcock <nenolod@atheme-project.org>
parents:
3251
diff
changeset
|
117 "${?artist:${artist} - }${?album:${album} - }${?track-number:${track-number}. }${title}", |
c1f506c2b1d0
new format strings
William Pitcock <nenolod@atheme-project.org>
parents:
3251
diff
changeset
|
118 "${?artist:${artist} }${?album:[ ${album} ] }${?artist:- }${?track-number:${track-number}. }${title}", |
c1f506c2b1d0
new format strings
William Pitcock <nenolod@atheme-project.org>
parents:
3251
diff
changeset
|
119 "${?album:${album} - }${title}" |
2313 | 120 }; |
121 | |
122 const guint n_titlestring_presets = G_N_ELEMENTS(bmp_titlestring_presets); | |
123 | |
124 const gchar *chardet_detector_presets[] = { | |
4043
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
125 N_("None"), |
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
126 N_("Japanese"), |
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
127 N_("Taiwanese"), |
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
128 N_("Chinese"), |
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
129 N_("Korean"), |
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
130 N_("Russian"), |
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
131 N_("Greek"), |
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
132 N_("Hebrew"), |
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
133 N_("Turkish"), |
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
134 N_("Arabic"), |
2313 | 135 #ifdef HAVE_UDET |
4043
c86f63f652aa
made character set detection combo box translatable
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
136 N_("Universal") |
2313 | 137 #endif |
138 }; | |
139 | |
2364 | 140 const guint n_chardet_detector_presets = G_N_ELEMENTS(chardet_detector_presets); |
2313 | 141 gchar *bmp_paths[BMP_PATH_COUNT] = {}; |
142 | |
143 GList *dock_window_list = NULL; | |
144 | |
145 | |
146 GCond *cond_scan; | |
147 GMutex *mutex_scan; | |
3346
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3334
diff
changeset
|
148 #ifdef USE_DBUS |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3334
diff
changeset
|
149 MprisPlayer *mpris; |
71d8d93f1bad
Implemented TrackChange, StatusChange signals, with a stub for CapsChange.
Ben Tucker <ben.tucker@gmail.com>
parents:
3334
diff
changeset
|
150 #endif |
2313 | 151 |
152 static GSList * | |
153 get_feature_list(void) | |
154 { | |
155 GSList *features = NULL; | |
156 | |
157 #ifdef HAVE_GCONF | |
158 features = g_slist_append(features, "GConf"); | |
159 #endif | |
160 | |
161 return features; | |
162 } | |
163 | |
164 static void | |
165 dump_version(void) | |
166 { | |
167 GSList *features; | |
168 | |
169 g_printf("%s %s [%s]", _(application_name), VERSION, svn_stamp); | |
170 | |
171 features = get_feature_list(); | |
172 | |
173 if (features) { | |
174 GSList *item; | |
175 | |
176 g_printf(" ("); | |
177 | |
178 for (item = features; g_slist_next(item); item = g_slist_next(item)) | |
179 g_printf("%s, ", (const gchar *) item->data); | |
180 | |
181 g_printf("%s)", (const gchar *) item->data); | |
182 | |
183 g_slist_free(features); | |
184 } | |
185 | |
186 g_printf("\n"); | |
187 } | |
188 | |
189 const gchar * | |
3334
ea806daf3ef0
rename xmms_get_gentitle_format() to get_gentitle_format().
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3317
diff
changeset
|
190 get_gentitle_format(void) |
2313 | 191 { |
192 guint titlestring_preset = cfg.titlestring_preset; | |
193 | |
194 if (titlestring_preset < n_titlestring_presets) | |
2364 | 195 return bmp_titlestring_presets[titlestring_preset]; |
2313 | 196 |
197 return cfg.gentitle_format; | |
198 } | |
199 | |
200 static void | |
201 bmp_make_user_dir(void) | |
202 { | |
203 const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; | |
204 | |
205 make_directory(bmp_paths[BMP_PATH_USER_DIR], mode755); | |
206 make_directory(bmp_paths[BMP_PATH_USER_PLUGIN_DIR], mode755); | |
207 make_directory(bmp_paths[BMP_PATH_USER_SKIN_DIR], mode755); | |
208 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
|
209 make_directory(bmp_paths[BMP_PATH_PLAYLISTS_DIR], mode755); |
2313 | 210 } |
211 | |
212 static void | |
213 bmp_free_paths(void) | |
214 { | |
215 int i; | |
216 | |
217 for (i = 0; i < BMP_PATH_COUNT; i++) | |
218 { | |
219 g_free(bmp_paths[i]); | |
220 bmp_paths[i] = 0; | |
221 } | |
222 } | |
223 | |
2317
49d285f6008b
[svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents:
2313
diff
changeset
|
224 static void |
49d285f6008b
[svn] Full support for XDG basedir added. The old config doesn't get automatically converted yet.
js
parents:
2313
diff
changeset
|
225 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
|
226 { |
2364 | 227 char *xdg_config_home; |
228 char *xdg_data_home; | |
229 char *xdg_cache_home; | |
2313 | 230 |
2364 | 231 xdg_config_home = (getenv("XDG_CONFIG_HOME") == NULL |
232 ? g_build_filename(g_get_home_dir(), ".config", NULL) | |
233 : g_strdup(getenv("XDG_CONFIG_HOME"))); | |
234 xdg_data_home = (getenv("XDG_DATA_HOME") == NULL | |
235 ? g_build_filename(g_get_home_dir(), ".local", "share", NULL) | |
236 : g_strdup(getenv("XDG_DATA_HOME"))); | |
237 xdg_cache_home = (getenv("XDG_CACHE_HOME") == NULL | |
238 ? g_build_filename(g_get_home_dir(), ".cache", NULL) | |
239 : g_strdup(getenv("XDG_CACHE_HOME"))); | |
2313 | 240 |
2364 | 241 bmp_paths[BMP_PATH_USER_DIR] = |
242 g_build_filename(xdg_config_home, "audacious", NULL); | |
243 bmp_paths[BMP_PATH_USER_SKIN_DIR] = | |
244 g_build_filename(xdg_data_home, "audacious", "Skins", NULL); | |
245 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
|
246 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
|
247 |
2364 | 248 bmp_paths[BMP_PATH_SKIN_THUMB_DIR] = |
249 g_build_filename(xdg_cache_home, "audacious", "thumbs", NULL); | |
2313 | 250 |
3400
8764498b75ed
Add new playlists directory to paths
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3351
diff
changeset
|
251 bmp_paths[BMP_PATH_PLAYLISTS_DIR] = |
8764498b75ed
Add new playlists directory to paths
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3351
diff
changeset
|
252 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
|
253 |
2364 | 254 bmp_paths[BMP_PATH_CONFIG_FILE] = |
255 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
|
256 #ifdef HAVE_XSPF_PLAYLIST |
2364 | 257 bmp_paths[BMP_PATH_PLAYLIST_FILE] = |
258 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], | |
259 "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
|
260 #else |
2364 | 261 bmp_paths[BMP_PATH_PLAYLIST_FILE] = |
262 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], | |
263 "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
|
264 #endif |
2364 | 265 bmp_paths[BMP_PATH_ACCEL_FILE] = |
266 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "accels", NULL); | |
267 bmp_paths[BMP_PATH_LOG_FILE] = | |
268 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
|
269 |
2463 | 270 bmp_paths[BMP_PATH_GTKRC_FILE] = |
2570 | 271 g_build_filename(bmp_paths[BMP_PATH_USER_DIR], "gtkrc", NULL); |
2463 | 272 |
2364 | 273 g_free(xdg_config_home); |
274 g_free(xdg_data_home); | |
275 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
|
276 |
2364 | 277 g_atexit(bmp_free_paths); |
2313 | 278 } |
279 | |
280 | |
281 static void | |
282 bmp_set_default_icon(void) | |
283 { | |
284 GdkPixbuf *icon; | |
285 | |
286 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) audacious_player_xpm); | |
287 gtk_window_set_default_icon(icon); | |
288 g_object_unref(icon); | |
289 } | |
290 | |
3525
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
291 #ifdef GDK_WINDOWING_QUARTZ |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
292 static void |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
293 set_dock_icon(void) |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
294 { |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
295 GdkPixbuf *icon, *pixbuf; |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
296 CGColorSpaceRef colorspace; |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
297 CGDataProviderRef data_provider; |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
298 CGImageRef image; |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
299 gpointer data; |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
300 gint rowstride, pixbuf_width, pixbuf_height; |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
301 gboolean has_alpha; |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
302 |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
303 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
|
304 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
|
305 |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
306 data = gdk_pixbuf_get_pixels(pixbuf); |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
307 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
|
308 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
|
309 rowstride = gdk_pixbuf_get_rowstride(pixbuf); |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
310 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
|
311 |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
312 /* create the colourspace for the CGImage. */ |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
313 colorspace = CGColorSpaceCreateDeviceRGB(); |
4355 | 314 data_provider = CGDataProviderCreateWithData(NULL, data, |
315 pixbuf_height * rowstride, | |
316 NULL); | |
3525
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
317 image = CGImageCreate(pixbuf_width, pixbuf_height, 8, |
4355 | 318 has_alpha ? 32 : 24, rowstride, colorspace, |
319 has_alpha ? kCGImageAlphaLast : 0, | |
320 data_provider, NULL, FALSE, | |
321 kCGRenderingIntentDefault); | |
3525
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
322 |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
323 /* 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
|
324 CGDataProviderRelease(data_provider); |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
325 CGColorSpaceRelease(colorspace); |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
326 |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
327 /* set the dock tile images */ |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
328 SetApplicationDockTileImage(image); |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
329 |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
330 #if 0 |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
331 /* and release */ |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
332 CGImageRelease(image); |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
333 g_object_unref(icon); |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
334 g_object_unref(pixbuf); |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
335 #endif |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
336 } |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
337 #endif |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
338 |
2411 | 339 static GOptionEntry cmd_entries[] = { |
2448
ff135e2ba10e
[svn] - mark some strings used by GOption as translatable
nenolod
parents:
2420
diff
changeset
|
340 {"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
|
341 {"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
|
342 {"pause", 'u', 0, G_OPTION_ARG_NONE, &options.pause, N_("Pause current song"), NULL}, |
2475 | 343 {"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
|
344 {"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
|
345 {"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
|
346 {"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
|
347 {"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
|
348 {"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
|
349 {"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
|
350 {"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
|
351 {"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
|
352 {"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
|
353 {"version", 'v', 0, G_OPTION_ARG_NONE, &options.version, N_("Show version and builtin features"), NULL}, |
4355 | 354 #ifdef GDK_WINDOWING_QUARTZ |
355 {"macpack", 'n', 0, G_OPTION_ARG_NONE, &options.macpack, N_("Used in macpacking"), NULL}, /* Make this hidden */ | |
356 #endif | |
2411 | 357 {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &options.filenames, N_("FILE..."), NULL}, |
358 {NULL}, | |
359 }; | |
2313 | 360 |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
361 static gboolean |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
362 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
|
363 { |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
364 drct_play(); |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
365 return FALSE; |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
366 } |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
367 |
2313 | 368 static void |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
369 parse_cmd_line_options(gint *argc, gchar ***argv) |
2313 | 370 { |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
371 GOptionContext *context; |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
372 GError *error = NULL; |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
373 |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
374 memset(&options, '\0', sizeof(AudCmdLineOpt)); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
375 options.session = -1; |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
376 |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
377 context = g_option_context_new(_("- play multimedia files")); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
378 g_option_context_add_main_entries(context, cmd_entries, PACKAGE_NAME); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
379 g_option_context_add_group(context, gtk_get_option_group(FALSE)); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
380 g_option_context_add_group(context, egg_sm_client_get_option_group()); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
381 if (!g_option_context_parse(context, argc, argv, &error)) |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
382 /* checking for MacOS X -psn_0_* errors*/ |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
383 if (error->message && !g_strrstr(error->message,"-psn_0_")) |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
384 { |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
385 g_printerr(_("%s: %s\nTry `%s --help' for more information.\n"), |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
386 (*argv)[0], error->message, (*argv)[0]); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
387 exit(EXIT_FAILURE); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
388 } |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
389 } |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
390 |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
391 static void |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
392 handle_cmd_line_options() |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
393 { |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
394 gchar **filenames = options.filenames; |
2785 | 395 #ifdef USE_DBUS |
396 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
|
397 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
|
398 #else |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
399 gboolean is_running = FALSE; |
2727
14f9a629ba9c
[svn] - rename xmms_remote namespace to audacious_remote namespace
nenolod
parents:
2717
diff
changeset
|
400 #endif |
2313 | 401 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
402 if (options.version) |
2411 | 403 { |
404 dump_version(); | |
405 exit(EXIT_SUCCESS); | |
406 } | |
407 | |
2788
b2b920b165ad
[svn] - exclude codes which use session if USE_DBUS is not defined.
yaz
parents:
2786
diff
changeset
|
408 #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
|
409 if (is_running) |
2411 | 410 { |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
411 if (filenames != NULL) |
2411 | 412 { |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
413 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
|
414 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
|
415 GList *fns = NULL; |
2512
3a1fc6f7c187
[svn] - unbreak relative path support. closes #791.
nenolod
parents:
2506
diff
changeset
|
416 |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
417 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
|
418 { |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
419 gchar *filename; |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
420 gchar *current_dir = g_get_current_dir(); |
2313 | 421 |
4355 | 422 if (!strstr(filenames[i], "://")) |
423 { | |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
424 if (filenames[i][0] == '/') |
4355 | 425 filename = g_strdup_printf("file:///%s", filenames[i]); |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
426 else |
4355 | 427 filename = g_strdup_printf("file:///%s/%s", current_dir, |
428 filenames[i]); | |
429 } | |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
430 else |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
431 filename = g_strdup(filenames[i]); |
2411 | 432 |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
433 fns = g_list_prepend(fns, filename); |
2411 | 434 |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
435 g_free(current_dir); |
2411 | 436 } |
2512
3a1fc6f7c187
[svn] - unbreak relative path support. closes #791.
nenolod
parents:
2506
diff
changeset
|
437 |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
438 fns = g_list_reverse(fns); |
2605
1ceaf00f9c6d
[svn] - fix handling of multiple files on the command line.
nenolod
parents:
2574
diff
changeset
|
439 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
440 if (options.load_skins) |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
441 { |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
442 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
|
443 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
|
444 } |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
445 else |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
446 { |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
447 GList *i; |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
448 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
449 if (options.enqueue_to_temp) |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
450 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
|
451 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
452 if (options.enqueue && options.play) |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
453 pos = audacious_remote_get_playlist_length(session); |
2605
1ceaf00f9c6d
[svn] - fix handling of multiple files on the command line.
nenolod
parents:
2574
diff
changeset
|
454 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
455 if (!options.enqueue) |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
456 { |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
457 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
|
458 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
|
459 } |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
460 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
461 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
|
462 audacious_remote_playlist_add_url_string(session, i->data); |
2313 | 463 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
464 if (options.enqueue && options.play && |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
465 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
|
466 audacious_remote_set_playlist_pos(session, pos); |
2605
1ceaf00f9c6d
[svn] - fix handling of multiple files on the command line.
nenolod
parents:
2574
diff
changeset
|
467 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
468 if (!options.enqueue) |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
469 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
|
470 } |
2313 | 471 |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
472 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
|
473 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
|
474 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
475 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
|
476 } /* filename */ |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
477 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
478 if (options.rew) |
2832 | 479 audacious_remote_playlist_prev(session); |
2313 | 480 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
481 if (options.play) |
2832 | 482 audacious_remote_play(session); |
2313 | 483 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
484 if (options.pause) |
2832 | 485 audacious_remote_pause(session); |
2313 | 486 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
487 if (options.stop) |
2832 | 488 audacious_remote_stop(session); |
2313 | 489 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
490 if (options.fwd) |
2832 | 491 audacious_remote_playlist_next(session); |
2313 | 492 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
493 if (options.play_pause) |
2832 | 494 audacious_remote_play_pause(session); |
2313 | 495 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
496 if (options.show_jump_box) |
2832 | 497 audacious_remote_show_jtf_box(session); |
2313 | 498 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
499 if (options.mainwin) |
2832 | 500 audacious_remote_main_win_toggle(session, TRUE); |
2313 | 501 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
502 if (options.activate) |
2832 | 503 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
|
504 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
505 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
|
506 } /* 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
|
507 else |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
508 #endif |
4026
17bf734f8187
avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3978
diff
changeset
|
509 { /* !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
|
510 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
|
511 { |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
512 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
|
513 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
|
514 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
|
515 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
516 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
|
517 { |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
518 gchar *filename; |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
519 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
|
520 |
4355 | 521 if (!strstr(filenames[i], "://")) |
522 { | |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
523 if (filenames[i][0] == '/') |
4355 | 524 filename = g_strdup_printf("file:///%s", filenames[i]); |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
525 else |
4355 | 526 filename = g_strdup_printf("file:///%s/%s", current_dir, |
527 filenames[i]); | |
528 } | |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
529 else |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
530 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
|
531 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
532 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
|
533 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
534 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
|
535 } |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
536 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
537 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
|
538 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
539 { |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
540 if (options.enqueue_to_temp) |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
541 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
|
542 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
543 if (options.enqueue && options.play) |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
544 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
|
545 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
546 if (!options.enqueue) |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
547 { |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
548 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
|
549 drct_stop(); |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
550 } |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
551 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
552 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
|
553 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
554 if (options.enqueue && options.play && |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
555 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
|
556 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
|
557 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
558 if (!options.enqueue) |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
559 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
|
560 } |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
561 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
562 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
|
563 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
|
564 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
565 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
|
566 } /* filename */ |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
567 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
568 if (options.rew) |
3753 | 569 drct_pl_prev(); |
2845
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
570 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
571 if (options.play) |
3753 | 572 drct_play(); |
2845
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
573 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
574 if (options.pause) |
3753 | 575 drct_pause(); |
2845
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
576 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
577 if (options.stop) |
3753 | 578 drct_stop(); |
2845
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
579 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
580 if (options.fwd) |
3753 | 581 drct_pl_next(); |
2845
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
582 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
583 if (options.play_pause) { |
3753 | 584 if (drct_get_paused()) |
585 drct_play(); | |
2845
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
586 else |
3753 | 587 drct_pause(); |
2845
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
588 } |
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
589 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
590 if (options.show_jump_box) |
3753 | 591 drct_jtf_show(); |
2845
a124656d4423
added handlers for cmd line args when remote == false
Ben Tucker <ben.tucker@gmail.com>
parents:
2838
diff
changeset
|
592 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
593 if (options.mainwin) |
3753 | 594 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
|
595 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
596 if (options.activate) |
3753 | 597 drct_activate(); |
4026
17bf734f8187
avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3978
diff
changeset
|
598 } /* !is_running */ |
2313 | 599 } |
600 | |
601 static void | |
602 bmp_setup_logger(void) | |
603 { | |
604 if (!bmp_logger_start(bmp_paths[BMP_PATH_LOG_FILE])) | |
605 return; | |
606 | |
607 g_atexit(bmp_logger_stop); | |
608 } | |
609 | |
610 static void | |
611 run_load_skin_error_dialog(const gchar * skin_path) | |
612 { | |
613 const gchar *markup = | |
614 N_("<b><big>Unable to load skin.</big></b>\n" | |
615 "\n" | |
616 "Check that skin at '%s' is usable and default skin is properly " | |
617 "installed at '%s'\n"); | |
618 | |
619 GtkWidget *dialog = | |
620 gtk_message_dialog_new_with_markup(NULL, | |
621 GTK_DIALOG_MODAL, | |
622 GTK_MESSAGE_ERROR, | |
623 GTK_BUTTONS_CLOSE, | |
624 _(markup), | |
625 skin_path, | |
626 BMP_DEFAULT_SKIN_PATH); | |
627 gtk_dialog_run(GTK_DIALOG(dialog)); | |
628 gtk_widget_destroy(dialog); | |
629 } | |
630 | |
2369 | 631 static gboolean |
632 aud_headless_iteration(gpointer unused) | |
633 { | |
2506
630910fd140f
[svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents:
2475
diff
changeset
|
634 free_vis_data(); |
630910fd140f
[svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents:
2475
diff
changeset
|
635 return TRUE; |
2369 | 636 } |
637 | |
3480
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
638 static gboolean |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
639 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
|
640 gpointer def) |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
641 { |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
642 const gchar *title; |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
643 Playlist *playlist; |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
644 Playlist *deflist; |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
645 |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
646 deflist = (Playlist *)def; |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
647 playlist = playlist_new(); |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
648 if (!playlist) { |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
649 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
|
650 return FALSE; |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
651 } |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
652 |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
653 playlist_add_playlist(playlist); |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
654 playlist_load(playlist, path); |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
655 |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
656 title = playlist_get_current_name(playlist); |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
657 |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
658 return FALSE; /* keep loading other playlists */ |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
659 } |
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
660 |
4385
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
661 static void |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
662 resume_playback_on_startup() |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
663 { |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
664 g_return_if_fail(cfg.resume_playback_on_startup); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
665 g_return_if_fail(cfg.resume_playback_on_startup_time != -1); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
666 g_return_if_fail(playlist_get_length(playlist_get_active()) > 0); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
667 |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
668 int i; |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
669 gint l = 0, r = 0; |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
670 |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
671 while (gtk_events_pending()) gtk_main_iteration(); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
672 |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
673 l = (cfg.saved_volume & 0xff00) >> 8; |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
674 r = cfg.saved_volume & 0x00ff; |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
675 output_set_volume(l, r); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
676 |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
677 playback_initiate(); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
678 |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
679 /* Busy wait; loop is fairly tight to minimize duration of |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
680 * "frozen" GUI. Feel free to tune. --chainsaw */ |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
681 for (i = 0; i < 20; i++) |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
682 { |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
683 g_usleep(1000); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
684 if (!ip_data.playing) |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
685 break; |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
686 } |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
687 playback_seek(cfg.resume_playback_on_startup_time / 1000); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
688 } |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
689 |
2313 | 690 gint |
691 main(gint argc, gchar ** argv) | |
692 { | |
693 Playlist *playlist; | |
694 | |
2644
67082557b2c4
[svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents:
2605
diff
changeset
|
695 /* 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
|
696 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
|
697 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
|
698 if (!g_thread_supported()) { |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
699 g_printerr(_("Sorry, threads aren't supported on your platform.\n")); |
2644
67082557b2c4
[svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents:
2605
diff
changeset
|
700 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
|
701 } |
67082557b2c4
[svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents:
2605
diff
changeset
|
702 |
67082557b2c4
[svn] - glib-2.13.0 requires g_thread_init() to be called before all other GLib functions.
yaz
parents:
2605
diff
changeset
|
703 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
|
704 |
2313 | 705 /* Setup l10n early so we can print localized error messages */ |
706 gtk_set_locale(); | |
707 bindtextdomain(PACKAGE_NAME, LOCALEDIR); | |
708 bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); | |
2388
52bcc18eb8bb
[svn] - attempt to bind the audacious-plugins domain
nenolod
parents:
2369
diff
changeset
|
709 bindtextdomain(PACKAGE_NAME "-plugins", LOCALEDIR); |
52bcc18eb8bb
[svn] - attempt to bind the audacious-plugins domain
nenolod
parents:
2369
diff
changeset
|
710 bind_textdomain_codeset(PACKAGE_NAME "-plugins", "UTF-8"); |
2313 | 711 textdomain(PACKAGE_NAME); |
712 | |
4315
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
4286
diff
changeset
|
713 #ifndef _WIN32 |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
4286
diff
changeset
|
714 egg_set_desktop_file(AUDACIOUS_DESKTOP_FILE); |
c942eaef7bc6
Implement session management.
Ivan N. Zlatev <contact@i-nz.net>
parents:
4286
diff
changeset
|
715 #endif |
2313 | 716 bmp_init_paths(); |
717 bmp_make_user_dir(); | |
718 | |
719 cond_scan = g_cond_new(); | |
720 mutex_scan = g_mutex_new(); | |
2463 | 721 gtk_rc_add_default_file(bmp_paths[BMP_PATH_GTKRC_FILE]); |
722 | |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
723 parse_cmd_line_options(&argc, &argv); |
2313 | 724 |
725 if (options.no_log == FALSE) | |
726 bmp_setup_logger(); | |
727 | |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
728 if (!gtk_init_check(&argc, &argv) && options.headless == FALSE) { |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
729 /* GTK check failed, and no arguments passed to indicate |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
730 that user is intending to only remote control a running |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
731 session */ |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
732 g_printerr(_("%s: Unable to open display, exiting.\n"), argv[0]); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
733 exit(EXIT_FAILURE); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
734 } |
2313 | 735 |
736 g_random_set_seed(time(NULL)); | |
4234 | 737 SAD_dither_init_rand((gint32)time(NULL)); |
2313 | 738 |
739 bmp_config_load(); | |
740 | |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
741 signal_handlers_init(); |
2856
c4d07471f647
Added a mowgli_init() call
Cristi Magherusan <majeru@gentoo.ro>
parents:
2846
diff
changeset
|
742 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
|
743 |
4355 | 744 if (options.headless == FALSE) |
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
|
745 { |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
746 ui_main_check_theme_engine(); |
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
|
747 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
748 /* register icons in stock |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
749 NOTE: should be called before UIManager */ |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
750 register_aud_stock_icons(); |
3978
40db2fe8d073
- fixed custom stock icons that were not displayed
Giacomo Lozito <james@develia.org>
parents:
3965
diff
changeset
|
751 |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
752 /* UIManager |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
753 NOTE: this needs to be called before plugin init, cause |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
754 plugin init functions may want to add custom menu entries */ |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
755 ui_manager_init(); |
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
756 ui_manager_create_menus(); |
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
|
757 } |
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
|
758 |
2313 | 759 plugin_system_init(); |
760 | |
761 /* Initialize the playlist system. */ | |
762 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
|
763 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
|
764 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
|
765 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
|
766 |
4357 | 767 /* Load extra playlists */ |
768 if (!dir_foreach(bmp_paths[BMP_PATH_PLAYLISTS_DIR], load_extra_playlist, | |
769 playlist, NULL)) | |
770 g_warning("Could not load extra playlists\n"); | |
771 | |
4356
87cb9d3402d4
rolling away some more stones on the hard way to real headless operation
mf0102 <0102@gmx.at>
parents:
4355
diff
changeset
|
772 handle_cmd_line_options(); |
3883
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
773 |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
774 #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
|
775 init_dbus(); |
6aaf5476b765
commandline handling rewrite. should be fine, it passed all of my tests. ;)
William Pitcock <nenolod@atheme.org>
parents:
3753
diff
changeset
|
776 #endif |
2313 | 777 |
4385
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
778 playlist_start_get_info_thread(); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
779 |
4355 | 780 if (options.headless == FALSE) |
2313 | 781 { |
782 bmp_set_default_icon(); | |
3525
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
783 #ifdef GDK_WINDOWING_QUARTZ |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
784 set_dock_icon(); |
540e49d1d87c
macos: Set an application icon in the dock.
William Pitcock <nenolod@atheme.org>
parents:
3400
diff
changeset
|
785 #endif |
2313 | 786 |
787 gtk_accel_map_load(bmp_paths[BMP_PATH_ACCEL_FILE]); | |
788 | |
789 if (!init_skins(cfg.skin)) { | |
790 run_load_skin_error_dialog(cfg.skin); | |
791 exit(EXIT_FAILURE); | |
792 } | |
793 | |
794 GDK_THREADS_ENTER(); | |
3480
3f4ad59a5c02
Load extra playlists on startup
Kieran Clancy <clancy.kieran+audacious@gmail.com>
parents:
3443
diff
changeset
|
795 |
4357 | 796 /* this needs to be called after all 3 windows are created and |
797 * input plugins are setup'ed | |
798 * but not if we're running headless --nenolod | |
799 */ | |
800 mainwin_setup_menus(); | |
4374
335f4ac3993a
save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents:
4366
diff
changeset
|
801 output_set_volume(((cfg.saved_volume & 0xff00) >> 8),(cfg.saved_volume & 0x00ff)); |
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
|
802 ui_main_set_initial_volume(); |
2313 | 803 |
804 /* FIXME: delayed, because it deals directly with the plugin | |
805 * interface to set menu items */ | |
806 create_prefs_window(); | |
807 | |
2364 | 808 create_fileinfo_window(); |
809 | |
2313 | 810 |
811 if (cfg.player_visible) | |
812 mainwin_show(TRUE); | |
813 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
|
814 { |
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
|
815 /* 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
|
816 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
|
817 } |
2313 | 818 |
819 if (cfg.equalizer_visible) | |
820 equalizerwin_show(TRUE); | |
821 | |
822 if (cfg.playlist_visible) | |
823 playlistwin_show(); | |
824 | |
825 hint_set_always(cfg.always_on_top); | |
826 | |
2364 | 827 has_x11_connection = TRUE; |
2313 | 828 |
4385
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
829 resume_playback_on_startup(); |
2364 | 830 |
2313 | 831 gtk_main(); |
832 | |
833 GDK_THREADS_LEAVE(); | |
834 } | |
2364 | 835 // if we are running headless |
2313 | 836 else |
837 { | |
2506
630910fd140f
[svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents:
2475
diff
changeset
|
838 GMainLoop *loop; |
2369 | 839 |
4366
1f900d7b737b
print a note when headless operation is enabled
mf0102 <0102@gmx.at>
parents:
4365
diff
changeset
|
840 g_print(_("Headless operation enabled\n")); |
1f900d7b737b
print a note when headless operation is enabled
mf0102 <0102@gmx.at>
parents:
4365
diff
changeset
|
841 |
4385
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
842 resume_playback_on_startup(); |
2313 | 843 |
2506
630910fd140f
[svn] - changed plugin directory to ~/.local/share/audacious/Plugins (seems more logical to me)
mf0102
parents:
2475
diff
changeset
|
844 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
|
845 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
|
846 g_main_loop_run(loop); |
4385
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
847 } |
2313 | 848 |
4385
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
849 g_cond_free(cond_scan); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
850 g_mutex_free(mutex_scan); |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
851 |
88d8f699359a
moved some stuff around to increase headless support
mf0102 <0102@gmx.at>
parents:
4374
diff
changeset
|
852 return EXIT_SUCCESS; |
2313 | 853 } |