aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderControl.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-27 12:11:37 +0200
committerMax Kellermann <max@duempel.org>2013-09-27 12:11:37 +0200
commitc5d05ac0cf18dbd3d04534de240c437f8b07bd28 (patch)
tree5e69c019f69cc6f2f1d99c71448338d855bf4898 /src/DecoderControl.cxx
parent939003c1f1a8ed9f6e3fe677a63e1686fe35d929 (diff)
downloadmpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.gz
mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.tar.xz
mpd-c5d05ac0cf18dbd3d04534de240c437f8b07bd28.zip
DecoderCommand: convert to strictly-typed enum
Diffstat (limited to 'src/DecoderControl.cxx')
-rw-r--r--src/DecoderControl.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/DecoderControl.cxx b/src/DecoderControl.cxx
index 063a78644..53957195e 100644
--- a/src/DecoderControl.cxx
+++ b/src/DecoderControl.cxx
@@ -30,7 +30,7 @@
decoder_control::decoder_control()
:thread(nullptr),
state(DECODE_STATE_STOP),
- command(DECODE_COMMAND_NONE),
+ command(DecoderCommand::NONE),
song(nullptr),
replay_gain_db(0), replay_gain_prev_db(0),
mixramp_start(nullptr), mixramp_end(nullptr),
@@ -84,7 +84,7 @@ decoder_control::Start(Song *_song,
buffer = &_buffer;
pipe = &_pipe;
- LockSynchronousCommand(DECODE_COMMAND_START);
+ LockSynchronousCommand(DecoderCommand::START);
}
void
@@ -92,15 +92,15 @@ decoder_control::Stop()
{
Lock();
- if (command != DECODE_COMMAND_NONE)
+ if (command != DecoderCommand::NONE)
/* Attempt to cancel the current command. If it's too
late and the decoder thread is already executing
the old command, we'll call STOP again in this
function (see below). */
- SynchronousCommandLocked(DECODE_COMMAND_STOP);
+ SynchronousCommandLocked(DecoderCommand::STOP);
if (state != DECODE_STATE_STOP && state != DECODE_STATE_ERROR)
- SynchronousCommandLocked(DECODE_COMMAND_STOP);
+ SynchronousCommandLocked(DecoderCommand::STOP);
Unlock();
}
@@ -117,7 +117,7 @@ decoder_control::Seek(double where)
seek_where = where;
seek_error = false;
- SynchronousCommandLocked(DECODE_COMMAND_SEEK);
+ SynchronousCommandLocked(DecoderCommand::SEEK);
return !seek_error;
}
@@ -128,7 +128,7 @@ decoder_control::Quit()
assert(thread != nullptr);
quit = true;
- LockAsynchronousCommand(DECODE_COMMAND_STOP);
+ LockAsynchronousCommand(DecoderCommand::STOP);
g_thread_join(thread);
thread = nullptr;