player/Control: move code to SeekLocked()
This commit is contained in:
parent
36239895bd
commit
bedd5f00f8
@ -220,13 +220,11 @@ PlayerControl::LockEnqueueSong(DetachedSong *song)
|
||||
Unlock();
|
||||
}
|
||||
|
||||
bool
|
||||
PlayerControl::LockSeek(DetachedSong *song, SongTime t)
|
||||
void
|
||||
PlayerControl::SeekLocked(DetachedSong *song, SongTime t)
|
||||
{
|
||||
assert(song != nullptr);
|
||||
|
||||
Lock();
|
||||
|
||||
if (next_song != nullptr)
|
||||
SynchronousCommand(PlayerCommand::CANCEL);
|
||||
|
||||
@ -235,9 +233,18 @@ PlayerControl::LockSeek(DetachedSong *song, SongTime t)
|
||||
next_song = song;
|
||||
seek_time = t;
|
||||
SynchronousCommand(PlayerCommand::SEEK);
|
||||
Unlock();
|
||||
|
||||
assert(next_song == nullptr);
|
||||
}
|
||||
|
||||
bool
|
||||
PlayerControl::LockSeek(DetachedSong *song, SongTime t)
|
||||
{
|
||||
assert(song != nullptr);
|
||||
|
||||
Lock();
|
||||
SeekLocked(song, t);
|
||||
Unlock();
|
||||
|
||||
idle_add(IDLE_PLAYER);
|
||||
|
||||
|
@ -427,6 +427,8 @@ private:
|
||||
SynchronousCommand(PlayerCommand::QUEUE);
|
||||
}
|
||||
|
||||
void SeekLocked(DetachedSong *song, SongTime t);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @param song the song to be queued; the given instance will be owned
|
||||
|
Loading…
Reference in New Issue
Block a user