summaryrefslogtreecommitdiff
path: root/src/queue
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-09-05 20:37:24 +0200
committerMax Kellermann <max@musicpd.org>2016-09-05 20:37:24 +0200
commitaca081557a273b2ccbce2602745ac35ff3f1eac3 (patch)
tree5fb740f0feabdcc7d43bcdb8c4603c687ea9ad51 /src/queue
parenta71efacd1e86d7dcac376cd003416673163d9c7e (diff)
queue/PlaylistControl: use PlaylistError::NotPlaying()
Diffstat (limited to 'src/queue')
-rw-r--r--src/queue/PlaylistControl.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/queue/PlaylistControl.cxx b/src/queue/PlaylistControl.cxx
index 8db0cda7d..84e0f82cf 100644
--- a/src/queue/PlaylistControl.cxx
+++ b/src/queue/PlaylistControl.cxx
@@ -121,11 +121,8 @@ playlist::PlayId(PlayerControl &pc, int id, Error &error)
bool
playlist::PlayNext(PlayerControl &pc, Error &error)
{
- if (!playing) {
- error.Set(playlist_domain, int(PlaylistResult::NOT_PLAYING),
- "Not playing");
- return false;
- }
+ if (!playing)
+ throw PlaylistError::NotPlaying();
assert(!queue.IsEmpty());
assert(queue.IsValidOrder(current));
@@ -173,11 +170,8 @@ playlist::PlayNext(PlayerControl &pc, Error &error)
bool
playlist::PlayPrevious(PlayerControl &pc, Error &error)
{
- if (!playing) {
- error.Set(playlist_domain, int(PlaylistResult::NOT_PLAYING),
- "Not playing");
- return false;
- }
+ if (!playing)
+ throw PlaylistError::NotPlaying();
assert(!queue.IsEmpty());