Audacious  $Id:Doxyfile42802007-03-2104:39:00Znenolod$
main.c
Go to the documentation of this file.
1 /*
2  * main.c
3  * Copyright 2007-2011 William Pitcock and John Lindgren
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions, and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions, and the following disclaimer in the documentation
13  * provided with the distribution.
14  *
15  * This software is provided "as is" and without any warranty, express or
16  * implied. In no event shall the authors be liable for any damages arising from
17  * the use of this software.
18  */
19 
20 #include <errno.h>
21 #include <fcntl.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <sys/stat.h>
25 #include <unistd.h>
26 #include <locale.h>
27 
28 #include <gtk/gtk.h>
29 
30 #include <libaudcore/audstrings.h>
31 #include <libaudcore/hook.h>
32 #include <libaudtag/audtag.h>
33 
34 #ifdef USE_DBUS
35 #include "../libaudclient/audctrl.h"
36 #include "dbus.h"
37 #endif
38 
39 #include "debug.h"
40 #include "drct.h"
41 #include "equalizer.h"
42 #include "i18n.h"
43 #include "interface.h"
44 #include "main.h"
45 #include "misc.h"
46 #include "playlist.h"
47 #include "plugins.h"
48 #include "scanner.h"
49 #include "util.h"
50 
51 #define AUTOSAVE_INTERVAL 300 /* seconds */
52 
54 
55 static struct {
56  char **filenames;
57  int session;
65 } options;
66 
67 static char * aud_paths[AUD_PATH_COUNT];
68 
69 static void make_dirs(void)
70 {
71 #ifdef S_IRGRP
72  const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
73 #else
74  const mode_t mode755 = S_IRWXU;
75 #endif
76 
79 }
80 
81 static void normalize_path (char * path)
82 {
83 #ifdef _WIN32
84  string_replace_char (path, '/', '\\');
85 #endif
86  int len = strlen (path);
87 #ifdef _WIN32
88  if (len > 3 && path[len - 1] == '\\') /* leave "C:\" */
89 #else
90  if (len > 1 && path[len - 1] == '/') /* leave leading "/" */
91 #endif
92  path[len - 1] = 0;
93 }
94 
95 static char * last_path_element (char * path)
96 {
97  char * slash = strrchr (path, G_DIR_SEPARATOR);
98  return (slash && slash[1]) ? slash + 1 : NULL;
99 }
100 
101 static void strip_path_element (char * path, char * elem)
102 {
103 #ifdef _WIN32
104  if (elem > path + 3)
105 #else
106  if (elem > path + 1)
107 #endif
108  elem[-1] = 0; /* overwrite slash */
109  else
110  elem[0] = 0; /* leave [drive letter and] leading slash */
111 }
112 
113 static void relocate_path (char * * pathp, const char * old, const char * new)
114 {
115  char * path = * pathp;
116  int oldlen = strlen (old);
117  int newlen = strlen (new);
118 
119  if (oldlen && old[oldlen - 1] == G_DIR_SEPARATOR)
120  oldlen --;
121  if (newlen && new[newlen - 1] == G_DIR_SEPARATOR)
122  newlen --;
123 
124 #ifdef _WIN32
125  if (strncasecmp (path, old, oldlen) || (path[oldlen] && path[oldlen] != G_DIR_SEPARATOR))
126 #else
127  if (strncmp (path, old, oldlen) || (path[oldlen] && path[oldlen] != G_DIR_SEPARATOR))
128 #endif
129  {
130  fprintf (stderr, "Failed to relocate a data path. Falling back to "
131  "compile-time path: %s\n", path);
132  return;
133  }
134 
135  * pathp = g_strdup_printf ("%.*s%s", newlen, new, path + oldlen);
136  g_free (path);
137 }
138 
139 static void relocate_paths (void)
140 {
141  /* Start with the paths hard coded at compile time. */
142  aud_paths[AUD_PATH_BIN_DIR] = g_strdup (HARDCODE_BINDIR);
143  aud_paths[AUD_PATH_DATA_DIR] = g_strdup (HARDCODE_DATADIR);
144  aud_paths[AUD_PATH_PLUGIN_DIR] = g_strdup (HARDCODE_PLUGINDIR);
145  aud_paths[AUD_PATH_LOCALE_DIR] = g_strdup (HARDCODE_LOCALEDIR);
146  aud_paths[AUD_PATH_DESKTOP_FILE] = g_strdup (HARDCODE_DESKTOPFILE);
147  aud_paths[AUD_PATH_ICON_FILE] = g_strdup (HARDCODE_ICONFILE);
154 
155  /* Compare the compile-time path to the executable and the actual path to
156  * see if we have been moved. */
157  char * old = g_strdup (aud_paths[AUD_PATH_BIN_DIR]);
158  char * new = get_path_to_self ();
159  if (! new)
160  {
161 ERR:
162  g_free (old);
163  g_free (new);
164  return;
165  }
166  normalize_path (new);
167 
168  /* Strip the name of the executable file, leaving the path. */
169  char * base = last_path_element (new);
170  if (! base)
171  goto ERR;
172  strip_path_element (new, base);
173 
174  /* Strip innermost folder names from both paths as long as they match. This
175  * leaves a compile-time prefix and a run-time one to replace it with. */
176  char * a, * b;
177  while ((a = last_path_element (old)) && (b = last_path_element (new)) &&
178 #ifdef _WIN32
179  ! strcasecmp (a, b))
180 #else
181  ! strcmp (a, b))
182 #endif
183  {
184  strip_path_element (old, a);
185  strip_path_element (new, b);
186  }
187 
188  /* Do the replacements. */
189  relocate_path (& aud_paths[AUD_PATH_BIN_DIR], old, new);
190  relocate_path (& aud_paths[AUD_PATH_DATA_DIR], old, new);
191  relocate_path (& aud_paths[AUD_PATH_PLUGIN_DIR], old, new);
192  relocate_path (& aud_paths[AUD_PATH_LOCALE_DIR], old, new);
193  relocate_path (& aud_paths[AUD_PATH_DESKTOP_FILE], old, new);
194  relocate_path (& aud_paths[AUD_PATH_ICON_FILE], old, new);
195 
196  g_free (old);
197  g_free (new);
198 }
199 
200 static void init_paths (void)
201 {
202  relocate_paths ();
203 
204  const char * xdg_config_home = g_get_user_config_dir ();
205  const char * xdg_data_home = g_get_user_data_dir ();
206 
207 #ifdef _WIN32
208  /* Some libraries (libmcs) and plugins (filewriter) use these variables,
209  * which are generally not set on Windows. */
210  g_setenv ("HOME", g_get_home_dir (), TRUE);
211  g_setenv ("XDG_CONFIG_HOME", xdg_config_home, TRUE);
212  g_setenv ("XDG_DATA_HOME", xdg_data_home, TRUE);
213  g_setenv ("XDG_CACHE_HOME", g_get_user_cache_dir (), TRUE);
214 #endif
215 
216  aud_paths[AUD_PATH_USER_DIR] = g_build_filename(xdg_config_home, "audacious", NULL);
217  aud_paths[AUD_PATH_USER_PLUGIN_DIR] = g_build_filename(xdg_data_home, "audacious", "Plugins", NULL);
218  aud_paths[AUD_PATH_PLAYLISTS_DIR] = g_build_filename(aud_paths[AUD_PATH_USER_DIR], "playlists", NULL);
219  aud_paths[AUD_PATH_GTKRC_FILE] = g_build_filename(aud_paths[AUD_PATH_USER_DIR], "gtkrc", NULL);
220 
221  for (int i = 0; i < AUD_PATH_COUNT; i ++)
222  AUDDBG ("Data path: %s\n", aud_paths[i]);
223 }
224 
225 const char * get_path (int id)
226 {
227  g_return_val_if_fail (id >= 0 && id < AUD_PATH_COUNT, NULL);
228  return aud_paths[id];
229 }
230 
231 static GOptionEntry cmd_entries[] = {
232  {"rew", 'r', 0, G_OPTION_ARG_NONE, &options.rew, N_("Skip backwards in playlist"), NULL},
233  {"play", 'p', 0, G_OPTION_ARG_NONE, &options.play, N_("Start playing current playlist"), NULL},
234  {"pause", 'u', 0, G_OPTION_ARG_NONE, &options.pause, N_("Pause current song"), NULL},
235  {"stop", 's', 0, G_OPTION_ARG_NONE, &options.stop, N_("Stop current song"), NULL},
236  {"play-pause", 't', 0, G_OPTION_ARG_NONE, &options.play_pause, N_("Pause if playing, play otherwise"), NULL},
237  {"fwd", 'f', 0, G_OPTION_ARG_NONE, &options.fwd, N_("Skip forward in playlist"), NULL},
238  {"show-jump-box", 'j', 0, G_OPTION_ARG_NONE, &options.show_jump_box, N_("Display Jump to File dialog"), NULL},
239  {"enqueue", 'e', 0, G_OPTION_ARG_NONE, &options.enqueue, N_("Add files to the playlist"), NULL},
240  {"enqueue-to-temp", 'E', 0, G_OPTION_ARG_NONE, &options.enqueue_to_temp, N_("Add new files to a temporary playlist"), NULL},
241  {"show-main-window", 'm', 0, G_OPTION_ARG_NONE, &options.mainwin, N_("Display the main window"), NULL},
242  {"headless", 'h', 0, G_OPTION_ARG_NONE, & headless, N_("Headless mode"), NULL},
243  {"quit-after-play", 'q', 0, G_OPTION_ARG_NONE, &options.quit_after_play, N_("Quit on playback stop"), NULL},
244  {"version", 'v', 0, G_OPTION_ARG_NONE, &options.version, N_("Show version"), NULL},
245  {"verbose", 'V', 0, G_OPTION_ARG_NONE, &options.verbose, N_("Print debugging messages"), NULL},
246  {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &options.filenames, N_("FILE..."), NULL},
247  {NULL},
248 };
249 
250 static void parse_options (int * argc, char *** argv)
251 {
252  GOptionContext *context;
253  GError *error = NULL;
254 
255  memset (& options, 0, sizeof options);
256  options.session = -1;
257 
258  context = g_option_context_new(_("- play multimedia files"));
259  g_option_context_add_main_entries(context, cmd_entries, PACKAGE);
260  g_option_context_add_group(context, gtk_get_option_group(FALSE));
261 
262  if (!g_option_context_parse(context, argc, argv, &error))
263  {
264  fprintf (stderr,
265  _("%s: %s\nTry `%s --help' for more information.\n"), (* argv)[0],
266  error->message, (* argv)[0]);
267  g_error_free (error);
268  exit (EXIT_FAILURE);
269  }
270 
271  g_option_context_free (context);
272 
273  verbose = options.verbose;
274 }
275 
276 static bool_t get_lock (void)
277 {
278  char * path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "lock", aud_paths[AUD_PATH_USER_DIR]);
279  int handle = open (path, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
280 
281  if (handle < 0)
282  {
283  if (errno != EEXIST)
284  fprintf (stderr, "Cannot create %s: %s.\n", path, strerror (errno));
285 
286  g_free (path);
287  return FALSE;
288  }
289 
290  close (handle);
291  g_free (path);
292  return TRUE;
293 }
294 
295 static void release_lock (void)
296 {
297  char * path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "lock", aud_paths[AUD_PATH_USER_DIR]);
298  unlink (path);
299  g_free (path);
300 }
301 
302 static Index * convert_filenames (void)
303 {
304  if (! options.filenames)
305  return NULL;
306 
307  Index * filenames = index_new ();
308  char * * f = options.filenames;
309  char * cur = g_get_current_dir ();
310 
311  for (int i = 0; f[i]; i ++)
312  {
313  char * uri = NULL;
314 
315  if (strstr (f[i], "://"))
316  uri = str_get (f[i]);
317  else if (g_path_is_absolute (f[i]))
318  {
319  char * tmp = filename_to_uri (f[i]);
320  uri = str_get (tmp);
321  free (tmp);
322  }
323  else
324  {
325  char * tmp = g_build_filename (cur, f[i], NULL);
326  char * tmp2 = filename_to_uri (tmp);
327  uri = str_get (tmp2);
328  free (tmp);
329  free (tmp2);
330  }
331 
332  if (uri)
333  index_append (filenames, uri);
334  }
335 
336  g_free (cur);
337  return filenames;
338 }
339 
340 static void do_remote (void)
341 {
342 #ifdef USE_DBUS
343  DBusGProxy * session = audacious_get_dbus_proxy ();
344 
345  if (session && audacious_remote_is_running (session))
346  {
347  Index * filenames = convert_filenames ();
348 
349  /* if no command line options, then present running instance */
350  if (! (filenames || options.play || options.pause || options.play_pause ||
351  options.stop || options.rew || options.fwd || options.show_jump_box ||
352  options.mainwin))
353  options.mainwin = TRUE;
354 
355  if (filenames)
356  {
357  GList * list = NULL;
358 
359  for (int f = index_count (filenames); f --; )
360  list = g_list_prepend (list, index_get (filenames, f));
361 
362  if (options.enqueue_to_temp)
364  else if (options.enqueue)
365  audacious_remote_playlist_add (session, list);
366  else
367  audacious_remote_playlist_open_list (session, list);
368 
369  g_list_free (list);
370 
371  for (int f = 0; f < index_count (filenames); f ++)
372  str_unref (index_get (filenames, f));
373 
374  index_free (filenames);
375  }
376 
377  if (options.play)
378  audacious_remote_play (session);
379  if (options.pause)
380  audacious_remote_pause (session);
381  if (options.play_pause)
382  audacious_remote_play_pause (session);
383  if (options.stop)
384  audacious_remote_stop (session);
385  if (options.rew)
387  if (options.fwd)
389  if (options.show_jump_box)
391  if (options.mainwin)
393 
394  exit (EXIT_SUCCESS);
395  }
396 #endif
397 
398  fprintf (stderr, "WARNING: Audacious seems to be already running but is not responding.\n");
399 }
400 
401 static void do_commands (void)
402 {
403  bool_t resume = get_bool (NULL, "resume_playback_on_startup");
404 
405  Index * filenames = convert_filenames ();
406  if (filenames)
407  {
408  if (options.enqueue_to_temp)
409  {
410  drct_pl_open_temp_list (filenames);
411  resume = FALSE;
412  }
413  else if (options.enqueue)
414  drct_pl_add_list (filenames, -1);
415  else
416  {
417  drct_pl_open_list (filenames);
418  resume = FALSE;
419  }
420  }
421 
422  if (resume)
423  playlist_resume ();
424 
425  if (options.play || options.play_pause)
426  {
427  if (! drct_get_playing ())
428  drct_play ();
429  else if (drct_get_paused ())
430  drct_pause ();
431  }
432 
433  if (options.show_jump_box)
435  if (options.mainwin)
437 }
438 
439 static void init_one (void)
440 {
441  init_paths ();
442  make_dirs ();
443 
444  setlocale (LC_ALL, "");
445  bindtextdomain (PACKAGE, aud_paths[AUD_PATH_LOCALE_DIR]);
446  bind_textdomain_codeset (PACKAGE, "UTF-8");
447  bindtextdomain (PACKAGE "-plugins", aud_paths[AUD_PATH_LOCALE_DIR]);
448  bind_textdomain_codeset (PACKAGE "-plugins", "UTF-8");
449  textdomain (PACKAGE);
450 }
451 
452 static void init_two (int * p_argc, char * * * p_argv)
453 {
454  if (! headless)
455  {
456 #if ! GLIB_CHECK_VERSION (2, 32, 0)
457  g_thread_init (NULL);
458 #endif
459  gtk_init (p_argc, p_argv);
460  }
461 
462  AUDDBG ("Loading configuration.\n");
463  config_load ();
464 
465  AUDDBG ("Initializing.\n");
466  art_init ();
467  chardet_init ();
468  eq_init ();
469  playlist_init ();
470 
471 #ifdef HAVE_SIGWAIT
472  signals_init ();
473 #endif
474 
475  tag_set_verbose (verbose);
477 
478  AUDDBG ("Loading lowlevel plugins.\n");
480 
481  AUDDBG ("Starting worker threads.\n");
482  adder_init ();
483  scanner_init ();
484 
485  AUDDBG ("Restoring state.\n");
486  load_playlists ();
487 
488  do_commands ();
489 
490  AUDDBG ("Loading highlevel plugins.\n");
492 
493 #ifdef USE_DBUS
494  init_dbus ();
495 #endif
496 
498 }
499 
500 static void shut_down (void)
501 {
503 
504  AUDDBG ("Saving playlist state.\n");
506 
507  AUDDBG ("Unloading highlevel plugins.\n");
508  stop_plugins_two ();
509 
510 #ifdef USE_DBUS
511  cleanup_dbus ();
512 #endif
513 
514  AUDDBG ("Stopping playback.\n");
515  if (drct_get_playing ())
516  drct_stop ();
517 
518  AUDDBG ("Stopping worker threads.\n");
519  adder_cleanup ();
520  scanner_cleanup ();
521 
522  AUDDBG ("Unloading lowlevel plugins.\n");
523  stop_plugins_one ();
524 
525  AUDDBG ("Saving configuration.\n");
526  config_save ();
527  config_cleanup ();
528 
529  AUDDBG ("Cleaning up.\n");
530  art_cleanup ();
531  eq_cleanup ();
532  history_cleanup ();
533  playlist_end ();
534 
535  strpool_shutdown ();
536 }
537 
539 {
540  AUDDBG ("Saving configuration.\n");
541  hook_call ("config save", NULL);
543  config_save ();
544  return TRUE;
545 }
546 
548 {
549  return options.quit_after_play && ! drct_get_playing () && ! playlist_add_in_progress (-1);
550 }
551 
552 static void maybe_quit (void)
553 {
554  if (check_should_quit ())
555  gtk_main_quit ();
556 }
557 
558 int main(int argc, char ** argv)
559 {
560  init_one ();
561  parse_options (& argc, & argv);
562 
563  if (options.version)
564  {
565  printf ("%s %s (%s)\n", _("Audacious"), VERSION, BUILDSTAMP);
566  return EXIT_SUCCESS;
567  }
568 
569  if (! get_lock ())
570  do_remote (); /* may exit */
571 
572  AUDDBG ("No remote session; starting up.\n");
573  init_two (& argc, & argv);
574 
575  AUDDBG ("Startup complete.\n");
576  g_timeout_add_seconds (AUTOSAVE_INTERVAL, (GSourceFunc) do_autosave, NULL);
577 
578  if (check_should_quit ())
579  goto QUIT;
580 
581  hook_associate ("playback stop", (HookFunction) maybe_quit, NULL);
582  hook_associate ("playlist add complete", (HookFunction) maybe_quit, NULL);
583  hook_associate ("quit", (HookFunction) gtk_main_quit, NULL);
584 
585  gtk_main ();
586 
587  hook_dissociate ("playback stop", (HookFunction) maybe_quit);
588  hook_dissociate ("playlist add complete", (HookFunction) maybe_quit);
589  hook_dissociate ("quit", (HookFunction) gtk_main_quit);
590 
591 QUIT:
592  shut_down ();
593  release_lock ();
594  return EXIT_SUCCESS;
595 }
void drct_play(void)
Definition: drct.c:38
EXPORT void audacious_remote_stop(DBusGProxy *proxy)
Tells audacious to stop.
Definition: audctrl.c:178
EXPORT void audacious_remote_playlist_next(DBusGProxy *proxy)
Tells audacious to move forward in the playlist.
Definition: audctrl.c:549
void strpool_shutdown(void)
Definition: strpool.c:144
void adder_init(void)
Definition: adder.c:486
void mpris_signals_init(void)
Definition: mpris-signals.c:33
EXPORT void audacious_remote_playlist_open_list(DBusGProxy *proxy, GList *list)
Sends a list of URIs for Audacious to open.
Definition: audctrl.c:106
static void make_dirs(void)
Definition: main.c:69
int session
Definition: main.c:57
static void do_remote(void)
Definition: main.c:340
static void release_lock(void)
Definition: main.c:295
static void init_paths(void)
Definition: main.c:200
bool_t quit_after_play
Definition: main.c:61
EXPORT Index * index_new(void)
Definition: index.c:41
static void shut_down(void)
Definition: main.c:500
EXPORT void audacious_remote_playlist_open_list_to_temp(DBusGProxy *proxy, GList *list)
Sends a list of URIs for Audacious to open in a temporary playlist.
Definition: audctrl.c:127
static float a[EQ_BANDS][2]
Definition: equalizer.c:55
#define N_(String)
Definition: i18n.h:29
EXPORT void audacious_remote_playlist_add(DBusGProxy *proxy, GList *list)
Sends a list of URIs to Audacious to add to the playlist.
Definition: audctrl.c:86
void load_playlists(void)
void stop_plugins_two(void)
Definition: plugin-init.c:198
bool_t rew
Definition: main.c:58
void playlist_end(void)
Definition: playlist-new.c:660
#define _(String)
Definition: i18n.h:25
EXPORT gboolean audacious_remote_is_running(DBusGProxy *proxy)
Check if an Audacious instance is running.
Definition: audctrl.c:572
bool_t enqueue
Definition: main.c:59
static void maybe_quit(void)
Definition: main.c:552
void eq_cleanup(void)
Definition: equalizer.c:176
bool_t mainwin
Definition: main.c:59
static void strip_path_element(char *path, char *elem)
Definition: main.c:101
void stop_plugins_one(void)
Definition: plugin-init.c:204
bool_t pause
Definition: main.c:58
static void parse_options(int *argc, char ***argv)
Definition: main.c:250
bool_t play
Definition: main.c:58
static float b[EQ_BANDS][2]
Definition: equalizer.c:56
static char * last_path_element(char *path)
Definition: main.c:95
bool_t play_pause
Definition: main.c:58
void drct_stop(void)
Definition: drct.c:74
bool_t playlist_add_in_progress(int playlist)
Definition: adder.c:548
void init_dbus()
Definition: dbus.c:172
EXPORT int index_count(Index *index)
Definition: index.c:58
void(* HookFunction)(void *data, void *user)
Definition: hook.h:23
bool_t remote
Definition: main.c:59
EXPORT void hook_associate(const char *name, HookFunction func, void *user)
Definition: hook.c:36
EXPORT void string_replace_char(char *string, char old_c, char new_c)
Definition: audstrings.c:77
#define FALSE
Definition: core.h:35
void mpris_signals_cleanup(void)
Definition: mpris-signals.c:52
bool_t show_jump_box
Definition: main.c:58
Index Index bool_t
Definition: playlist-api.h:122
bool_t do_autosave(void)
Definition: main.c:538
static Index * convert_filenames(void)
Definition: main.c:302
void drct_pl_open_list(Index *filenames)
Definition: drct.c:188
#define AUDDBG(...)
Definition: debug.h:30
EXPORT void audacious_remote_main_win_toggle(DBusGProxy *proxy, gboolean show)
Toggles the main window's visibility.
Definition: audctrl.c:454
#define hook_dissociate(n, f)
Definition: hook.h:34
void signals_init(void)
Definition: signals.c:42
void chardet_init(void)
Definition: chardet.c:206
bool_t verbose
Definition: main.c:63
char * get_path_to_self(void)
Definition: util.c:155
void scanner_cleanup(void)
Definition: scanner.c:160
static bool_t get_lock(void)
Definition: main.c:276
#define NULL
Definition: core.h:27
bool_t headless
Definition: main.c:53
EXPORT void * index_get(Index *index, int at)
Definition: index.c:82
EXPORT void index_append(Index *index, void *value)
Definition: index.c:104
static GError * error
Definition: audctrl.c:30
static void relocate_path(char **pathp, const char *old, const char *new)
Definition: main.c:113
EXPORT void audacious_remote_play(DBusGProxy *proxy)
Requests audacious to begin playback.
Definition: audctrl.c:158
void save_playlists(bool_t exiting)
#define TRUE
Definition: core.h:37
void config_cleanup(void)
Definition: config.c:156
bool_t get_bool(const char *section, const char *name)
Definition: config.c:294
static struct @8 options
EXPORT void audacious_remote_pause(DBusGProxy *proxy)
Tells audacious to pause.
Definition: audctrl.c:168
bool_t stop
Definition: main.c:58
DBusGProxy * audacious_get_dbus_proxy(void)
Definition: dbus.c:1042
static char * aud_paths[AUD_PATH_COUNT]
Definition: main.c:67
EXPORT void audacious_remote_playlist_prev(DBusGProxy *proxy)
audacious_remote_playlist_prev:
Definition: audctrl.c:539
#define AUTOSAVE_INTERVAL
Definition: main.c:51
void playlist_init(void)
Definition: playlist-new.c:645
void str_unref(char *str)
Definition: strpool.c:89
EXPORT void index_free(Index *index)
Definition: index.c:52
void adder_cleanup(void)
Definition: adder.c:494
const char * get_path(int id)
Definition: main.c:225
void scanner_init(void)
Definition: scanner.c:154
char * previous_session_id
Definition: main.c:64
void drct_pl_add_list(Index *filenames, int at)
Definition: drct.c:176
bool_t drct_get_paused(void)
Definition: playback.c:477
void interface_show_jump_to_track(void)
Definition: interface.c:140
void drct_pause(void)
Definition: playback.c:204
void eq_init(void)
Definition: equalizer.c:168
void history_cleanup(void)
Definition: history.c:81
void drct_pl_open_temp_list(Index *filenames)
Definition: drct.c:200
EXPORT void hook_call(const char *name, void *data)
Definition: hook.c:98
bool_t version
Definition: main.c:62
void art_init(void)
Definition: art.c:199
void start_plugins_one(void)
Definition: plugin-init.c:150
static GOptionEntry cmd_entries[]
Definition: main.c:231
void config_load(void)
Definition: config.c:101
static void do_commands(void)
Definition: main.c:401
void art_cleanup(void)
Definition: art.c:208
void make_directory(const char *path, mode_t mode)
Definition: util.c:109
EXPORT void vfs_set_verbose(bool_t set)
Definition: vfs.c:61
static void normalize_path(char *path)
Definition: main.c:81
static void init_one(void)
Definition: main.c:439
EXPORT char * filename_to_uri(const char *name)
Definition: audstrings.c:143
char ** filenames
Definition: main.c:56
void config_save(void)
Definition: config.c:128
static void init_two(int *p_argc, char ***p_argv)
Definition: main.c:452
char * str_get(const char *str)
Definition: strpool.c:42
static bool_t check_should_quit(void)
Definition: main.c:547
void start_plugins_two(void)
Definition: plugin-init.c:159
void interface_show(bool_t show)
Definition: interface.c:62
void cleanup_dbus(void)
Definition: dbus.c:198
EXPORT void audacious_remote_play_pause(DBusGProxy *proxy)
Tells audacious to toggle between play and pause.
Definition: audctrl.c:737
int main(int argc, char **argv)
Definition: main.c:558
bool_t enqueue_to_temp
Definition: main.c:60
bool_t fwd
Definition: main.c:58
EXPORT void audacious_remote_show_jtf_box(DBusGProxy *proxy)
Tells audacious to show the Jump-to-File pane.
Definition: audctrl.c:821
void playlist_resume(void)
static void relocate_paths(void)
Definition: main.c:139
bool_t drct_get_playing(void)
Definition: playback.c:472