aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderControl.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-27 12:27:33 +0200
committerMax Kellermann <max@duempel.org>2013-09-27 12:27:33 +0200
commit6765901687b1b5869e240dfa7507430ab8b6eb73 (patch)
tree4caa2e0f82fe98196684fd4da03cb0575d1d465c /src/DecoderControl.cxx
parentc5d05ac0cf18dbd3d04534de240c437f8b07bd28 (diff)
downloadmpd-6765901687b1b5869e240dfa7507430ab8b6eb73.tar.gz
mpd-6765901687b1b5869e240dfa7507430ab8b6eb73.tar.xz
mpd-6765901687b1b5869e240dfa7507430ab8b6eb73.zip
DecoderControl: convert "enum decoder_state" to strictly-typed enum
Diffstat (limited to 'src/DecoderControl.cxx')
-rw-r--r--src/DecoderControl.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/DecoderControl.cxx b/src/DecoderControl.cxx
index 53957195e..483d9203b 100644
--- a/src/DecoderControl.cxx
+++ b/src/DecoderControl.cxx
@@ -29,7 +29,7 @@
decoder_control::decoder_control()
:thread(nullptr),
- state(DECODE_STATE_STOP),
+ state(DecoderState::STOP),
command(DecoderCommand::NONE),
song(nullptr),
replay_gain_db(0), replay_gain_prev_db(0),
@@ -54,12 +54,12 @@ decoder_control::IsCurrentSong(const Song *_song) const
assert(_song != NULL);
switch (state) {
- case DECODE_STATE_STOP:
- case DECODE_STATE_ERROR:
+ case DecoderState::STOP:
+ case DecoderState::ERROR:
return false;
- case DECODE_STATE_START:
- case DECODE_STATE_DECODE:
+ case DecoderState::START:
+ case DecoderState::DECODE:
return song_equals(song, _song);
}
@@ -99,7 +99,7 @@ decoder_control::Stop()
function (see below). */
SynchronousCommandLocked(DecoderCommand::STOP);
- if (state != DECODE_STATE_STOP && state != DECODE_STATE_ERROR)
+ if (state != DecoderState::STOP && state != DecoderState::ERROR)
SynchronousCommandLocked(DecoderCommand::STOP);
Unlock();
@@ -108,11 +108,11 @@ decoder_control::Stop()
bool
decoder_control::Seek(double where)
{
- assert(state != DECODE_STATE_START);
+ assert(state != DecoderState::START);
assert(where >= 0.0);
- if (state == DECODE_STATE_STOP ||
- state == DECODE_STATE_ERROR || !seekable)
+ if (state == DecoderState::STOP ||
+ state == DecoderState::ERROR || !seekable)
return false;
seek_where = where;