player/Control: use class Error as C++ exception, throw it

This commit is contained in:
Max Kellermann
2016-09-08 10:29:49 +02:00
parent 3da4648112
commit 6e52ab285a
9 changed files with 150 additions and 141 deletions

View File

@@ -195,12 +195,20 @@ playlist_state_restore(const char *line, TextFile &file,
if (state == PlayerState::STOP /* && config_option */)
playlist.current = current;
else if (seek_time.count() == 0)
/* TODO: log error? */
playlist.PlayPosition(pc, current, IgnoreError());
else
playlist.SeekSongPosition(pc, current, seek_time,
IgnoreError());
else if (seek_time.count() == 0) {
try {
playlist.PlayPosition(pc, current);
} catch (...) {
/* TODO: log error? */
}
} else {
try {
playlist.SeekSongPosition(pc, current,
seek_time);
} catch (...) {
/* TODO: log error? */
}
}
if (state == PlayerState::PAUSE)
pc.LockPause();