2 * This file is part of DisOrder.
3 * Copyright (C) 2004, 2005, 2006 Richard Kettlewell
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 extern struct queue_entry *playing; /* playing track or 0 */
25 extern int paused; /* non-0 if paused */
27 void play(ev_source *ev);
28 /* try to play something, if playing is enabled and nothing is playing
31 int playing_is_enabled(void);
32 /* return true iff playing is enabled */
34 void enable_playing(const char *who, ev_source *ev);
37 void disable_playing(const char *who);
38 /* disable playing. */
40 int random_is_enabled(void);
41 /* return true iff random play is enabled */
43 void enable_random(const char *who, ev_source *ev);
44 /* enable random play */
46 void disable_random(const char *who);
47 /* disable random play */
49 void scratch(const char *who, const char *id);
50 /* scratch the playing track. @who@ identifies the scratcher. @id@ is
51 * the ID or a null pointer. */
53 void quitting(ev_source *ev);
54 /* called to terminate current track and shut down speaker process
57 void speaker_setup(ev_source *ev);
58 /* set up the speaker subprocess */
60 void speaker_reload(void);
61 /* Tell the speaker process to reload its configuration. */
63 int pause_playing(const char *who);
64 /* Pause the current track. Return 0 on success, -1 on error. WHO
67 void resume_playing(const char *who);
68 /* Resume after a pause. WHO can be 0. */
70 int prepare(ev_source *ev,
71 struct queue_entry *q);
72 /* Prepare to play Q */
74 void abandon(ev_source *ev,
75 struct queue_entry *q);
76 /* Abandon a possibly-prepared track. */
78 int add_random_track(void);
79 /* If random play is enabled then try to add a track to the queue. On success
80 * (including deliberartely doing nothing) return 0. On error return -1. */