MPD
Data Structures | Enumerations | Functions

src/decoder_control.h File Reference

#include "decoder_command.h"
#include "audio_format.h"
#include <glib.h>
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  decoder_control

Enumerations

enum  decoder_state { DECODE_STATE_STOP = 0, DECODE_STATE_START, DECODE_STATE_DECODE, DECODE_STATE_ERROR }

Functions

void dc_init (struct decoder_control *dc)
void dc_deinit (struct decoder_control *dc)
static void decoder_lock (struct decoder_control *dc)
 Locks the decoder_control object.
static void decoder_unlock (struct decoder_control *dc)
 Unlocks the decoder_control object.
static void decoder_wait (struct decoder_control *dc)
 Waits for a signal on the decoder_control object.
static void decoder_signal (struct decoder_control *dc)
 Signals the decoder_control object.
static bool decoder_is_idle (const struct decoder_control *dc)
static bool decoder_is_starting (const struct decoder_control *dc)
static bool decoder_has_failed (const struct decoder_control *dc)
static bool decoder_lock_is_idle (struct decoder_control *dc)
static bool decoder_lock_is_starting (struct decoder_control *dc)
static bool decoder_lock_has_failed (struct decoder_control *dc)
static struct song * decoder_current_song (const struct decoder_control *dc)
void dc_command_wait (struct decoder_control *dc)
void dc_start (struct decoder_control *dc, struct song *song, struct music_buffer *buffer, struct music_pipe *pipe)
 Start the decoder.
void dc_stop (struct decoder_control *dc)
bool dc_seek (struct decoder_control *dc, double where)
void dc_quit (struct decoder_control *dc)
void dc_mixramp_start (struct decoder_control *dc, char *mixramp_start)
void dc_mixramp_end (struct decoder_control *dc, char *mixramp_end)
void dc_mixramp_prev_end (struct decoder_control *dc, char *mixramp_prev_end)

Enumeration Type Documentation

Enumerator:
DECODE_STATE_STOP 
DECODE_STATE_START 
DECODE_STATE_DECODE 
DECODE_STATE_ERROR 

The last "START" command failed, because there was an I/O error or because no decoder was able to decode the file.

This state will only come after START; once the state has turned to DECODE, by definition no such error can occur.

Definition at line 30 of file decoder_control.h.


Function Documentation

void dc_command_wait ( struct decoder_control *  dc)
void dc_deinit ( struct decoder_control *  dc)
void dc_init ( struct decoder_control *  dc)
void dc_mixramp_end ( struct decoder_control *  dc,
char *  mixramp_end 
)
void dc_mixramp_prev_end ( struct decoder_control *  dc,
char *  mixramp_prev_end 
)
void dc_mixramp_start ( struct decoder_control *  dc,
char *  mixramp_start 
)
void dc_quit ( struct decoder_control *  dc)
bool dc_seek ( struct decoder_control *  dc,
double  where 
)
void dc_start ( struct decoder_control *  dc,
struct song *  song,
struct music_buffer *  buffer,
struct music_pipe *  pipe 
)

Start the decoder.

Parameters:
thedecoder
songthe song to be decoded
pipethe pipe which receives the decoded chunks (owned by the caller)
void dc_stop ( struct decoder_control *  dc)
static struct song* decoder_current_song ( const struct decoder_control *  dc) [static, read]

Definition at line 204 of file decoder_control.h.

static bool decoder_has_failed ( const struct decoder_control *  dc) [inline, static]

Definition at line 160 of file decoder_control.h.

static bool decoder_is_idle ( const struct decoder_control *  dc) [inline, static]

Definition at line 147 of file decoder_control.h.

static bool decoder_is_starting ( const struct decoder_control *  dc) [inline, static]

Definition at line 154 of file decoder_control.h.

static void decoder_lock ( struct decoder_control *  dc) [inline, static]

Locks the decoder_control object.

Definition at line 110 of file decoder_control.h.

static bool decoder_lock_has_failed ( struct decoder_control *  dc) [inline, static]

Definition at line 192 of file decoder_control.h.

static bool decoder_lock_is_idle ( struct decoder_control *  dc) [inline, static]

Definition at line 168 of file decoder_control.h.

static bool decoder_lock_is_starting ( struct decoder_control *  dc) [inline, static]

Definition at line 180 of file decoder_control.h.

static void decoder_signal ( struct decoder_control *  dc) [inline, static]

Signals the decoder_control object.

This function is only valid in the player thread. The object should be locked prior to calling this function.

Definition at line 141 of file decoder_control.h.

static void decoder_unlock ( struct decoder_control *  dc) [inline, static]

Unlocks the decoder_control object.

Definition at line 119 of file decoder_control.h.

static void decoder_wait ( struct decoder_control *  dc) [inline, static]

Waits for a signal on the decoder_control object.

This function is only valid in the decoder thread. The object must be locked prior to calling this function.

Definition at line 130 of file decoder_control.h.