player/Control: Play*() returns Error information
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -311,7 +311,7 @@ public:
|
||||
* @param song the song to be queued; the given instance will
|
||||
* be owned and freed by the player
|
||||
*/
|
||||
void Play(DetachedSong *song);
|
||||
bool Play(DetachedSong *song, Error &error);
|
||||
|
||||
/**
|
||||
* see PlayerCommand::CANCEL
|
||||
|
||||
Reference in New Issue
Block a user