player_control: rename to PlayerControl

This commit is contained in:
Max Kellermann 2013-10-28 10:12:21 +01:00
parent e699f6781e
commit 5b5675cc12
22 changed files with 137 additions and 137 deletions

View File

@ -42,7 +42,7 @@ class Client final : private FullyBufferedSocket, TimeoutMonitor {
public:
Partition &partition;
struct playlist &playlist;
struct player_control &player_control;
struct PlayerControl &player_control;
unsigned permission;

View File

@ -103,7 +103,7 @@ audio_output_config_count(void)
}
void
audio_output_all_init(player_control &pc)
audio_output_all_init(PlayerControl &pc)
{
const struct config_param *param = nullptr;
unsigned int i;
@ -469,7 +469,7 @@ audio_output_all_check(void)
}
bool
audio_output_all_wait(player_control &pc, unsigned threshold)
audio_output_all_wait(PlayerControl &pc, unsigned threshold)
{
pc.Lock();

View File

@ -32,7 +32,7 @@
struct AudioFormat;
class MusicBuffer;
struct music_chunk;
struct player_control;
struct PlayerControl;
class Error;
/**
@ -40,7 +40,7 @@ class Error;
* file and initialize them.
*/
void
audio_output_all_init(player_control &pc);
audio_output_all_init(PlayerControl &pc);
/**
* Global finalization: free memory occupied by audio outputs. All
@ -135,7 +135,7 @@ audio_output_all_check(void);
* @return true if there are less than #threshold chunks in the pipe
*/
bool
audio_output_all_wait(player_control &pc, unsigned threshold);
audio_output_all_wait(PlayerControl &pc, unsigned threshold);
/**
* Puts all audio outputs into pause mode. Most implementations will

View File

@ -28,7 +28,6 @@ struct audio_output;
struct AudioFormat;
struct config_param;
class MusicPipe;
struct player_control;
void
audio_output_set_replay_gain_mode(struct audio_output *ao,

View File

@ -281,7 +281,7 @@ audio_output_setup(struct audio_output *ao, const config_param &param,
struct audio_output *
audio_output_new(const config_param &param,
player_control &pc,
PlayerControl &pc,
Error &error)
{
const struct audio_output_plugin *plugin;

View File

@ -32,6 +32,7 @@ class Error;
class Filter;
class MusicPipe;
struct config_param;
struct PlayerControl;
typedef struct _GTimer GTimer;
enum audio_output_command {
@ -225,10 +226,10 @@ struct audio_output {
Cond cond;
/**
* The player_control object which "owns" this output. This
* The PlayerControl object which "owns" this output. This
* object is needed to signal command completion.
*/
struct player_control *player_control;
PlayerControl *player_control;
/**
* The #music_chunk which is currently being played. All
@ -264,7 +265,7 @@ audio_output_command_is_finished(const struct audio_output *ao)
struct audio_output *
audio_output_new(const config_param &param,
player_control &pc,
PlayerControl &pc,
Error &error);
bool

View File

@ -34,7 +34,7 @@ struct Partition {
struct playlist playlist;
player_control pc;
PlayerControl pc;
Partition(Instance &_instance,
unsigned max_length,

View File

@ -27,8 +27,8 @@
#include <assert.h>
player_control::player_control(unsigned _buffer_chunks,
unsigned _buffered_before_play)
PlayerControl::PlayerControl(unsigned _buffer_chunks,
unsigned _buffered_before_play)
:buffer_chunks(_buffer_chunks),
buffered_before_play(_buffered_before_play),
command(PlayerCommand::NONE),
@ -50,7 +50,7 @@ player_control::player_control(unsigned _buffer_chunks,
{
}
player_control::~player_control()
PlayerControl::~PlayerControl()
{
if (next_song != nullptr)
next_song->Free();
@ -60,7 +60,7 @@ player_control::~player_control()
}
void
player_control::Play(Song *song)
PlayerControl::Play(Song *song)
{
assert(song != nullptr);
@ -79,14 +79,14 @@ player_control::Play(Song *song)
}
void
player_control::Cancel()
PlayerControl::Cancel()
{
LockSynchronousCommand(PlayerCommand::CANCEL);
assert(next_song == nullptr);
}
void
player_control::Stop()
PlayerControl::Stop()
{
LockSynchronousCommand(PlayerCommand::CLOSE_AUDIO);
assert(next_song == nullptr);
@ -95,13 +95,13 @@ player_control::Stop()
}
void
player_control::UpdateAudio()
PlayerControl::UpdateAudio()
{
LockSynchronousCommand(PlayerCommand::UPDATE_AUDIO);
}
void
player_control::Kill()
PlayerControl::Kill()
{
assert(thread.IsDefined());
@ -112,7 +112,7 @@ player_control::Kill()
}
void
player_control::PauseLocked()
PlayerControl::PauseLocked()
{
if (state != PlayerState::STOP) {
SynchronousCommand(PlayerCommand::PAUSE);
@ -121,7 +121,7 @@ player_control::PauseLocked()
}
void
player_control::Pause()
PlayerControl::Pause()
{
Lock();
PauseLocked();
@ -129,7 +129,7 @@ player_control::Pause()
}
void
player_control::SetPause(bool pause_flag)
PlayerControl::SetPause(bool pause_flag)
{
Lock();
@ -152,7 +152,7 @@ player_control::SetPause(bool pause_flag)
}
void
player_control::SetBorderPause(bool _border_pause)
PlayerControl::SetBorderPause(bool _border_pause)
{
Lock();
border_pause = _border_pause;
@ -160,7 +160,7 @@ player_control::SetBorderPause(bool _border_pause)
}
player_status
player_control::GetStatus()
PlayerControl::GetStatus()
{
player_status status;
@ -182,7 +182,7 @@ player_control::GetStatus()
}
void
player_control::SetError(PlayerError type, Error &&_error)
PlayerControl::SetError(PlayerError type, Error &&_error)
{
assert(type != PlayerError::NONE);
assert(_error.IsDefined());
@ -192,7 +192,7 @@ player_control::SetError(PlayerError type, Error &&_error)
}
void
player_control::ClearError()
PlayerControl::ClearError()
{
Lock();
@ -205,7 +205,7 @@ player_control::ClearError()
}
void
player_control::LockSetTaggedSong(const Song &song)
PlayerControl::LockSetTaggedSong(const Song &song)
{
Lock();
if (tagged_song != nullptr)
@ -215,7 +215,7 @@ player_control::LockSetTaggedSong(const Song &song)
}
void
player_control::ClearTaggedSong()
PlayerControl::ClearTaggedSong()
{
if (tagged_song != nullptr) {
tagged_song->Free();
@ -224,7 +224,7 @@ player_control::ClearTaggedSong()
}
void
player_control::EnqueueSong(Song *song)
PlayerControl::EnqueueSong(Song *song)
{
assert(song != nullptr);
@ -234,7 +234,7 @@ player_control::EnqueueSong(Song *song)
}
bool
player_control::Seek(Song *song, float seek_time)
PlayerControl::Seek(Song *song, float seek_time)
{
assert(song != nullptr);
@ -256,7 +256,7 @@ player_control::Seek(Song *song, float seek_time)
}
void
player_control::SetCrossFade(float _cross_fade_seconds)
PlayerControl::SetCrossFade(float _cross_fade_seconds)
{
if (_cross_fade_seconds < 0)
_cross_fade_seconds = 0;
@ -266,7 +266,7 @@ player_control::SetCrossFade(float _cross_fade_seconds)
}
void
player_control::SetMixRampDb(float _mixramp_db)
PlayerControl::SetMixRampDb(float _mixramp_db)
{
mixramp_db = _mixramp_db;
@ -274,7 +274,7 @@ player_control::SetMixRampDb(float _mixramp_db)
}
void
player_control::SetMixRampDelay(float _mixramp_delay_seconds)
PlayerControl::SetMixRampDelay(float _mixramp_delay_seconds)
{
mixramp_delay_seconds = _mixramp_delay_seconds;

View File

@ -50,18 +50,18 @@ enum class PlayerCommand : uint8_t {
*/
UPDATE_AUDIO,
/** player_control.next_song has been updated */
/** PlayerControl.next_song has been updated */
QUEUE,
/**
* cancel pre-decoding player_control.next_song; if the player
* cancel pre-decoding PlayerControl.next_song; if the player
* has already started playing this song, it will completely
* stop
*/
CANCEL,
/**
* Refresh status information in the #player_control struct,
* Refresh status information in the #PlayerControl struct,
* e.g. elapsed_time.
*/
REFRESH,
@ -89,7 +89,7 @@ struct player_status {
float elapsed_time;
};
struct player_control {
struct PlayerControl {
unsigned buffer_chunks;
unsigned int buffered_before_play;
@ -169,9 +169,9 @@ struct player_control {
*/
bool border_pause;
player_control(unsigned buffer_chunks,
unsigned buffered_before_play);
~player_control();
PlayerControl(unsigned buffer_chunks,
unsigned buffered_before_play);
~PlayerControl();
/**
* Locks the object.

View File

@ -51,7 +51,7 @@ enum class CrossFadeState : int8_t {
};
class Player {
player_control &pc;
PlayerControl &pc;
DecoderControl &dc;
@ -130,7 +130,7 @@ class Player {
float elapsed_time;
public:
Player(player_control &_pc, DecoderControl &_dc,
Player(PlayerControl &_pc, DecoderControl &_dc,
MusicBuffer &_buffer)
:pc(_pc), dc(_dc), buffer(_buffer),
buffering(false),
@ -275,7 +275,7 @@ public:
};
static void
player_command_finished(player_control &pc)
player_command_finished(PlayerControl &pc)
{
pc.Lock();
pc.CommandFinished();
@ -349,7 +349,7 @@ Player::WaitForDecoder()
pc.Lock();
/* update player_control's song information */
/* update PlayerControl's song information */
pc.total_time = pc.next_song->GetDuration();
pc.bit_rate = 0;
pc.audio_format.Clear();
@ -686,7 +686,7 @@ Player::ProcessCommand()
}
static void
update_song_tag(player_control &pc, Song *song, const Tag &new_tag)
update_song_tag(PlayerControl &pc, Song *song, const Tag &new_tag)
{
if (song->IsFile())
/* don't update tags of local files, only remote
@ -717,7 +717,7 @@ update_song_tag(player_control &pc, Song *song, const Tag &new_tag)
* Player lock is not held.
*/
static bool
play_chunk(player_control &pc,
play_chunk(PlayerControl &pc,
Song *song, struct music_chunk *chunk,
MusicBuffer &buffer,
const AudioFormat format,
@ -1095,7 +1095,7 @@ Player::Run()
}
static void
do_play(player_control &pc, DecoderControl &dc,
do_play(PlayerControl &pc, DecoderControl &dc,
MusicBuffer &buffer)
{
Player player(pc, dc, buffer);
@ -1105,7 +1105,7 @@ do_play(player_control &pc, DecoderControl &dc,
static void
player_task(void *arg)
{
player_control &pc = *(player_control *)arg;
PlayerControl &pc = *(PlayerControl *)arg;
DecoderControl dc;
decoder_thread_start(dc);
@ -1193,7 +1193,7 @@ player_task(void *arg)
}
void
player_create(player_control &pc)
player_create(PlayerControl &pc)
{
assert(!pc.thread.IsDefined());

View File

@ -26,7 +26,7 @@
* audio outputs via audio_output_all_play().
*
* It is controlled by the main thread (the playlist code), see
* player_control.h. The playlist enqueues new songs into the player
* PlayerControl.hxx. The playlist enqueues new songs into the player
* thread and sends it commands.
*
* The player thread itself does not do any I/O. It synchronizes with
@ -37,9 +37,9 @@
#ifndef MPD_PLAYER_THREAD_HXX
#define MPD_PLAYER_THREAD_HXX
struct player_control;
struct PlayerControl;
void
player_create(player_control &pc);
player_create(PlayerControl &pc);
#endif

View File

@ -49,7 +49,7 @@ playlist::TagModified(Song &&song)
* Queue a song, addressed by its order number.
*/
static void
playlist_queue_song_order(playlist &playlist, player_control &pc,
playlist_queue_song_order(playlist &playlist, PlayerControl &pc,
unsigned order)
{
assert(playlist.queue.IsValidOrder(order));
@ -71,7 +71,7 @@ playlist_queue_song_order(playlist &playlist, player_control &pc,
* Called if the player thread has started playing the "queued" song.
*/
static void
playlist_song_started(playlist &playlist, player_control &pc)
playlist_song_started(playlist &playlist, PlayerControl &pc)
{
assert(pc.next_song == nullptr);
assert(playlist.queued >= -1);
@ -98,7 +98,7 @@ playlist::GetQueuedSong() const
}
void
playlist::UpdateQueuedSong(player_control &pc, const Song *prev)
playlist::UpdateQueuedSong(PlayerControl &pc, const Song *prev)
{
if (!playing)
return;
@ -144,7 +144,7 @@ playlist::UpdateQueuedSong(player_control &pc, const Song *prev)
}
void
playlist::PlayOrder(player_control &pc, int order)
playlist::PlayOrder(PlayerControl &pc, int order)
{
playing = true;
queued = -1;
@ -162,10 +162,10 @@ playlist::PlayOrder(player_control &pc, int order)
}
static void
playlist_resume_playback(playlist &playlist, player_control &pc);
playlist_resume_playback(playlist &playlist, PlayerControl &pc);
void
playlist::SyncWithPlayer(player_control &pc)
playlist::SyncWithPlayer(PlayerControl &pc)
{
if (!playing)
/* this event has reached us out of sync: we aren't
@ -205,7 +205,7 @@ playlist::SyncWithPlayer(player_control &pc)
* decide whether to re-start playback
*/
static void
playlist_resume_playback(playlist &playlist, player_control &pc)
playlist_resume_playback(playlist &playlist, PlayerControl &pc)
{
assert(playlist.playing);
assert(pc.GetState() == PlayerState::STOP);
@ -228,7 +228,7 @@ playlist_resume_playback(playlist &playlist, player_control &pc)
}
void
playlist::SetRepeat(player_control &pc, bool status)
playlist::SetRepeat(PlayerControl &pc, bool status)
{
if (status == queue.repeat)
return;
@ -255,7 +255,7 @@ playlist_order(playlist &playlist)
}
void
playlist::SetSingle(player_control &pc, bool status)
playlist::SetSingle(PlayerControl &pc, bool status)
{
if (status == queue.single)
return;
@ -282,7 +282,7 @@ playlist::SetConsume(bool status)
}
void
playlist::SetRandom(player_control &pc, bool status)
playlist::SetRandom(PlayerControl &pc, bool status)
{
if (status == queue.random)
return;

View File

@ -23,7 +23,7 @@
#include "Queue.hxx"
#include "PlaylistError.hxx"
struct player_control;
struct PlayerControl;
struct Song;
struct playlist {
@ -105,7 +105,7 @@ struct playlist {
* player thread whenever it requests a new queued song, or
* when it exits.
*/
void SyncWithPlayer(player_control &pc);
void SyncWithPlayer(PlayerControl &pc);
protected:
/**
@ -123,10 +123,10 @@ protected:
* @param prev the song which was previously queued, as
* determined by playlist_get_queued_song()
*/
void UpdateQueuedSong(player_control &pc, const Song *prev);
void UpdateQueuedSong(PlayerControl &pc, const Song *prev);
public:
void Clear(player_control &pc);
void Clear(PlayerControl &pc);
/**
* A tag in the play queue has been modified by the player
@ -140,7 +140,7 @@ public:
*/
void DatabaseModified();
PlaylistResult AppendSong(player_control &pc,
PlaylistResult AppendSong(PlayerControl &pc,
Song *song,
unsigned *added_id=nullptr);
@ -150,28 +150,28 @@ public:
*
* Note: the caller is responsible for checking permissions.
*/
PlaylistResult AppendFile(player_control &pc,
PlaylistResult AppendFile(PlayerControl &pc,
const char *path_utf8,
unsigned *added_id=nullptr);
PlaylistResult AppendURI(player_control &pc,
PlaylistResult AppendURI(PlayerControl &pc,
const char *uri_utf8,
unsigned *added_id=nullptr);
protected:
void DeleteInternal(player_control &pc,
void DeleteInternal(PlayerControl &pc,
unsigned song, const Song **queued_p);
public:
PlaylistResult DeletePosition(player_control &pc,
PlaylistResult DeletePosition(PlayerControl &pc,
unsigned position);
PlaylistResult DeleteOrder(player_control &pc,
PlaylistResult DeleteOrder(PlayerControl &pc,
unsigned order) {
return DeletePosition(pc, queue.OrderToPosition(order));
}
PlaylistResult DeleteId(player_control &pc, unsigned id);
PlaylistResult DeleteId(PlayerControl &pc, unsigned id);
/**
* Deletes a range of songs from the playlist.
@ -179,49 +179,49 @@ public:
* @param start the position of the first song to delete
* @param end the position after the last song to delete
*/
PlaylistResult DeleteRange(player_control &pc,
PlaylistResult DeleteRange(PlayerControl &pc,
unsigned start, unsigned end);
void DeleteSong(player_control &pc, const Song &song);
void DeleteSong(PlayerControl &pc, const Song &song);
void Shuffle(player_control &pc, unsigned start, unsigned end);
void Shuffle(PlayerControl &pc, unsigned start, unsigned end);
PlaylistResult MoveRange(player_control &pc,
PlaylistResult MoveRange(PlayerControl &pc,
unsigned start, unsigned end, int to);
PlaylistResult MoveId(player_control &pc, unsigned id, int to);
PlaylistResult MoveId(PlayerControl &pc, unsigned id, int to);
PlaylistResult SwapPositions(player_control &pc,
PlaylistResult SwapPositions(PlayerControl &pc,
unsigned song1, unsigned song2);
PlaylistResult SwapIds(player_control &pc,
PlaylistResult SwapIds(PlayerControl &pc,
unsigned id1, unsigned id2);
PlaylistResult SetPriorityRange(player_control &pc,
PlaylistResult SetPriorityRange(PlayerControl &pc,
unsigned start_position,
unsigned end_position,
uint8_t priority);
PlaylistResult SetPriorityId(player_control &pc,
PlaylistResult SetPriorityId(PlayerControl &pc,
unsigned song_id, uint8_t priority);
void Stop(player_control &pc);
void Stop(PlayerControl &pc);
PlaylistResult PlayPosition(player_control &pc, int position);
PlaylistResult PlayPosition(PlayerControl &pc, int position);
void PlayOrder(player_control &pc, int order);
void PlayOrder(PlayerControl &pc, int order);
PlaylistResult PlayId(player_control &pc, int id);
PlaylistResult PlayId(PlayerControl &pc, int id);
void PlayNext(player_control &pc);
void PlayNext(PlayerControl &pc);
void PlayPrevious(player_control &pc);
void PlayPrevious(PlayerControl &pc);
PlaylistResult SeekSongPosition(player_control &pc,
PlaylistResult SeekSongPosition(PlayerControl &pc,
unsigned song_position,
float seek_time);
PlaylistResult SeekSongId(player_control &pc,
PlaylistResult SeekSongId(PlayerControl &pc,
unsigned song_id, float seek_time);
/**
@ -232,26 +232,26 @@ public:
* @param relative if true, then the specified time is relative to the
* current position
*/
PlaylistResult SeekCurrent(player_control &pc,
PlaylistResult SeekCurrent(PlayerControl &pc,
float seek_time, bool relative);
bool GetRepeat() const {
return queue.repeat;
}
void SetRepeat(player_control &pc, bool new_value);
void SetRepeat(PlayerControl &pc, bool new_value);
bool GetRandom() const {
return queue.random;
}
void SetRandom(player_control &pc, bool new_value);
void SetRandom(PlayerControl &pc, bool new_value);
bool GetSingle() const {
return queue.single;
}
void SetSingle(player_control &pc, bool new_value);
void SetSingle(PlayerControl &pc, bool new_value);
bool GetConsume() const {
return queue.consume;

View File

@ -30,7 +30,7 @@
#include "Log.hxx"
void
playlist::Stop(player_control &pc)
playlist::Stop(PlayerControl &pc)
{
if (!playing)
return;
@ -57,7 +57,7 @@ playlist::Stop(player_control &pc)
}
PlaylistResult
playlist::PlayPosition(player_control &pc, int song)
playlist::PlayPosition(PlayerControl &pc, int song)
{
pc.ClearError();
@ -107,7 +107,7 @@ playlist::PlayPosition(player_control &pc, int song)
}
PlaylistResult
playlist::PlayId(player_control &pc, int id)
playlist::PlayId(PlayerControl &pc, int id)
{
if (id == -1)
return PlayPosition(pc, id);
@ -120,7 +120,7 @@ playlist::PlayId(player_control &pc, int id)
}
void
playlist::PlayNext(player_control &pc)
playlist::PlayNext(PlayerControl &pc)
{
if (!playing)
return;
@ -166,7 +166,7 @@ playlist::PlayNext(player_control &pc)
}
void
playlist::PlayPrevious(player_control &pc)
playlist::PlayPrevious(PlayerControl &pc)
{
if (!playing)
return;
@ -190,7 +190,7 @@ playlist::PlayPrevious(player_control &pc)
}
PlaylistResult
playlist::SeekSongPosition(player_control &pc, unsigned song, float seek_time)
playlist::SeekSongPosition(PlayerControl &pc, unsigned song, float seek_time)
{
if (!queue.IsValidPosition(song))
return PlaylistResult::BAD_RANGE;
@ -229,7 +229,7 @@ playlist::SeekSongPosition(player_control &pc, unsigned song, float seek_time)
}
PlaylistResult
playlist::SeekSongId(player_control &pc, unsigned id, float seek_time)
playlist::SeekSongId(PlayerControl &pc, unsigned id, float seek_time)
{
int song = queue.IdToPosition(id);
if (song < 0)
@ -239,7 +239,7 @@ playlist::SeekSongId(player_control &pc, unsigned id, float seek_time)
}
PlaylistResult
playlist::SeekCurrent(player_control &pc, float seek_time, bool relative)
playlist::SeekCurrent(PlayerControl &pc, float seek_time, bool relative)
{
if (!playing)
return PlaylistResult::NOT_PLAYING;

View File

@ -46,7 +46,7 @@ playlist::OnModified()
}
void
playlist::Clear(player_control &pc)
playlist::Clear(PlayerControl &pc)
{
Stop(pc);
@ -57,7 +57,7 @@ playlist::Clear(player_control &pc)
}
PlaylistResult
playlist::AppendFile(struct player_control &pc,
playlist::AppendFile(PlayerControl &pc,
const char *path_utf8, unsigned *added_id)
{
Song *song = Song::LoadFile(path_utf8, nullptr);
@ -70,7 +70,7 @@ playlist::AppendFile(struct player_control &pc,
}
PlaylistResult
playlist::AppendSong(struct player_control &pc,
playlist::AppendSong(PlayerControl &pc,
Song *song, unsigned *added_id)
{
unsigned id;
@ -105,7 +105,7 @@ playlist::AppendSong(struct player_control &pc,
}
PlaylistResult
playlist::AppendURI(struct player_control &pc,
playlist::AppendURI(PlayerControl &pc,
const char *uri, unsigned *added_id)
{
FormatDebug(playlist_domain, "add to playlist: %s", uri);
@ -134,7 +134,7 @@ playlist::AppendURI(struct player_control &pc,
}
PlaylistResult
playlist::SwapPositions(player_control &pc, unsigned song1, unsigned song2)
playlist::SwapPositions(PlayerControl &pc, unsigned song1, unsigned song2)
{
if (!queue.IsValidPosition(song1) || !queue.IsValidPosition(song2))
return PlaylistResult::BAD_RANGE;
@ -165,7 +165,7 @@ playlist::SwapPositions(player_control &pc, unsigned song1, unsigned song2)
}
PlaylistResult
playlist::SwapIds(player_control &pc, unsigned id1, unsigned id2)
playlist::SwapIds(PlayerControl &pc, unsigned id1, unsigned id2)
{
int song1 = queue.IdToPosition(id1);
int song2 = queue.IdToPosition(id2);
@ -177,7 +177,7 @@ playlist::SwapIds(player_control &pc, unsigned id1, unsigned id2)
}
PlaylistResult
playlist::SetPriorityRange(player_control &pc,
playlist::SetPriorityRange(PlayerControl &pc,
unsigned start, unsigned end,
uint8_t priority)
{
@ -211,7 +211,7 @@ playlist::SetPriorityRange(player_control &pc,
}
PlaylistResult
playlist::SetPriorityId(struct player_control &pc,
playlist::SetPriorityId(PlayerControl &pc,
unsigned song_id, uint8_t priority)
{
int song_position = queue.IdToPosition(song_id);
@ -224,7 +224,7 @@ playlist::SetPriorityId(struct player_control &pc,
}
void
playlist::DeleteInternal(player_control &pc,
playlist::DeleteInternal(PlayerControl &pc,
unsigned song, const Song **queued_p)
{
assert(song < GetLength());
@ -270,7 +270,7 @@ playlist::DeleteInternal(player_control &pc,
}
PlaylistResult
playlist::DeletePosition(struct player_control &pc, unsigned song)
playlist::DeletePosition(PlayerControl &pc, unsigned song)
{
if (song >= queue.GetLength())
return PlaylistResult::BAD_RANGE;
@ -286,7 +286,7 @@ playlist::DeletePosition(struct player_control &pc, unsigned song)
}
PlaylistResult
playlist::DeleteRange(struct player_control &pc, unsigned start, unsigned end)
playlist::DeleteRange(PlayerControl &pc, unsigned start, unsigned end)
{
if (start >= queue.GetLength())
return PlaylistResult::BAD_RANGE;
@ -310,7 +310,7 @@ playlist::DeleteRange(struct player_control &pc, unsigned start, unsigned end)
}
PlaylistResult
playlist::DeleteId(struct player_control &pc, unsigned id)
playlist::DeleteId(PlayerControl &pc, unsigned id)
{
int song = queue.IdToPosition(id);
if (song < 0)
@ -320,7 +320,7 @@ playlist::DeleteId(struct player_control &pc, unsigned id)
}
void
playlist::DeleteSong(struct player_control &pc, const struct Song &song)
playlist::DeleteSong(PlayerControl &pc, const struct Song &song)
{
for (int i = queue.GetLength() - 1; i >= 0; --i)
if (SongEquals(song, queue.Get(i)))
@ -328,7 +328,7 @@ playlist::DeleteSong(struct player_control &pc, const struct Song &song)
}
PlaylistResult
playlist::MoveRange(player_control &pc, unsigned start, unsigned end, int to)
playlist::MoveRange(PlayerControl &pc, unsigned start, unsigned end, int to)
{
if (!queue.IsValidPosition(start) || !queue.IsValidPosition(end - 1))
return PlaylistResult::BAD_RANGE;
@ -381,7 +381,7 @@ playlist::MoveRange(player_control &pc, unsigned start, unsigned end, int to)
}
PlaylistResult
playlist::MoveId(player_control &pc, unsigned id1, int to)
playlist::MoveId(PlayerControl &pc, unsigned id1, int to)
{
int song = queue.IdToPosition(id1);
if (song < 0)
@ -391,7 +391,7 @@ playlist::MoveId(player_control &pc, unsigned id1, int to)
}
void
playlist::Shuffle(player_control &pc, unsigned start, unsigned end)
playlist::Shuffle(PlayerControl &pc, unsigned start, unsigned end)
{
if (end > GetLength())
/* correct the "end" offset */

View File

@ -32,7 +32,7 @@
PlaylistResult
playlist_load_into_queue(const char *uri, SongEnumerator &e,
unsigned start_index, unsigned end_index,
playlist &dest, player_control &pc,
playlist &dest, PlayerControl &pc,
bool secure)
{
const std::string base_uri = uri != nullptr
@ -66,7 +66,7 @@ playlist_load_into_queue(const char *uri, SongEnumerator &e,
PlaylistResult
playlist_open_into_queue(const char *uri,
unsigned start_index, unsigned end_index,
playlist &dest, player_control &pc,
playlist &dest, PlayerControl &pc,
bool secure)
{
Mutex mutex;

View File

@ -28,7 +28,7 @@
class SongEnumerator;
struct playlist;
struct player_control;
struct PlayerControl;
/**
* Loads the contents of a playlist and append it to the specified
@ -42,7 +42,7 @@ struct player_control;
PlaylistResult
playlist_load_into_queue(const char *uri, SongEnumerator &e,
unsigned start_index, unsigned end_index,
playlist &dest, player_control &pc,
playlist &dest, PlayerControl &pc,
bool secure);
/**
@ -52,7 +52,7 @@ playlist_load_into_queue(const char *uri, SongEnumerator &e,
PlaylistResult
playlist_open_into_queue(const char *uri,
unsigned start_index, unsigned end_index,
playlist &dest, player_control &pc,
playlist &dest, PlayerControl &pc,
bool secure);
#endif

View File

@ -101,7 +101,7 @@ spl_save_playlist(const char *name_utf8, const playlist &playlist)
}
bool
playlist_load_spl(struct playlist &playlist, player_control &pc,
playlist_load_spl(struct playlist &playlist, PlayerControl &pc,
const char *name_utf8,
unsigned start_index, unsigned end_index,
Error &error)

View File

@ -27,7 +27,7 @@
struct Song;
struct queue;
struct playlist;
struct player_control;
struct PlayerControl;
class Error;
void
@ -53,7 +53,7 @@ spl_save_playlist(const char *name_utf8, const playlist &playlist);
* playlist.
*/
bool
playlist_load_spl(struct playlist &playlist, player_control &pc,
playlist_load_spl(struct playlist &playlist, PlayerControl &pc,
const char *name_utf8,
unsigned start_index, unsigned end_index,
Error &error);

View File

@ -60,7 +60,7 @@
void
playlist_state_save(FILE *fp, const struct playlist &playlist,
player_control &pc)
PlayerControl &pc)
{
const auto player_status = pc.GetStatus();
@ -128,7 +128,7 @@ playlist_state_load(TextFile &file, struct playlist &playlist)
bool
playlist_state_restore(const char *line, TextFile &file,
struct playlist &playlist, player_control &pc)
struct playlist &playlist, PlayerControl &pc)
{
int current = -1;
int seek_time = 0;
@ -217,7 +217,7 @@ playlist_state_restore(const char *line, TextFile &file,
unsigned
playlist_state_get_hash(const playlist &playlist,
player_control &pc)
PlayerControl &pc)
{
const auto player_status = pc.GetStatus();

View File

@ -28,16 +28,16 @@
#include <stdio.h>
struct playlist;
struct player_control;
struct PlayerControl;
class TextFile;
void
playlist_state_save(FILE *fp, const struct playlist &playlist,
player_control &pc);
PlayerControl &pc);
bool
playlist_state_restore(const char *line, TextFile &file,
struct playlist &playlist, player_control &pc);
struct playlist &playlist, PlayerControl &pc);
/**
* Generates a hash number for the current state of the playlist and
@ -47,6 +47,6 @@ playlist_state_restore(const char *line, TextFile &file,
*/
unsigned
playlist_state_get_hash(const struct playlist &playlist,
player_control &c);
PlayerControl &c);
#endif

View File

@ -72,9 +72,9 @@ find_named_config_block(ConfigOption option, const char *name)
return NULL;
}
player_control::player_control(gcc_unused unsigned _buffer_chunks,
PlayerControl::PlayerControl(gcc_unused unsigned _buffer_chunks,
gcc_unused unsigned _buffered_before_play) {}
player_control::~player_control() {}
PlayerControl::~PlayerControl() {}
static struct audio_output *
load_audio_output(const char *name)
@ -87,7 +87,7 @@ load_audio_output(const char *name)
return nullptr;
}
static struct player_control dummy_player_control(32, 4);
static struct PlayerControl dummy_player_control(32, 4);
Error error;
struct audio_output *ao =