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

@@ -308,10 +308,12 @@ private:
public:
/**
* Throws std::runtime_error or #Error on error.
*
* @param song the song to be queued; the given instance will
* be owned and freed by the player
*/
bool Play(DetachedSong *song, Error &error);
void Play(DetachedSong *song);
/**
* see PlayerCommand::CANCEL
@@ -425,7 +427,10 @@ private:
SynchronousCommand(PlayerCommand::QUEUE);
}
bool SeekLocked(DetachedSong *song, SongTime t, Error &error_r);
/**
* Throws std::runtime_error or #Error on error.
*/
void SeekLocked(DetachedSong *song, SongTime t);
public:
/**
@@ -437,12 +442,12 @@ public:
/**
* Makes the player thread seek the specified song to a position.
*
* Throws std::runtime_error or #Error on error.
*
* @param song the song to be queued; the given instance will be owned
* and freed by the player
* @return true on success, false on failure (e.g. if MPD isn't
* playing currently)
*/
bool LockSeek(DetachedSong *song, SongTime t, Error &error_r);
void LockSeek(DetachedSong *song, SongTime t);
void SetCrossFade(float cross_fade_seconds);