playq.c File Reference

Playlist handling. More...

#include "stdinc.h"
#include "audio_file.h"
#include "audio_output.h"
#include "config.h"
#include "gui.h"
#include "playq.h"
#include "playq_modules.h"
#include "vfs.h"
Include dependency graph for playq.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  playq_funcs
 Routines that should be used to control the playlist. More...

Defines

#define PF_QUIT   0x01
 Quit the playback thread.
#define PF_PAUSE   0x02
 Pause the current song.
#define PF_SEEK_ABS   0x08
 Perform an absolute seek.
#define PF_SEEK_REL   0x10
 Perform a relative seek.
#define PF_SEEK   (PF_SEEK_ABS|PF_SEEK_REL)
 Test whether a seek is performed at all.
#define PF_SKIP   0x20
 Skip to the next song.
#define PF_STOP   0x40
 Don't start playback of the next song.

Functions

static void * playq_runner_thread (void *unused)
 Infinitely play music in the playlist, honouring the playq_flags.
void playq_init (int autoplay, int xmms, int load_dumpfile)
 Initialize the playlist locking.
void playq_spawn (void)
 Spawn the playback thread.
void playq_shutdown (void)
 Shutdown the playback thread.
void playq_song_add_head (struct vfsref *vr)
 Lock queue and add a file or directory to the head of the playlist.
void playq_song_add_tail (struct vfsref *vr)
 Lock queue and add a file or directory to the tail of the playlist.
void playq_cursong_seek (int len, int rel)
 Seek the current song by a certain amount of time.
void playq_cursong_next (void)
 Continue to the next song.
void playq_cursong_prev (void)
 Go back to the previous song.
void playq_cursong_stop (void)
 Stop playback.
void playq_cursong_pause (void)
 Pause or unpause the current song, depending on its current state.
void playq_repeat_toggle (void)
 Toggle whether repeat is turned on or off.
void playq_song_fast_remove (struct vfsref *vr, unsigned int index)
 Remove the song with its corresponding index.
void playq_song_fast_add_before (struct vfsref *nvr, struct vfsref *lvr, unsigned int index)
 Add a song before the specified song.
void playq_song_fast_add_after (struct vfsref *nvr, struct vfsref *lvr, unsigned int index)
 Add a song after the specified song.
void playq_song_fast_move_up (struct vfsref *vr, unsigned int index)
 Move the specified song one position up.
void playq_song_fast_move_down (struct vfsref *vr, unsigned int index)
 Move the specified song one position down.
void playq_song_fast_move_head (struct vfsref *vr, unsigned int index)
 Move the specified song to the top.
void playq_song_fast_move_tail (struct vfsref *vr, unsigned int index)
 Move the specified song to the bottom.
void playq_song_fast_select (struct vfsref *vr)
 Switch playback to a specific song.
void playq_song_remove_all (void)
 Remove all songs from the playlist.
void playq_song_randomize (void)
 Randomize the playlist.

Variables

static struct playq_funcs party_funcs
 Traditional Herrie-style playlist handling.
static struct playq_funcs xmms_funcs
 XMMS-style playlist handling.
static struct playq_funcsfuncs = &party_funcs
 Currenty used playlist handling routines.
struct vfslist playq_list = VFSLIST_INITIALIZER
 The actual playlist containing all songs scheduled for playback.
GMutex * playq_mtx
 The mutex that locks down the playlist.
static GCond * playq_wakeup
 Conditional variable used to kick the playq alive when it was waiting for a new song to be added to the playlist or when paused.
static GThread * playq_runner
 Reference to playback thread.
static GRand * playq_rand
 Randomizer used for shuffling the playlist.
static volatile int playq_flags = PF_STOP
 Flags the playback thread should honour. Writing to them should be locked down.
int playq_repeat = 0
 Flag whether repeat is turned on by the user.
static volatile int playq_seek_time
 Amount of seconds which the current song should seek.

Detailed Description

Playlist handling.

Definition in file playq.c.

 All Data Structures Files Functions Variables Defines
Generated on Mon Mar 15 04:45:40 2010 for herrie by  doxygen 1.6.3