diff options
Diffstat (limited to 'src/decoder/decoder_control.h')
-rw-r--r-- | src/decoder/decoder_control.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/decoder/decoder_control.h b/src/decoder/decoder_control.h index 8f3fc948..e262e0ac 100644 --- a/src/decoder/decoder_control.h +++ b/src/decoder/decoder_control.h @@ -41,7 +41,7 @@ enum decoder_state { DECODE_STATE_ERROR, }; -struct decoder_control { +typedef struct DecoderControl { /** the handle of the decoder thread, or NULL if the decoder thread isn't running */ GThread *thread; @@ -118,20 +118,20 @@ struct decoder_control { char *mixramp_start; char *mixramp_end; char *mixramp_prev_end; -}; +} DecoderControl; G_GNUC_MALLOC -struct decoder_control * +DecoderControl * dc_new(GCond *client_cond); void -dc_free(struct decoder_control *dc); +dc_free(DecoderControl *dc); /** * Locks the #decoder_control object. */ static inline void -decoder_lock(struct decoder_control *dc) +decoder_lock(DecoderControl *dc) { g_mutex_lock(dc->mutex); } @@ -140,7 +140,7 @@ decoder_lock(struct decoder_control *dc) * Unlocks the #decoder_control object. */ static inline void -decoder_unlock(struct decoder_control *dc) +decoder_unlock(DecoderControl *dc) { g_mutex_unlock(dc->mutex); } @@ -151,7 +151,7 @@ decoder_unlock(struct decoder_control *dc) * prior to calling this function. */ static inline void -decoder_wait(struct decoder_control *dc) +decoder_wait(DecoderControl *dc) { g_cond_wait(dc->cond, dc->mutex); } @@ -162,26 +162,26 @@ decoder_wait(struct decoder_control *dc) * this function. */ static inline void -decoder_signal(struct decoder_control *dc) +decoder_signal(DecoderControl *dc) { g_cond_signal(dc->cond); } static inline bool -decoder_is_idle(const struct decoder_control *dc) +decoder_is_idle(const DecoderControl *dc) { return dc->state == DECODE_STATE_STOP || dc->state == DECODE_STATE_ERROR; } static inline bool -decoder_is_starting(const struct decoder_control *dc) +decoder_is_starting(const DecoderControl *dc) { return dc->state == DECODE_STATE_START; } static inline bool -decoder_has_failed(const struct decoder_control *dc) +decoder_has_failed(const DecoderControl *dc) { assert(dc->command == DECODE_COMMAND_NONE); @@ -189,7 +189,7 @@ decoder_has_failed(const struct decoder_control *dc) } static inline bool -decoder_lock_is_idle(struct decoder_control *dc) +decoder_lock_is_idle(DecoderControl *dc) { bool ret; @@ -201,7 +201,7 @@ decoder_lock_is_idle(struct decoder_control *dc) } static inline bool -decoder_lock_is_starting(struct decoder_control *dc) +decoder_lock_is_starting(DecoderControl *dc) { bool ret; @@ -213,7 +213,7 @@ decoder_lock_is_starting(struct decoder_control *dc) } static inline bool -decoder_lock_has_failed(struct decoder_control *dc) +decoder_lock_has_failed(DecoderControl *dc) { bool ret; @@ -225,7 +225,7 @@ decoder_lock_has_failed(struct decoder_control *dc) } static inline const struct song * -decoder_current_song(const struct decoder_control *dc) +decoder_current_song(const DecoderControl *dc) { switch (dc->state) { case DECODE_STATE_STOP: @@ -251,26 +251,26 @@ decoder_current_song(const struct decoder_control *dc) * @param pipe the pipe which receives the decoded chunks (owned by * the caller) */ -void dc_start(struct decoder_control *dc, struct song *song, +void dc_start(DecoderControl *dc, struct song *song, unsigned start_ms, unsigned end_ms, int buffer_samples, struct music_pipe *pipe); void -dc_stop(struct decoder_control *dc); +dc_stop(DecoderControl *dc); bool -dc_seek(struct decoder_control *dc, double where); +dc_seek(DecoderControl *dc, double where); void -dc_quit(struct decoder_control *dc); +dc_quit(DecoderControl *dc); void -dc_mixramp_start(struct decoder_control *dc, char *mixramp_start); +dc_mixramp_start(DecoderControl *dc, char *mixramp_start); void -dc_mixramp_end(struct decoder_control *dc, char *mixramp_end); +dc_mixramp_end(DecoderControl *dc, char *mixramp_end); void -dc_mixramp_prev_end(struct decoder_control *dc, char *mixramp_prev_end); +dc_mixramp_prev_end(DecoderControl *dc, char *mixramp_prev_end); #endif |