Logo Search packages:      
Sourcecode: herrie version File versions  Download package

playq.c File Reference


Detailed Description

Playlist handling.

Definition in file playq.c.

#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"

Go to the source code of this file.

Classes

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

Defines

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

Functions

void playq_cursong_next (void)
 Continue to the next song.
void playq_cursong_pause (void)
 Pause or unpause the current song, depending on its current state.
void playq_cursong_prev (void)
 Go back to the previous song.
void playq_cursong_seek (int len, int rel)
 Seek the current song by a certain amount of time.
void playq_cursong_stop (void)
 Stop playback.
void playq_init (int xmms, int load_dumpfile)
 Initialize the playlist locking.
void playq_repeat_toggle (void)
 Toggle whether repeat is turned on or off.
static void * playq_runner_thread (void *unused)
 Infinitely play music in the playlist, honouring the playq_flags.
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_song_fast_add_after (struct vfsref *nvr, struct vfsref *lvr, unsigned int index)
 Add a song after the specified song.
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_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_move_up (struct vfsref *vr, unsigned int index)
 Move the specified song one position up.
void playq_song_fast_remove (struct vfsref *vr, unsigned int index)
 Remove the song with its corresponding index.
void playq_song_fast_select (struct vfsref *vr, unsigned int index)
 Switch playback to a specific song.
void playq_song_randomize (void)
 Randomize the playlist.
void playq_song_remove_all (void)
 Remove all songs from the playlist.
void playq_spawn (void)
 Spawn the playback thread.

Variables

static struct playq_funcsfuncs = &party_funcs
 Currenty used playlist handling routines.
static struct playq_funcs party_funcs
 Traditional Herrie-style playlist handling.
static volatile int playq_flags = PF_STOP
 Flags the playback thread should honour. Writing to them should be locked down.
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 GRand * playq_rand
 Randomizer used for shuffling the playlist.
int playq_repeat = 0
 Flag whether repeat is turned on by the user.
static GThread * playq_runner
 Reference to playback thread.
static volatile int playq_seek_time
 Amount of seconds which the current song should seek.
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 struct playq_funcs xmms_funcs
 XMMS-style playlist handling.


Generated by  Doxygen 1.6.0   Back to index