diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:40:47 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-26 08:40:47 +0200 |
commit | 1c03c721eae87077675ccafece4cf4b9fef0a1ac (patch) | |
tree | 4bcf498a294357553cc7f3dd3bf86cc31887a966 /src/decode.h | |
parent | 9521c92f66c01a08526d14b92d581c858629101d (diff) | |
download | mpd-1c03c721eae87077675ccafece4cf4b9fef0a1ac.tar.gz mpd-1c03c721eae87077675ccafece4cf4b9fef0a1ac.tar.xz mpd-1c03c721eae87077675ccafece4cf4b9fef0a1ac.zip |
moved variable "dc" to decode.h
Now that "dc" is available here, we don't have to pass it to
decoder_is_idle() and decoder_is_starting() anymore.
Diffstat (limited to '')
-rw-r--r-- | src/decode.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/decode.h b/src/decode.h index ba6193a99..9922cd81e 100644 --- a/src/decode.h +++ b/src/decode.h @@ -44,7 +44,7 @@ enum decoder_command { #define DECODE_ERROR_UNKTYPE 10 #define DECODE_ERROR_FILE 20 -typedef struct _DecoderControl { +struct decoder_control { Notify notify; volatile enum decoder_state state; @@ -57,29 +57,31 @@ typedef struct _DecoderControl { Song *current_song; Song *volatile next_song; volatile float totalTime; -} DecoderControl; +}; + +extern struct decoder_control dc; void decoderInit(void); -static inline int decoder_is_idle(DecoderControl *dc) +static inline int decoder_is_idle(void) { - return dc->state == DECODE_STATE_STOP && - dc->command != DECODE_COMMAND_START; + return dc.state == DECODE_STATE_STOP && + dc.command != DECODE_COMMAND_START; } -static inline int decoder_is_starting(DecoderControl *dc) +static inline int decoder_is_starting(void) { - return dc->command == DECODE_COMMAND_START || - dc->state == DECODE_STATE_START; + return dc.command == DECODE_COMMAND_START || + dc.state == DECODE_STATE_START; } -static inline Song *decoder_current_song(DecoderControl *dc) +static inline Song *decoder_current_song(void) { - if (dc->state == DECODE_STATE_STOP || - dc->error != DECODE_ERROR_NOERROR) + if (dc.state == DECODE_STATE_STOP || + dc.error != DECODE_ERROR_NOERROR) return NULL; - return dc->current_song; + return dc.current_song; } void dc_command_wait(Notify *notify); |