player/Control: Play*() returns Error information

This commit is contained in:
Max Kellermann
2015-11-11 19:57:37 +01:00
parent 2065e32904
commit fb547260d1
9 changed files with 82 additions and 54 deletions

View File

@@ -49,18 +49,20 @@ PlayerControl::~PlayerControl()
delete tagged_song;
}
void
PlayerControl::Play(DetachedSong *song)
bool
PlayerControl::Play(DetachedSong *song, Error &error_r)
{
assert(song != nullptr);
const ScopeLock protect(mutex);
SeekLocked(song, SongTime::zero(), IgnoreError());
bool success = SeekLocked(song, SongTime::zero(), error_r);
if (state == PlayerState::PAUSE)
if (success && state == PlayerState::PAUSE)
/* if the player was paused previously, we need to
unpause it */
PauseLocked();
return success;
}
void