MPD
Data Structures | Enumerations | Functions
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 songdecoder_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, unsigned start_ms, unsigned end_ms, 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,
unsigned  start_ms,
unsigned  end_ms,
struct music_buffer *  buffer,
struct music_pipe *  pipe 
)

Start the decoder.

Parameters
thedecoder
songthe song to be decoded
start_mssee decoder_control
end_mssee decoder_control
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)
staticread

Definition at line 221 of file decoder_control.h.

static bool decoder_has_failed ( const struct decoder_control dc)
inlinestatic

Definition at line 177 of file decoder_control.h.

static bool decoder_is_idle ( const struct decoder_control dc)
inlinestatic

Definition at line 164 of file decoder_control.h.

static bool decoder_is_starting ( const struct decoder_control dc)
inlinestatic

Definition at line 171 of file decoder_control.h.

static void decoder_lock ( struct decoder_control dc)
inlinestatic

Locks the decoder_control object.

Definition at line 127 of file decoder_control.h.

static bool decoder_lock_has_failed ( struct decoder_control dc)
inlinestatic

Definition at line 209 of file decoder_control.h.

static bool decoder_lock_is_idle ( struct decoder_control dc)
inlinestatic

Definition at line 185 of file decoder_control.h.

static bool decoder_lock_is_starting ( struct decoder_control dc)
inlinestatic

Definition at line 197 of file decoder_control.h.

static void decoder_signal ( struct decoder_control dc)
inlinestatic

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 158 of file decoder_control.h.

static void decoder_unlock ( struct decoder_control dc)
inlinestatic

Unlocks the decoder_control object.

Definition at line 136 of file decoder_control.h.

static void decoder_wait ( struct decoder_control dc)
inlinestatic

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 147 of file decoder_control.h.