aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/OutputControl.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-24 22:13:50 +0100
committerMax Kellermann <max@duempel.org>2014-12-24 22:13:50 +0100
commit54fc8f0e8c4ba5bf3eca799eab03201fea099d14 (patch)
treee20dd8674cffa714e30adaeaf33661de66e9e9e4 /src/output/OutputControl.cxx
parent2ea633a2f759d1b2c7d6653ae018d3114ce5982e (diff)
downloadmpd-54fc8f0e8c4ba5bf3eca799eab03201fea099d14.tar.gz
mpd-54fc8f0e8c4ba5bf3eca799eab03201fea099d14.tar.xz
mpd-54fc8f0e8c4ba5bf3eca799eab03201fea099d14.zip
output/Internal: convert audio_output_command to strictly-typed enum
Diffstat (limited to '')
-rw-r--r--src/output/OutputControl.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/output/OutputControl.cxx b/src/output/OutputControl.cxx
index 89428fa87..473f47bdf 100644
--- a/src/output/OutputControl.cxx
+++ b/src/output/OutputControl.cxx
@@ -46,7 +46,7 @@ AudioOutput::WaitForCommand()
}
void
-AudioOutput::CommandAsync(audio_output_command cmd)
+AudioOutput::CommandAsync(AudioOutputCommand cmd)
{
assert(IsCommandFinished());
@@ -55,14 +55,14 @@ AudioOutput::CommandAsync(audio_output_command cmd)
}
void
-AudioOutput::CommandWait(audio_output_command cmd)
+AudioOutput::CommandWait(AudioOutputCommand cmd)
{
CommandAsync(cmd);
WaitForCommand();
}
void
-AudioOutput::LockCommandWait(audio_output_command cmd)
+AudioOutput::LockCommandWait(AudioOutputCommand cmd)
{
const ScopeLock protect(mutex);
CommandWait(cmd);
@@ -92,7 +92,7 @@ AudioOutput::LockEnableWait()
StartThread();
}
- LockCommandWait(AO_COMMAND_ENABLE);
+ LockCommandWait(AudioOutputCommand::ENABLE);
}
void
@@ -109,7 +109,7 @@ AudioOutput::LockDisableWait()
return;
}
- LockCommandWait(AO_COMMAND_DISABLE);
+ LockCommandWait(AudioOutputCommand::DISABLE);
}
inline bool
@@ -134,7 +134,7 @@ AudioOutput::Open(const AudioFormat audio_format, const MusicPipe &mp)
/* we're not using audio_output_cancel() here,
because that function is asynchronous */
- CommandWait(AO_COMMAND_CANCEL);
+ CommandWait(AudioOutputCommand::CANCEL);
}
return true;
@@ -148,7 +148,9 @@ AudioOutput::Open(const AudioFormat audio_format, const MusicPipe &mp)
if (!thread.IsDefined())
StartThread();
- CommandWait(open ? AO_COMMAND_REOPEN : AO_COMMAND_OPEN);
+ CommandWait(open
+ ? AudioOutputCommand::REOPEN
+ : AudioOutputCommand::OPEN);
const bool open2 = open;
if (open2 && mixer != nullptr) {
@@ -172,7 +174,7 @@ AudioOutput::CloseWait()
assert(!open || !fail_timer.IsDefined());
if (open)
- CommandWait(AO_COMMAND_CLOSE);
+ CommandWait(AudioOutputCommand::CLOSE);
else
fail_timer.Reset();
}
@@ -219,7 +221,7 @@ AudioOutput::LockPauseAsync()
assert(allow_play);
if (IsOpen())
- CommandAsync(AO_COMMAND_PAUSE);
+ CommandAsync(AudioOutputCommand::PAUSE);
}
void
@@ -229,7 +231,7 @@ AudioOutput::LockDrainAsync()
assert(allow_play);
if (IsOpen())
- CommandAsync(AO_COMMAND_DRAIN);
+ CommandAsync(AudioOutputCommand::DRAIN);
}
void
@@ -239,7 +241,7 @@ AudioOutput::LockCancelAsync()
if (IsOpen()) {
allow_play = false;
- CommandAsync(AO_COMMAND_CANCEL);
+ CommandAsync(AudioOutputCommand::CANCEL);
}
}
@@ -277,7 +279,7 @@ AudioOutput::StopThread()
assert(thread.IsDefined());
assert(allow_play);
- LockCommandWait(AO_COMMAND_KILL);
+ LockCommandWait(AudioOutputCommand::KILL);
thread.Join();
}