diff options
author | Max Kellermann <max@duempel.org> | 2013-09-27 22:07:20 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-27 22:07:20 +0200 |
commit | d05bb2a0afeb5b23cb8c1d019590fa112e2f579b (patch) | |
tree | d4a25a4e1724c3cb537a0be17758933a1beb0bf9 /src/Playlist.cxx | |
parent | 6765901687b1b5869e240dfa7507430ab8b6eb73 (diff) | |
download | mpd-d05bb2a0afeb5b23cb8c1d019590fa112e2f579b.tar.gz mpd-d05bb2a0afeb5b23cb8c1d019590fa112e2f579b.tar.xz mpd-d05bb2a0afeb5b23cb8c1d019590fa112e2f579b.zip |
PlayerControl: use strictly typed enums
Diffstat (limited to 'src/Playlist.cxx')
-rw-r--r-- | src/Playlist.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Playlist.cxx b/src/Playlist.cxx index 0fc12f745..bce8d6e8d 100644 --- a/src/Playlist.cxx +++ b/src/Playlist.cxx @@ -175,11 +175,11 @@ playlist::SyncWithPlayer(player_control &pc) return; pc.Lock(); - const player_state pc_state = pc.GetState(); + const PlayerState pc_state = pc.GetState(); const Song *pc_next_song = pc.next_song; pc.Unlock(); - if (pc_state == PLAYER_STATE_STOP) + if (pc_state == PlayerState::STOP) /* the player thread has stopped: check if playback should be restarted with the next song. That can happen if the playlist isn't filling the queue fast @@ -210,16 +210,16 @@ static void playlist_resume_playback(struct playlist *playlist, struct player_control *pc) { assert(playlist->playing); - assert(pc->GetState() == PLAYER_STATE_STOP); + assert(pc->GetState() == PlayerState::STOP); const auto error = pc->GetErrorType(); - if (error == PLAYER_ERROR_NONE) + if (error == PlayerError::NONE) playlist->error_count = 0; else ++playlist->error_count; - if ((playlist->stop_on_error && error != PLAYER_ERROR_NONE) || - error == PLAYER_ERROR_OUTPUT || + if ((playlist->stop_on_error && error != PlayerError::NONE) || + error == PlayerError::OUTPUT || playlist->error_count >= playlist->queue.GetLength()) /* too many errors, or critical error: stop playback */ |