player/Control: add Lock prefix to locking method names
This commit is contained in:
@@ -57,7 +57,7 @@ playlist::QueueSongOrder(PlayerControl &pc, unsigned order)
|
||||
FormatDebug(playlist_domain, "queue song %i:\"%s\"",
|
||||
queued, song.GetURI());
|
||||
|
||||
pc.EnqueueSong(new DetachedSong(song));
|
||||
pc.LockEnqueueSong(new DetachedSong(song));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -140,7 +140,7 @@ playlist::UpdateQueuedSong(PlayerControl &pc, const DetachedSong *prev)
|
||||
|
||||
if (prev != nullptr && next_song != prev) {
|
||||
/* clear the currently queued song */
|
||||
pc.Cancel();
|
||||
pc.LockCancel();
|
||||
queued = -1;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ playlist::SetRepeat(PlayerControl &pc, bool status)
|
||||
|
||||
queue.repeat = status;
|
||||
|
||||
pc.SetBorderPause(queue.single && !queue.repeat);
|
||||
pc.LockSetBorderPause(queue.single && !queue.repeat);
|
||||
|
||||
/* if the last song is currently being played, the "next song"
|
||||
might change when repeat mode is toggled */
|
||||
@@ -262,7 +262,7 @@ playlist::SetSingle(PlayerControl &pc, bool status)
|
||||
|
||||
queue.single = status;
|
||||
|
||||
pc.SetBorderPause(queue.single && !queue.repeat);
|
||||
pc.LockSetBorderPause(queue.single && !queue.repeat);
|
||||
|
||||
/* if the last song is currently being played, the "next song"
|
||||
might change when single mode is toggled */
|
||||
|
@@ -38,7 +38,7 @@ playlist::Stop(PlayerControl &pc)
|
||||
assert(current >= 0);
|
||||
|
||||
FormatDebug(playlist_domain, "stop");
|
||||
pc.Stop();
|
||||
pc.LockStop();
|
||||
queued = -1;
|
||||
playing = false;
|
||||
|
||||
@@ -59,7 +59,7 @@ playlist::Stop(PlayerControl &pc)
|
||||
PlaylistResult
|
||||
playlist::PlayPosition(PlayerControl &pc, int song)
|
||||
{
|
||||
pc.ClearError();
|
||||
pc.LockClearError();
|
||||
|
||||
unsigned i = song;
|
||||
if (song == -1) {
|
||||
@@ -71,7 +71,7 @@ playlist::PlayPosition(PlayerControl &pc, int song)
|
||||
if (playing) {
|
||||
/* already playing: unpause playback, just in
|
||||
case it was paused, and return */
|
||||
pc.SetPause(false);
|
||||
pc.LockSetPause(false);
|
||||
return PlaylistResult::SUCCESS;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ playlist::SeekSongOrder(PlayerControl &pc, unsigned i, SongTime seek_time)
|
||||
|
||||
const DetachedSong *queued_song = GetQueuedSong();
|
||||
|
||||
pc.ClearError();
|
||||
pc.LockClearError();
|
||||
stop_on_error = true;
|
||||
error_count = 0;
|
||||
|
||||
@@ -210,7 +210,7 @@ playlist::SeekSongOrder(PlayerControl &pc, unsigned i, SongTime seek_time)
|
||||
queued_song = nullptr;
|
||||
}
|
||||
|
||||
if (!pc.Seek(new DetachedSong(queue.GetOrder(i)), seek_time)) {
|
||||
if (!pc.LockSeek(new DetachedSong(queue.GetOrder(i)), seek_time)) {
|
||||
UpdateQueuedSong(pc, queued_song);
|
||||
|
||||
return PlaylistResult::NOT_PLAYING;
|
||||
@@ -254,7 +254,7 @@ playlist::SeekCurrent(PlayerControl &pc,
|
||||
return PlaylistResult::NOT_PLAYING;
|
||||
|
||||
if (relative) {
|
||||
const auto status = pc.GetStatus();
|
||||
const auto status = pc.LockGetStatus();
|
||||
|
||||
if (status.state != PlayerState::PLAY &&
|
||||
status.state != PlayerState::PAUSE)
|
||||
|
@@ -252,7 +252,7 @@ playlist::DeleteInternal(PlayerControl &pc,
|
||||
else {
|
||||
/* stop the player */
|
||||
|
||||
pc.Stop();
|
||||
pc.LockStop();
|
||||
playing = false;
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ playlist::SetSongIdRange(PlayerControl &pc, unsigned id,
|
||||
/* if we're manipulating the "queued" song,
|
||||
the decoder thread may be decoding it
|
||||
already; cancel that */
|
||||
pc.Cancel();
|
||||
pc.LockCancel();
|
||||
queued = -1;
|
||||
}
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ void
|
||||
playlist_state_save(BufferedOutputStream &os, const struct playlist &playlist,
|
||||
PlayerControl &pc)
|
||||
{
|
||||
const auto player_status = pc.GetStatus();
|
||||
const auto player_status = pc.LockGetStatus();
|
||||
|
||||
os.Write(PLAYLIST_STATE_FILE_STATE);
|
||||
|
||||
@@ -191,7 +191,7 @@ playlist_state_restore(const char *line, TextFile &file,
|
||||
called here, after the audio output states were
|
||||
restored, before playback begins */
|
||||
if (state != PlayerState::STOP)
|
||||
pc.UpdateAudio();
|
||||
pc.LockUpdateAudio();
|
||||
|
||||
if (state == PlayerState::STOP /* && config_option */)
|
||||
playlist.current = current;
|
||||
@@ -201,7 +201,7 @@ playlist_state_restore(const char *line, TextFile &file,
|
||||
playlist.SeekSongPosition(pc, current, seek_time);
|
||||
|
||||
if (state == PlayerState::PAUSE)
|
||||
pc.Pause();
|
||||
pc.LockPause();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -211,7 +211,7 @@ unsigned
|
||||
playlist_state_get_hash(const playlist &playlist,
|
||||
PlayerControl &pc)
|
||||
{
|
||||
const auto player_status = pc.GetStatus();
|
||||
const auto player_status = pc.LockGetStatus();
|
||||
|
||||
return playlist.queue.version ^
|
||||
(player_status.state != PlayerState::STOP
|
||||
|
Reference in New Issue
Block a user