aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistState.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-07 10:55:05 +0100
committerMax Kellermann <max@duempel.org>2013-01-07 11:35:35 +0100
commit52638c68f51209dc6c5a966feeadffc5b922f919 (patch)
treec69b6e30407f7c80cc1b8a3aa3af408c60a42262 /src/PlaylistState.cxx
parent400ff1c81253d29b127834c0b5367e83bbb3430c (diff)
downloadmpd-52638c68f51209dc6c5a966feeadffc5b922f919.tar.gz
mpd-52638c68f51209dc6c5a966feeadffc5b922f919.tar.xz
mpd-52638c68f51209dc6c5a966feeadffc5b922f919.zip
Playlist: convert functions to methods
Diffstat (limited to '')
-rw-r--r--src/PlaylistState.cxx32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/PlaylistState.cxx b/src/PlaylistState.cxx
index 40f503e22..14c6d231e 100644
--- a/src/PlaylistState.cxx
+++ b/src/PlaylistState.cxx
@@ -145,26 +145,16 @@ playlist_state_restore(const char *line, TextFile &file,
seek_time =
atoi(&(line[strlen(PLAYLIST_STATE_FILE_TIME)]));
} else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_REPEAT)) {
- if (strcmp
- (&(line[strlen(PLAYLIST_STATE_FILE_REPEAT)]),
- "1") == 0) {
- playlist_set_repeat(playlist, pc, true);
- } else
- playlist_set_repeat(playlist, pc, false);
+ playlist->SetRepeat(*pc,
+ strcmp(&(line[strlen(PLAYLIST_STATE_FILE_REPEAT)]),
+ "1") == 0);
} else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_SINGLE)) {
- if (strcmp
- (&(line[strlen(PLAYLIST_STATE_FILE_SINGLE)]),
- "1") == 0) {
- playlist_set_single(playlist, pc, true);
- } else
- playlist_set_single(playlist, pc, false);
+ playlist->SetSingle(*pc,
+ strcmp(&(line[strlen(PLAYLIST_STATE_FILE_SINGLE)]),
+ "1") == 0);
} else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_CONSUME)) {
- if (strcmp
- (&(line[strlen(PLAYLIST_STATE_FILE_CONSUME)]),
- "1") == 0) {
- playlist_set_consume(playlist, true);
- } else
- playlist_set_consume(playlist, false);
+ playlist->SetConsume(strcmp(&(line[strlen(PLAYLIST_STATE_FILE_CONSUME)]),
+ "1") == 0);
} else if (g_str_has_prefix(line, PLAYLIST_STATE_FILE_CROSSFADE)) {
pc_set_cross_fade(pc,
atoi(line + strlen(PLAYLIST_STATE_FILE_CROSSFADE)));
@@ -188,7 +178,7 @@ playlist_state_restore(const char *line, TextFile &file,
}
}
- playlist_set_random(playlist, pc, random_mode);
+ playlist->SetRandom(*pc, random_mode);
if (!playlist->queue.IsEmpty()) {
if (!playlist->queue.IsValidPosition(current))
@@ -210,9 +200,9 @@ playlist_state_restore(const char *line, TextFile &file,
if (state == PLAYER_STATE_STOP /* && config_option */)
playlist->current = current;
else if (seek_time == 0)
- playlist_play(playlist, pc, current);
+ playlist->PlayPosition(*pc, current);
else
- playlist_seek_song(playlist, pc, current, seek_time);
+ playlist->SeekSongPosition(*pc, current, seek_time);
if (state == PLAYER_STATE_PAUSE)
pc_pause(pc);