Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
5b5675cc
Commit
5b5675cc
authored
Oct 28, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player_control: rename to PlayerControl
parent
e699f678
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
137 additions
and
137 deletions
+137
-137
Client.hxx
src/Client.hxx
+1
-1
OutputAll.cxx
src/OutputAll.cxx
+2
-2
OutputAll.hxx
src/OutputAll.hxx
+3
-3
OutputControl.hxx
src/OutputControl.hxx
+0
-1
OutputInit.cxx
src/OutputInit.cxx
+1
-1
OutputInternal.hxx
src/OutputInternal.hxx
+4
-3
Partition.hxx
src/Partition.hxx
+1
-1
PlayerControl.cxx
src/PlayerControl.cxx
+22
-22
PlayerControl.hxx
src/PlayerControl.hxx
+7
-7
PlayerThread.cxx
src/PlayerThread.cxx
+9
-9
PlayerThread.hxx
src/PlayerThread.hxx
+3
-3
Playlist.cxx
src/Playlist.cxx
+10
-10
Playlist.hxx
src/Playlist.hxx
+32
-32
PlaylistControl.cxx
src/PlaylistControl.cxx
+8
-8
PlaylistEdit.cxx
src/PlaylistEdit.cxx
+16
-16
PlaylistQueue.cxx
src/PlaylistQueue.cxx
+2
-2
PlaylistQueue.hxx
src/PlaylistQueue.hxx
+3
-3
PlaylistSave.cxx
src/PlaylistSave.cxx
+1
-1
PlaylistSave.hxx
src/PlaylistSave.hxx
+2
-2
PlaylistState.cxx
src/PlaylistState.cxx
+3
-3
PlaylistState.hxx
src/PlaylistState.hxx
+4
-4
run_output.cxx
test/run_output.cxx
+3
-3
No files found.
src/Client.hxx
View file @
5b5675cc
...
@@ -42,7 +42,7 @@ class Client final : private FullyBufferedSocket, TimeoutMonitor {
...
@@ -42,7 +42,7 @@ class Client final : private FullyBufferedSocket, TimeoutMonitor {
public
:
public
:
Partition
&
partition
;
Partition
&
partition
;
struct
playlist
&
playlist
;
struct
playlist
&
playlist
;
struct
player_c
ontrol
&
player_control
;
struct
PlayerC
ontrol
&
player_control
;
unsigned
permission
;
unsigned
permission
;
...
...
src/OutputAll.cxx
View file @
5b5675cc
...
@@ -103,7 +103,7 @@ audio_output_config_count(void)
...
@@ -103,7 +103,7 @@ audio_output_config_count(void)
}
}
void
void
audio_output_all_init
(
player_c
ontrol
&
pc
)
audio_output_all_init
(
PlayerC
ontrol
&
pc
)
{
{
const
struct
config_param
*
param
=
nullptr
;
const
struct
config_param
*
param
=
nullptr
;
unsigned
int
i
;
unsigned
int
i
;
...
@@ -469,7 +469,7 @@ audio_output_all_check(void)
...
@@ -469,7 +469,7 @@ audio_output_all_check(void)
}
}
bool
bool
audio_output_all_wait
(
player_c
ontrol
&
pc
,
unsigned
threshold
)
audio_output_all_wait
(
PlayerC
ontrol
&
pc
,
unsigned
threshold
)
{
{
pc
.
Lock
();
pc
.
Lock
();
...
...
src/OutputAll.hxx
View file @
5b5675cc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
struct
AudioFormat
;
struct
AudioFormat
;
class
MusicBuffer
;
class
MusicBuffer
;
struct
music_chunk
;
struct
music_chunk
;
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
class
Error
;
class
Error
;
/**
/**
...
@@ -40,7 +40,7 @@ class Error;
...
@@ -40,7 +40,7 @@ class Error;
* file and initialize them.
* file and initialize them.
*/
*/
void
void
audio_output_all_init
(
player_c
ontrol
&
pc
);
audio_output_all_init
(
PlayerC
ontrol
&
pc
);
/**
/**
* Global finalization: free memory occupied by audio outputs. All
* Global finalization: free memory occupied by audio outputs. All
...
@@ -135,7 +135,7 @@ audio_output_all_check(void);
...
@@ -135,7 +135,7 @@ audio_output_all_check(void);
* @return true if there are less than #threshold chunks in the pipe
* @return true if there are less than #threshold chunks in the pipe
*/
*/
bool
bool
audio_output_all_wait
(
player_c
ontrol
&
pc
,
unsigned
threshold
);
audio_output_all_wait
(
PlayerC
ontrol
&
pc
,
unsigned
threshold
);
/**
/**
* Puts all audio outputs into pause mode. Most implementations will
* Puts all audio outputs into pause mode. Most implementations will
...
...
src/OutputControl.hxx
View file @
5b5675cc
...
@@ -28,7 +28,6 @@ struct audio_output;
...
@@ -28,7 +28,6 @@ struct audio_output;
struct
AudioFormat
;
struct
AudioFormat
;
struct
config_param
;
struct
config_param
;
class
MusicPipe
;
class
MusicPipe
;
struct
player_control
;
void
void
audio_output_set_replay_gain_mode
(
struct
audio_output
*
ao
,
audio_output_set_replay_gain_mode
(
struct
audio_output
*
ao
,
...
...
src/OutputInit.cxx
View file @
5b5675cc
...
@@ -281,7 +281,7 @@ audio_output_setup(struct audio_output *ao, const config_param ¶m,
...
@@ -281,7 +281,7 @@ audio_output_setup(struct audio_output *ao, const config_param ¶m,
struct
audio_output
*
struct
audio_output
*
audio_output_new
(
const
config_param
&
param
,
audio_output_new
(
const
config_param
&
param
,
player_c
ontrol
&
pc
,
PlayerC
ontrol
&
pc
,
Error
&
error
)
Error
&
error
)
{
{
const
struct
audio_output_plugin
*
plugin
;
const
struct
audio_output_plugin
*
plugin
;
...
...
src/OutputInternal.hxx
View file @
5b5675cc
...
@@ -32,6 +32,7 @@ class Error;
...
@@ -32,6 +32,7 @@ class Error;
class
Filter
;
class
Filter
;
class
MusicPipe
;
class
MusicPipe
;
struct
config_param
;
struct
config_param
;
struct
PlayerControl
;
typedef
struct
_GTimer
GTimer
;
typedef
struct
_GTimer
GTimer
;
enum
audio_output_command
{
enum
audio_output_command
{
...
@@ -225,10 +226,10 @@ struct audio_output {
...
@@ -225,10 +226,10 @@ struct audio_output {
Cond
cond
;
Cond
cond
;
/**
/**
* The
player_c
ontrol object which "owns" this output. This
* The
PlayerC
ontrol object which "owns" this output. This
* object is needed to signal command completion.
* object is needed to signal command completion.
*/
*/
struct
player_c
ontrol
*
player_control
;
PlayerC
ontrol
*
player_control
;
/**
/**
* The #music_chunk which is currently being played. All
* The #music_chunk which is currently being played. All
...
@@ -264,7 +265,7 @@ audio_output_command_is_finished(const struct audio_output *ao)
...
@@ -264,7 +265,7 @@ audio_output_command_is_finished(const struct audio_output *ao)
struct
audio_output
*
struct
audio_output
*
audio_output_new
(
const
config_param
&
param
,
audio_output_new
(
const
config_param
&
param
,
player_c
ontrol
&
pc
,
PlayerC
ontrol
&
pc
,
Error
&
error
);
Error
&
error
);
bool
bool
...
...
src/Partition.hxx
View file @
5b5675cc
...
@@ -34,7 +34,7 @@ struct Partition {
...
@@ -34,7 +34,7 @@ struct Partition {
struct
playlist
playlist
;
struct
playlist
playlist
;
player_c
ontrol
pc
;
PlayerC
ontrol
pc
;
Partition
(
Instance
&
_instance
,
Partition
(
Instance
&
_instance
,
unsigned
max_length
,
unsigned
max_length
,
...
...
src/PlayerControl.cxx
View file @
5b5675cc
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
#include <assert.h>
#include <assert.h>
player_control
::
player_c
ontrol
(
unsigned
_buffer_chunks
,
PlayerControl
::
PlayerC
ontrol
(
unsigned
_buffer_chunks
,
unsigned
_buffered_before_play
)
unsigned
_buffered_before_play
)
:
buffer_chunks
(
_buffer_chunks
),
:
buffer_chunks
(
_buffer_chunks
),
buffered_before_play
(
_buffered_before_play
),
buffered_before_play
(
_buffered_before_play
),
command
(
PlayerCommand
::
NONE
),
command
(
PlayerCommand
::
NONE
),
...
@@ -50,7 +50,7 @@ player_control::player_control(unsigned _buffer_chunks,
...
@@ -50,7 +50,7 @@ player_control::player_control(unsigned _buffer_chunks,
{
{
}
}
player_control
::~
player_c
ontrol
()
PlayerControl
::~
PlayerC
ontrol
()
{
{
if
(
next_song
!=
nullptr
)
if
(
next_song
!=
nullptr
)
next_song
->
Free
();
next_song
->
Free
();
...
@@ -60,7 +60,7 @@ player_control::~player_control()
...
@@ -60,7 +60,7 @@ player_control::~player_control()
}
}
void
void
player_c
ontrol
::
Play
(
Song
*
song
)
PlayerC
ontrol
::
Play
(
Song
*
song
)
{
{
assert
(
song
!=
nullptr
);
assert
(
song
!=
nullptr
);
...
@@ -79,14 +79,14 @@ player_control::Play(Song *song)
...
@@ -79,14 +79,14 @@ player_control::Play(Song *song)
}
}
void
void
player_c
ontrol
::
Cancel
()
PlayerC
ontrol
::
Cancel
()
{
{
LockSynchronousCommand
(
PlayerCommand
::
CANCEL
);
LockSynchronousCommand
(
PlayerCommand
::
CANCEL
);
assert
(
next_song
==
nullptr
);
assert
(
next_song
==
nullptr
);
}
}
void
void
player_c
ontrol
::
Stop
()
PlayerC
ontrol
::
Stop
()
{
{
LockSynchronousCommand
(
PlayerCommand
::
CLOSE_AUDIO
);
LockSynchronousCommand
(
PlayerCommand
::
CLOSE_AUDIO
);
assert
(
next_song
==
nullptr
);
assert
(
next_song
==
nullptr
);
...
@@ -95,13 +95,13 @@ player_control::Stop()
...
@@ -95,13 +95,13 @@ player_control::Stop()
}
}
void
void
player_c
ontrol
::
UpdateAudio
()
PlayerC
ontrol
::
UpdateAudio
()
{
{
LockSynchronousCommand
(
PlayerCommand
::
UPDATE_AUDIO
);
LockSynchronousCommand
(
PlayerCommand
::
UPDATE_AUDIO
);
}
}
void
void
player_c
ontrol
::
Kill
()
PlayerC
ontrol
::
Kill
()
{
{
assert
(
thread
.
IsDefined
());
assert
(
thread
.
IsDefined
());
...
@@ -112,7 +112,7 @@ player_control::Kill()
...
@@ -112,7 +112,7 @@ player_control::Kill()
}
}
void
void
player_c
ontrol
::
PauseLocked
()
PlayerC
ontrol
::
PauseLocked
()
{
{
if
(
state
!=
PlayerState
::
STOP
)
{
if
(
state
!=
PlayerState
::
STOP
)
{
SynchronousCommand
(
PlayerCommand
::
PAUSE
);
SynchronousCommand
(
PlayerCommand
::
PAUSE
);
...
@@ -121,7 +121,7 @@ player_control::PauseLocked()
...
@@ -121,7 +121,7 @@ player_control::PauseLocked()
}
}
void
void
player_c
ontrol
::
Pause
()
PlayerC
ontrol
::
Pause
()
{
{
Lock
();
Lock
();
PauseLocked
();
PauseLocked
();
...
@@ -129,7 +129,7 @@ player_control::Pause()
...
@@ -129,7 +129,7 @@ player_control::Pause()
}
}
void
void
player_c
ontrol
::
SetPause
(
bool
pause_flag
)
PlayerC
ontrol
::
SetPause
(
bool
pause_flag
)
{
{
Lock
();
Lock
();
...
@@ -152,7 +152,7 @@ player_control::SetPause(bool pause_flag)
...
@@ -152,7 +152,7 @@ player_control::SetPause(bool pause_flag)
}
}
void
void
player_c
ontrol
::
SetBorderPause
(
bool
_border_pause
)
PlayerC
ontrol
::
SetBorderPause
(
bool
_border_pause
)
{
{
Lock
();
Lock
();
border_pause
=
_border_pause
;
border_pause
=
_border_pause
;
...
@@ -160,7 +160,7 @@ player_control::SetBorderPause(bool _border_pause)
...
@@ -160,7 +160,7 @@ player_control::SetBorderPause(bool _border_pause)
}
}
player_status
player_status
player_c
ontrol
::
GetStatus
()
PlayerC
ontrol
::
GetStatus
()
{
{
player_status
status
;
player_status
status
;
...
@@ -182,7 +182,7 @@ player_control::GetStatus()
...
@@ -182,7 +182,7 @@ player_control::GetStatus()
}
}
void
void
player_c
ontrol
::
SetError
(
PlayerError
type
,
Error
&&
_error
)
PlayerC
ontrol
::
SetError
(
PlayerError
type
,
Error
&&
_error
)
{
{
assert
(
type
!=
PlayerError
::
NONE
);
assert
(
type
!=
PlayerError
::
NONE
);
assert
(
_error
.
IsDefined
());
assert
(
_error
.
IsDefined
());
...
@@ -192,7 +192,7 @@ player_control::SetError(PlayerError type, Error &&_error)
...
@@ -192,7 +192,7 @@ player_control::SetError(PlayerError type, Error &&_error)
}
}
void
void
player_c
ontrol
::
ClearError
()
PlayerC
ontrol
::
ClearError
()
{
{
Lock
();
Lock
();
...
@@ -205,7 +205,7 @@ player_control::ClearError()
...
@@ -205,7 +205,7 @@ player_control::ClearError()
}
}
void
void
player_c
ontrol
::
LockSetTaggedSong
(
const
Song
&
song
)
PlayerC
ontrol
::
LockSetTaggedSong
(
const
Song
&
song
)
{
{
Lock
();
Lock
();
if
(
tagged_song
!=
nullptr
)
if
(
tagged_song
!=
nullptr
)
...
@@ -215,7 +215,7 @@ player_control::LockSetTaggedSong(const Song &song)
...
@@ -215,7 +215,7 @@ player_control::LockSetTaggedSong(const Song &song)
}
}
void
void
player_c
ontrol
::
ClearTaggedSong
()
PlayerC
ontrol
::
ClearTaggedSong
()
{
{
if
(
tagged_song
!=
nullptr
)
{
if
(
tagged_song
!=
nullptr
)
{
tagged_song
->
Free
();
tagged_song
->
Free
();
...
@@ -224,7 +224,7 @@ player_control::ClearTaggedSong()
...
@@ -224,7 +224,7 @@ player_control::ClearTaggedSong()
}
}
void
void
player_c
ontrol
::
EnqueueSong
(
Song
*
song
)
PlayerC
ontrol
::
EnqueueSong
(
Song
*
song
)
{
{
assert
(
song
!=
nullptr
);
assert
(
song
!=
nullptr
);
...
@@ -234,7 +234,7 @@ player_control::EnqueueSong(Song *song)
...
@@ -234,7 +234,7 @@ player_control::EnqueueSong(Song *song)
}
}
bool
bool
player_c
ontrol
::
Seek
(
Song
*
song
,
float
seek_time
)
PlayerC
ontrol
::
Seek
(
Song
*
song
,
float
seek_time
)
{
{
assert
(
song
!=
nullptr
);
assert
(
song
!=
nullptr
);
...
@@ -256,7 +256,7 @@ player_control::Seek(Song *song, float seek_time)
...
@@ -256,7 +256,7 @@ player_control::Seek(Song *song, float seek_time)
}
}
void
void
player_c
ontrol
::
SetCrossFade
(
float
_cross_fade_seconds
)
PlayerC
ontrol
::
SetCrossFade
(
float
_cross_fade_seconds
)
{
{
if
(
_cross_fade_seconds
<
0
)
if
(
_cross_fade_seconds
<
0
)
_cross_fade_seconds
=
0
;
_cross_fade_seconds
=
0
;
...
@@ -266,7 +266,7 @@ player_control::SetCrossFade(float _cross_fade_seconds)
...
@@ -266,7 +266,7 @@ player_control::SetCrossFade(float _cross_fade_seconds)
}
}
void
void
player_c
ontrol
::
SetMixRampDb
(
float
_mixramp_db
)
PlayerC
ontrol
::
SetMixRampDb
(
float
_mixramp_db
)
{
{
mixramp_db
=
_mixramp_db
;
mixramp_db
=
_mixramp_db
;
...
@@ -274,7 +274,7 @@ player_control::SetMixRampDb(float _mixramp_db)
...
@@ -274,7 +274,7 @@ player_control::SetMixRampDb(float _mixramp_db)
}
}
void
void
player_c
ontrol
::
SetMixRampDelay
(
float
_mixramp_delay_seconds
)
PlayerC
ontrol
::
SetMixRampDelay
(
float
_mixramp_delay_seconds
)
{
{
mixramp_delay_seconds
=
_mixramp_delay_seconds
;
mixramp_delay_seconds
=
_mixramp_delay_seconds
;
...
...
src/PlayerControl.hxx
View file @
5b5675cc
...
@@ -50,18 +50,18 @@ enum class PlayerCommand : uint8_t {
...
@@ -50,18 +50,18 @@ enum class PlayerCommand : uint8_t {
*/
*/
UPDATE_AUDIO
,
UPDATE_AUDIO
,
/**
player_c
ontrol.next_song has been updated */
/**
PlayerC
ontrol.next_song has been updated */
QUEUE
,
QUEUE
,
/**
/**
* cancel pre-decoding
player_c
ontrol.next_song; if the player
* cancel pre-decoding
PlayerC
ontrol.next_song; if the player
* has already started playing this song, it will completely
* has already started playing this song, it will completely
* stop
* stop
*/
*/
CANCEL
,
CANCEL
,
/**
/**
* Refresh status information in the #
player_c
ontrol struct,
* Refresh status information in the #
PlayerC
ontrol struct,
* e.g. elapsed_time.
* e.g. elapsed_time.
*/
*/
REFRESH
,
REFRESH
,
...
@@ -89,7 +89,7 @@ struct player_status {
...
@@ -89,7 +89,7 @@ struct player_status {
float
elapsed_time
;
float
elapsed_time
;
};
};
struct
player_c
ontrol
{
struct
PlayerC
ontrol
{
unsigned
buffer_chunks
;
unsigned
buffer_chunks
;
unsigned
int
buffered_before_play
;
unsigned
int
buffered_before_play
;
...
@@ -169,9 +169,9 @@ struct player_control {
...
@@ -169,9 +169,9 @@ struct player_control {
*/
*/
bool
border_pause
;
bool
border_pause
;
player_c
ontrol
(
unsigned
buffer_chunks
,
PlayerC
ontrol
(
unsigned
buffer_chunks
,
unsigned
buffered_before_play
);
unsigned
buffered_before_play
);
~
player_c
ontrol
();
~
PlayerC
ontrol
();
/**
/**
* Locks the object.
* Locks the object.
...
...
src/PlayerThread.cxx
View file @
5b5675cc
...
@@ -51,7 +51,7 @@ enum class CrossFadeState : int8_t {
...
@@ -51,7 +51,7 @@ enum class CrossFadeState : int8_t {
};
};
class
Player
{
class
Player
{
player_c
ontrol
&
pc
;
PlayerC
ontrol
&
pc
;
DecoderControl
&
dc
;
DecoderControl
&
dc
;
...
@@ -130,7 +130,7 @@ class Player {
...
@@ -130,7 +130,7 @@ class Player {
float
elapsed_time
;
float
elapsed_time
;
public
:
public
:
Player
(
player_c
ontrol
&
_pc
,
DecoderControl
&
_dc
,
Player
(
PlayerC
ontrol
&
_pc
,
DecoderControl
&
_dc
,
MusicBuffer
&
_buffer
)
MusicBuffer
&
_buffer
)
:
pc
(
_pc
),
dc
(
_dc
),
buffer
(
_buffer
),
:
pc
(
_pc
),
dc
(
_dc
),
buffer
(
_buffer
),
buffering
(
false
),
buffering
(
false
),
...
@@ -275,7 +275,7 @@ public:
...
@@ -275,7 +275,7 @@ public:
};
};
static
void
static
void
player_command_finished
(
player_c
ontrol
&
pc
)
player_command_finished
(
PlayerC
ontrol
&
pc
)
{
{
pc
.
Lock
();
pc
.
Lock
();
pc
.
CommandFinished
();
pc
.
CommandFinished
();
...
@@ -349,7 +349,7 @@ Player::WaitForDecoder()
...
@@ -349,7 +349,7 @@ Player::WaitForDecoder()
pc
.
Lock
();
pc
.
Lock
();
/* update
player_c
ontrol's song information */
/* update
PlayerC
ontrol's song information */
pc
.
total_time
=
pc
.
next_song
->
GetDuration
();
pc
.
total_time
=
pc
.
next_song
->
GetDuration
();
pc
.
bit_rate
=
0
;
pc
.
bit_rate
=
0
;
pc
.
audio_format
.
Clear
();
pc
.
audio_format
.
Clear
();
...
@@ -686,7 +686,7 @@ Player::ProcessCommand()
...
@@ -686,7 +686,7 @@ Player::ProcessCommand()
}
}
static
void
static
void
update_song_tag
(
player_c
ontrol
&
pc
,
Song
*
song
,
const
Tag
&
new_tag
)
update_song_tag
(
PlayerC
ontrol
&
pc
,
Song
*
song
,
const
Tag
&
new_tag
)
{
{
if
(
song
->
IsFile
())
if
(
song
->
IsFile
())
/* don't update tags of local files, only remote
/* 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)
...
@@ -717,7 +717,7 @@ update_song_tag(player_control &pc, Song *song, const Tag &new_tag)
* Player lock is not held.
* Player lock is not held.
*/
*/
static
bool
static
bool
play_chunk
(
player_c
ontrol
&
pc
,
play_chunk
(
PlayerC
ontrol
&
pc
,
Song
*
song
,
struct
music_chunk
*
chunk
,
Song
*
song
,
struct
music_chunk
*
chunk
,
MusicBuffer
&
buffer
,
MusicBuffer
&
buffer
,
const
AudioFormat
format
,
const
AudioFormat
format
,
...
@@ -1095,7 +1095,7 @@ Player::Run()
...
@@ -1095,7 +1095,7 @@ Player::Run()
}
}
static
void
static
void
do_play
(
player_c
ontrol
&
pc
,
DecoderControl
&
dc
,
do_play
(
PlayerC
ontrol
&
pc
,
DecoderControl
&
dc
,
MusicBuffer
&
buffer
)
MusicBuffer
&
buffer
)
{
{
Player
player
(
pc
,
dc
,
buffer
);
Player
player
(
pc
,
dc
,
buffer
);
...
@@ -1105,7 +1105,7 @@ do_play(player_control &pc, DecoderControl &dc,
...
@@ -1105,7 +1105,7 @@ do_play(player_control &pc, DecoderControl &dc,
static
void
static
void
player_task
(
void
*
arg
)
player_task
(
void
*
arg
)
{
{
player_control
&
pc
=
*
(
player_c
ontrol
*
)
arg
;
PlayerControl
&
pc
=
*
(
PlayerC
ontrol
*
)
arg
;
DecoderControl
dc
;
DecoderControl
dc
;
decoder_thread_start
(
dc
);
decoder_thread_start
(
dc
);
...
@@ -1193,7 +1193,7 @@ player_task(void *arg)
...
@@ -1193,7 +1193,7 @@ player_task(void *arg)
}
}
void
void
player_create
(
player_c
ontrol
&
pc
)
player_create
(
PlayerC
ontrol
&
pc
)
{
{
assert
(
!
pc
.
thread
.
IsDefined
());
assert
(
!
pc
.
thread
.
IsDefined
());
...
...
src/PlayerThread.hxx
View file @
5b5675cc
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
* audio outputs via audio_output_all_play().
* audio outputs via audio_output_all_play().
*
*
* It is controlled by the main thread (the playlist code), see
* 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.
* thread and sends it commands.
*
*
* The player thread itself does not do any I/O. It synchronizes with
* The player thread itself does not do any I/O. It synchronizes with
...
@@ -37,9 +37,9 @@
...
@@ -37,9 +37,9 @@
#ifndef MPD_PLAYER_THREAD_HXX
#ifndef MPD_PLAYER_THREAD_HXX
#define MPD_PLAYER_THREAD_HXX
#define MPD_PLAYER_THREAD_HXX
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
void
void
player_create
(
player_c
ontrol
&
pc
);
player_create
(
PlayerC
ontrol
&
pc
);
#endif
#endif
src/Playlist.cxx
View file @
5b5675cc
...
@@ -49,7 +49,7 @@ playlist::TagModified(Song &&song)
...
@@ -49,7 +49,7 @@ playlist::TagModified(Song &&song)
* Queue a song, addressed by its order number.
* Queue a song, addressed by its order number.
*/
*/
static
void
static
void
playlist_queue_song_order
(
playlist
&
playlist
,
player_c
ontrol
&
pc
,
playlist_queue_song_order
(
playlist
&
playlist
,
PlayerC
ontrol
&
pc
,
unsigned
order
)
unsigned
order
)
{
{
assert
(
playlist
.
queue
.
IsValidOrder
(
order
));
assert
(
playlist
.
queue
.
IsValidOrder
(
order
));
...
@@ -71,7 +71,7 @@ playlist_queue_song_order(playlist &playlist, player_control &pc,
...
@@ -71,7 +71,7 @@ playlist_queue_song_order(playlist &playlist, player_control &pc,
* Called if the player thread has started playing the "queued" song.
* Called if the player thread has started playing the "queued" song.
*/
*/
static
void
static
void
playlist_song_started
(
playlist
&
playlist
,
player_c
ontrol
&
pc
)
playlist_song_started
(
playlist
&
playlist
,
PlayerC
ontrol
&
pc
)
{
{
assert
(
pc
.
next_song
==
nullptr
);
assert
(
pc
.
next_song
==
nullptr
);
assert
(
playlist
.
queued
>=
-
1
);
assert
(
playlist
.
queued
>=
-
1
);
...
@@ -98,7 +98,7 @@ playlist::GetQueuedSong() const
...
@@ -98,7 +98,7 @@ playlist::GetQueuedSong() const
}
}
void
void
playlist
::
UpdateQueuedSong
(
player_c
ontrol
&
pc
,
const
Song
*
prev
)
playlist
::
UpdateQueuedSong
(
PlayerC
ontrol
&
pc
,
const
Song
*
prev
)
{
{
if
(
!
playing
)
if
(
!
playing
)
return
;
return
;
...
@@ -144,7 +144,7 @@ playlist::UpdateQueuedSong(player_control &pc, const Song *prev)
...
@@ -144,7 +144,7 @@ playlist::UpdateQueuedSong(player_control &pc, const Song *prev)
}
}
void
void
playlist
::
PlayOrder
(
player_c
ontrol
&
pc
,
int
order
)
playlist
::
PlayOrder
(
PlayerC
ontrol
&
pc
,
int
order
)
{
{
playing
=
true
;
playing
=
true
;
queued
=
-
1
;
queued
=
-
1
;
...
@@ -162,10 +162,10 @@ playlist::PlayOrder(player_control &pc, int order)
...
@@ -162,10 +162,10 @@ playlist::PlayOrder(player_control &pc, int order)
}
}
static
void
static
void
playlist_resume_playback
(
playlist
&
playlist
,
player_c
ontrol
&
pc
);
playlist_resume_playback
(
playlist
&
playlist
,
PlayerC
ontrol
&
pc
);
void
void
playlist
::
SyncWithPlayer
(
player_c
ontrol
&
pc
)
playlist
::
SyncWithPlayer
(
PlayerC
ontrol
&
pc
)
{
{
if
(
!
playing
)
if
(
!
playing
)
/* this event has reached us out of sync: we aren't
/* this event has reached us out of sync: we aren't
...
@@ -205,7 +205,7 @@ playlist::SyncWithPlayer(player_control &pc)
...
@@ -205,7 +205,7 @@ playlist::SyncWithPlayer(player_control &pc)
* decide whether to re-start playback
* decide whether to re-start playback
*/
*/
static
void
static
void
playlist_resume_playback
(
playlist
&
playlist
,
player_c
ontrol
&
pc
)
playlist_resume_playback
(
playlist
&
playlist
,
PlayerC
ontrol
&
pc
)
{
{
assert
(
playlist
.
playing
);
assert
(
playlist
.
playing
);
assert
(
pc
.
GetState
()
==
PlayerState
::
STOP
);
assert
(
pc
.
GetState
()
==
PlayerState
::
STOP
);
...
@@ -228,7 +228,7 @@ playlist_resume_playback(playlist &playlist, player_control &pc)
...
@@ -228,7 +228,7 @@ playlist_resume_playback(playlist &playlist, player_control &pc)
}
}
void
void
playlist
::
SetRepeat
(
player_c
ontrol
&
pc
,
bool
status
)
playlist
::
SetRepeat
(
PlayerC
ontrol
&
pc
,
bool
status
)
{
{
if
(
status
==
queue
.
repeat
)
if
(
status
==
queue
.
repeat
)
return
;
return
;
...
@@ -255,7 +255,7 @@ playlist_order(playlist &playlist)
...
@@ -255,7 +255,7 @@ playlist_order(playlist &playlist)
}
}
void
void
playlist
::
SetSingle
(
player_c
ontrol
&
pc
,
bool
status
)
playlist
::
SetSingle
(
PlayerC
ontrol
&
pc
,
bool
status
)
{
{
if
(
status
==
queue
.
single
)
if
(
status
==
queue
.
single
)
return
;
return
;
...
@@ -282,7 +282,7 @@ playlist::SetConsume(bool status)
...
@@ -282,7 +282,7 @@ playlist::SetConsume(bool status)
}
}
void
void
playlist
::
SetRandom
(
player_c
ontrol
&
pc
,
bool
status
)
playlist
::
SetRandom
(
PlayerC
ontrol
&
pc
,
bool
status
)
{
{
if
(
status
==
queue
.
random
)
if
(
status
==
queue
.
random
)
return
;
return
;
...
...
src/Playlist.hxx
View file @
5b5675cc
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include "Queue.hxx"
#include "Queue.hxx"
#include "PlaylistError.hxx"
#include "PlaylistError.hxx"
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
struct
Song
;
struct
Song
;
struct
playlist
{
struct
playlist
{
...
@@ -105,7 +105,7 @@ struct playlist {
...
@@ -105,7 +105,7 @@ struct playlist {
* player thread whenever it requests a new queued song, or
* player thread whenever it requests a new queued song, or
* when it exits.
* when it exits.
*/
*/
void
SyncWithPlayer
(
player_c
ontrol
&
pc
);
void
SyncWithPlayer
(
PlayerC
ontrol
&
pc
);
protected
:
protected
:
/**
/**
...
@@ -123,10 +123,10 @@ protected:
...
@@ -123,10 +123,10 @@ protected:
* @param prev the song which was previously queued, as
* @param prev the song which was previously queued, as
* determined by playlist_get_queued_song()
* determined by playlist_get_queued_song()
*/
*/
void
UpdateQueuedSong
(
player_c
ontrol
&
pc
,
const
Song
*
prev
);
void
UpdateQueuedSong
(
PlayerC
ontrol
&
pc
,
const
Song
*
prev
);
public
:
public
:
void
Clear
(
player_c
ontrol
&
pc
);
void
Clear
(
PlayerC
ontrol
&
pc
);
/**
/**
* A tag in the play queue has been modified by the player
* A tag in the play queue has been modified by the player
...
@@ -140,7 +140,7 @@ public:
...
@@ -140,7 +140,7 @@ public:
*/
*/
void
DatabaseModified
();
void
DatabaseModified
();
PlaylistResult
AppendSong
(
player_c
ontrol
&
pc
,
PlaylistResult
AppendSong
(
PlayerC
ontrol
&
pc
,
Song
*
song
,
Song
*
song
,
unsigned
*
added_id
=
nullptr
);
unsigned
*
added_id
=
nullptr
);
...
@@ -150,28 +150,28 @@ public:
...
@@ -150,28 +150,28 @@ public:
*
*
* Note: the caller is responsible for checking permissions.
* Note: the caller is responsible for checking permissions.
*/
*/
PlaylistResult
AppendFile
(
player_c
ontrol
&
pc
,
PlaylistResult
AppendFile
(
PlayerC
ontrol
&
pc
,
const
char
*
path_utf8
,
const
char
*
path_utf8
,
unsigned
*
added_id
=
nullptr
);
unsigned
*
added_id
=
nullptr
);
PlaylistResult
AppendURI
(
player_c
ontrol
&
pc
,
PlaylistResult
AppendURI
(
PlayerC
ontrol
&
pc
,
const
char
*
uri_utf8
,
const
char
*
uri_utf8
,
unsigned
*
added_id
=
nullptr
);
unsigned
*
added_id
=
nullptr
);
protected
:
protected
:
void
DeleteInternal
(
player_c
ontrol
&
pc
,
void
DeleteInternal
(
PlayerC
ontrol
&
pc
,
unsigned
song
,
const
Song
**
queued_p
);
unsigned
song
,
const
Song
**
queued_p
);
public
:
public
:
PlaylistResult
DeletePosition
(
player_c
ontrol
&
pc
,
PlaylistResult
DeletePosition
(
PlayerC
ontrol
&
pc
,
unsigned
position
);
unsigned
position
);
PlaylistResult
DeleteOrder
(
player_c
ontrol
&
pc
,
PlaylistResult
DeleteOrder
(
PlayerC
ontrol
&
pc
,
unsigned
order
)
{
unsigned
order
)
{
return
DeletePosition
(
pc
,
queue
.
OrderToPosition
(
order
));
return
DeletePosition
(
pc
,
queue
.
OrderToPosition
(
order
));
}
}
PlaylistResult
DeleteId
(
player_c
ontrol
&
pc
,
unsigned
id
);
PlaylistResult
DeleteId
(
PlayerC
ontrol
&
pc
,
unsigned
id
);
/**
/**
* Deletes a range of songs from the playlist.
* Deletes a range of songs from the playlist.
...
@@ -179,49 +179,49 @@ public:
...
@@ -179,49 +179,49 @@ public:
* @param start the position of the first song to delete
* @param start the position of the first song to delete
* @param end the position after the last song to delete
* @param end the position after the last song to delete
*/
*/
PlaylistResult
DeleteRange
(
player_c
ontrol
&
pc
,
PlaylistResult
DeleteRange
(
PlayerC
ontrol
&
pc
,
unsigned
start
,
unsigned
end
);
unsigned
start
,
unsigned
end
);
void
DeleteSong
(
player_c
ontrol
&
pc
,
const
Song
&
song
);
void
DeleteSong
(
PlayerC
ontrol
&
pc
,
const
Song
&
song
);
void
Shuffle
(
player_c
ontrol
&
pc
,
unsigned
start
,
unsigned
end
);
void
Shuffle
(
PlayerC
ontrol
&
pc
,
unsigned
start
,
unsigned
end
);
PlaylistResult
MoveRange
(
player_c
ontrol
&
pc
,
PlaylistResult
MoveRange
(
PlayerC
ontrol
&
pc
,
unsigned
start
,
unsigned
end
,
int
to
);
unsigned
start
,
unsigned
end
,
int
to
);
PlaylistResult
MoveId
(
player_c
ontrol
&
pc
,
unsigned
id
,
int
to
);
PlaylistResult
MoveId
(
PlayerC
ontrol
&
pc
,
unsigned
id
,
int
to
);
PlaylistResult
SwapPositions
(
player_c
ontrol
&
pc
,
PlaylistResult
SwapPositions
(
PlayerC
ontrol
&
pc
,
unsigned
song1
,
unsigned
song2
);
unsigned
song1
,
unsigned
song2
);
PlaylistResult
SwapIds
(
player_c
ontrol
&
pc
,
PlaylistResult
SwapIds
(
PlayerC
ontrol
&
pc
,
unsigned
id1
,
unsigned
id2
);
unsigned
id1
,
unsigned
id2
);
PlaylistResult
SetPriorityRange
(
player_c
ontrol
&
pc
,
PlaylistResult
SetPriorityRange
(
PlayerC
ontrol
&
pc
,
unsigned
start_position
,
unsigned
start_position
,
unsigned
end_position
,
unsigned
end_position
,
uint8_t
priority
);
uint8_t
priority
);
PlaylistResult
SetPriorityId
(
player_c
ontrol
&
pc
,
PlaylistResult
SetPriorityId
(
PlayerC
ontrol
&
pc
,
unsigned
song_id
,
uint8_t
priority
);
unsigned
song_id
,
uint8_t
priority
);
void
Stop
(
player_c
ontrol
&
pc
);
void
Stop
(
PlayerC
ontrol
&
pc
);
PlaylistResult
PlayPosition
(
player_c
ontrol
&
pc
,
int
position
);
PlaylistResult
PlayPosition
(
PlayerC
ontrol
&
pc
,
int
position
);
void
PlayOrder
(
player_c
ontrol
&
pc
,
int
order
);
void
PlayOrder
(
PlayerC
ontrol
&
pc
,
int
order
);
PlaylistResult
PlayId
(
player_c
ontrol
&
pc
,
int
id
);
PlaylistResult
PlayId
(
PlayerC
ontrol
&
pc
,
int
id
);
void
PlayNext
(
player_c
ontrol
&
pc
);
void
PlayNext
(
PlayerC
ontrol
&
pc
);
void
PlayPrevious
(
player_c
ontrol
&
pc
);
void
PlayPrevious
(
PlayerC
ontrol
&
pc
);
PlaylistResult
SeekSongPosition
(
player_c
ontrol
&
pc
,
PlaylistResult
SeekSongPosition
(
PlayerC
ontrol
&
pc
,
unsigned
song_position
,
unsigned
song_position
,
float
seek_time
);
float
seek_time
);
PlaylistResult
SeekSongId
(
player_c
ontrol
&
pc
,
PlaylistResult
SeekSongId
(
PlayerC
ontrol
&
pc
,
unsigned
song_id
,
float
seek_time
);
unsigned
song_id
,
float
seek_time
);
/**
/**
...
@@ -232,26 +232,26 @@ public:
...
@@ -232,26 +232,26 @@ public:
* @param relative if true, then the specified time is relative to the
* @param relative if true, then the specified time is relative to the
* current position
* current position
*/
*/
PlaylistResult
SeekCurrent
(
player_c
ontrol
&
pc
,
PlaylistResult
SeekCurrent
(
PlayerC
ontrol
&
pc
,
float
seek_time
,
bool
relative
);
float
seek_time
,
bool
relative
);
bool
GetRepeat
()
const
{
bool
GetRepeat
()
const
{
return
queue
.
repeat
;
return
queue
.
repeat
;
}
}
void
SetRepeat
(
player_c
ontrol
&
pc
,
bool
new_value
);
void
SetRepeat
(
PlayerC
ontrol
&
pc
,
bool
new_value
);
bool
GetRandom
()
const
{
bool
GetRandom
()
const
{
return
queue
.
random
;
return
queue
.
random
;
}
}
void
SetRandom
(
player_c
ontrol
&
pc
,
bool
new_value
);
void
SetRandom
(
PlayerC
ontrol
&
pc
,
bool
new_value
);
bool
GetSingle
()
const
{
bool
GetSingle
()
const
{
return
queue
.
single
;
return
queue
.
single
;
}
}
void
SetSingle
(
player_c
ontrol
&
pc
,
bool
new_value
);
void
SetSingle
(
PlayerC
ontrol
&
pc
,
bool
new_value
);
bool
GetConsume
()
const
{
bool
GetConsume
()
const
{
return
queue
.
consume
;
return
queue
.
consume
;
...
...
src/PlaylistControl.cxx
View file @
5b5675cc
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#include "Log.hxx"
#include "Log.hxx"
void
void
playlist
::
Stop
(
player_c
ontrol
&
pc
)
playlist
::
Stop
(
PlayerC
ontrol
&
pc
)
{
{
if
(
!
playing
)
if
(
!
playing
)
return
;
return
;
...
@@ -57,7 +57,7 @@ playlist::Stop(player_control &pc)
...
@@ -57,7 +57,7 @@ playlist::Stop(player_control &pc)
}
}
PlaylistResult
PlaylistResult
playlist
::
PlayPosition
(
player_c
ontrol
&
pc
,
int
song
)
playlist
::
PlayPosition
(
PlayerC
ontrol
&
pc
,
int
song
)
{
{
pc
.
ClearError
();
pc
.
ClearError
();
...
@@ -107,7 +107,7 @@ playlist::PlayPosition(player_control &pc, int song)
...
@@ -107,7 +107,7 @@ playlist::PlayPosition(player_control &pc, int song)
}
}
PlaylistResult
PlaylistResult
playlist
::
PlayId
(
player_c
ontrol
&
pc
,
int
id
)
playlist
::
PlayId
(
PlayerC
ontrol
&
pc
,
int
id
)
{
{
if
(
id
==
-
1
)
if
(
id
==
-
1
)
return
PlayPosition
(
pc
,
id
);
return
PlayPosition
(
pc
,
id
);
...
@@ -120,7 +120,7 @@ playlist::PlayId(player_control &pc, int id)
...
@@ -120,7 +120,7 @@ playlist::PlayId(player_control &pc, int id)
}
}
void
void
playlist
::
PlayNext
(
player_c
ontrol
&
pc
)
playlist
::
PlayNext
(
PlayerC
ontrol
&
pc
)
{
{
if
(
!
playing
)
if
(
!
playing
)
return
;
return
;
...
@@ -166,7 +166,7 @@ playlist::PlayNext(player_control &pc)
...
@@ -166,7 +166,7 @@ playlist::PlayNext(player_control &pc)
}
}
void
void
playlist
::
PlayPrevious
(
player_c
ontrol
&
pc
)
playlist
::
PlayPrevious
(
PlayerC
ontrol
&
pc
)
{
{
if
(
!
playing
)
if
(
!
playing
)
return
;
return
;
...
@@ -190,7 +190,7 @@ playlist::PlayPrevious(player_control &pc)
...
@@ -190,7 +190,7 @@ playlist::PlayPrevious(player_control &pc)
}
}
PlaylistResult
PlaylistResult
playlist
::
SeekSongPosition
(
player_c
ontrol
&
pc
,
unsigned
song
,
float
seek_time
)
playlist
::
SeekSongPosition
(
PlayerC
ontrol
&
pc
,
unsigned
song
,
float
seek_time
)
{
{
if
(
!
queue
.
IsValidPosition
(
song
))
if
(
!
queue
.
IsValidPosition
(
song
))
return
PlaylistResult
::
BAD_RANGE
;
return
PlaylistResult
::
BAD_RANGE
;
...
@@ -229,7 +229,7 @@ playlist::SeekSongPosition(player_control &pc, unsigned song, float seek_time)
...
@@ -229,7 +229,7 @@ playlist::SeekSongPosition(player_control &pc, unsigned song, float seek_time)
}
}
PlaylistResult
PlaylistResult
playlist
::
SeekSongId
(
player_c
ontrol
&
pc
,
unsigned
id
,
float
seek_time
)
playlist
::
SeekSongId
(
PlayerC
ontrol
&
pc
,
unsigned
id
,
float
seek_time
)
{
{
int
song
=
queue
.
IdToPosition
(
id
);
int
song
=
queue
.
IdToPosition
(
id
);
if
(
song
<
0
)
if
(
song
<
0
)
...
@@ -239,7 +239,7 @@ playlist::SeekSongId(player_control &pc, unsigned id, float seek_time)
...
@@ -239,7 +239,7 @@ playlist::SeekSongId(player_control &pc, unsigned id, float seek_time)
}
}
PlaylistResult
PlaylistResult
playlist
::
SeekCurrent
(
player_c
ontrol
&
pc
,
float
seek_time
,
bool
relative
)
playlist
::
SeekCurrent
(
PlayerC
ontrol
&
pc
,
float
seek_time
,
bool
relative
)
{
{
if
(
!
playing
)
if
(
!
playing
)
return
PlaylistResult
::
NOT_PLAYING
;
return
PlaylistResult
::
NOT_PLAYING
;
...
...
src/PlaylistEdit.cxx
View file @
5b5675cc
...
@@ -46,7 +46,7 @@ playlist::OnModified()
...
@@ -46,7 +46,7 @@ playlist::OnModified()
}
}
void
void
playlist
::
Clear
(
player_c
ontrol
&
pc
)
playlist
::
Clear
(
PlayerC
ontrol
&
pc
)
{
{
Stop
(
pc
);
Stop
(
pc
);
...
@@ -57,7 +57,7 @@ playlist::Clear(player_control &pc)
...
@@ -57,7 +57,7 @@ playlist::Clear(player_control &pc)
}
}
PlaylistResult
PlaylistResult
playlist
::
AppendFile
(
struct
player_c
ontrol
&
pc
,
playlist
::
AppendFile
(
PlayerC
ontrol
&
pc
,
const
char
*
path_utf8
,
unsigned
*
added_id
)
const
char
*
path_utf8
,
unsigned
*
added_id
)
{
{
Song
*
song
=
Song
::
LoadFile
(
path_utf8
,
nullptr
);
Song
*
song
=
Song
::
LoadFile
(
path_utf8
,
nullptr
);
...
@@ -70,7 +70,7 @@ playlist::AppendFile(struct player_control &pc,
...
@@ -70,7 +70,7 @@ playlist::AppendFile(struct player_control &pc,
}
}
PlaylistResult
PlaylistResult
playlist
::
AppendSong
(
struct
player_c
ontrol
&
pc
,
playlist
::
AppendSong
(
PlayerC
ontrol
&
pc
,
Song
*
song
,
unsigned
*
added_id
)
Song
*
song
,
unsigned
*
added_id
)
{
{
unsigned
id
;
unsigned
id
;
...
@@ -105,7 +105,7 @@ playlist::AppendSong(struct player_control &pc,
...
@@ -105,7 +105,7 @@ playlist::AppendSong(struct player_control &pc,
}
}
PlaylistResult
PlaylistResult
playlist
::
AppendURI
(
struct
player_c
ontrol
&
pc
,
playlist
::
AppendURI
(
PlayerC
ontrol
&
pc
,
const
char
*
uri
,
unsigned
*
added_id
)
const
char
*
uri
,
unsigned
*
added_id
)
{
{
FormatDebug
(
playlist_domain
,
"add to playlist: %s"
,
uri
);
FormatDebug
(
playlist_domain
,
"add to playlist: %s"
,
uri
);
...
@@ -134,7 +134,7 @@ playlist::AppendURI(struct player_control &pc,
...
@@ -134,7 +134,7 @@ playlist::AppendURI(struct player_control &pc,
}
}
PlaylistResult
PlaylistResult
playlist
::
SwapPositions
(
player_c
ontrol
&
pc
,
unsigned
song1
,
unsigned
song2
)
playlist
::
SwapPositions
(
PlayerC
ontrol
&
pc
,
unsigned
song1
,
unsigned
song2
)
{
{
if
(
!
queue
.
IsValidPosition
(
song1
)
||
!
queue
.
IsValidPosition
(
song2
))
if
(
!
queue
.
IsValidPosition
(
song1
)
||
!
queue
.
IsValidPosition
(
song2
))
return
PlaylistResult
::
BAD_RANGE
;
return
PlaylistResult
::
BAD_RANGE
;
...
@@ -165,7 +165,7 @@ playlist::SwapPositions(player_control &pc, unsigned song1, unsigned song2)
...
@@ -165,7 +165,7 @@ playlist::SwapPositions(player_control &pc, unsigned song1, unsigned song2)
}
}
PlaylistResult
PlaylistResult
playlist
::
SwapIds
(
player_c
ontrol
&
pc
,
unsigned
id1
,
unsigned
id2
)
playlist
::
SwapIds
(
PlayerC
ontrol
&
pc
,
unsigned
id1
,
unsigned
id2
)
{
{
int
song1
=
queue
.
IdToPosition
(
id1
);
int
song1
=
queue
.
IdToPosition
(
id1
);
int
song2
=
queue
.
IdToPosition
(
id2
);
int
song2
=
queue
.
IdToPosition
(
id2
);
...
@@ -177,7 +177,7 @@ playlist::SwapIds(player_control &pc, unsigned id1, unsigned id2)
...
@@ -177,7 +177,7 @@ playlist::SwapIds(player_control &pc, unsigned id1, unsigned id2)
}
}
PlaylistResult
PlaylistResult
playlist
::
SetPriorityRange
(
player_c
ontrol
&
pc
,
playlist
::
SetPriorityRange
(
PlayerC
ontrol
&
pc
,
unsigned
start
,
unsigned
end
,
unsigned
start
,
unsigned
end
,
uint8_t
priority
)
uint8_t
priority
)
{
{
...
@@ -211,7 +211,7 @@ playlist::SetPriorityRange(player_control &pc,
...
@@ -211,7 +211,7 @@ playlist::SetPriorityRange(player_control &pc,
}
}
PlaylistResult
PlaylistResult
playlist
::
SetPriorityId
(
struct
player_c
ontrol
&
pc
,
playlist
::
SetPriorityId
(
PlayerC
ontrol
&
pc
,
unsigned
song_id
,
uint8_t
priority
)
unsigned
song_id
,
uint8_t
priority
)
{
{
int
song_position
=
queue
.
IdToPosition
(
song_id
);
int
song_position
=
queue
.
IdToPosition
(
song_id
);
...
@@ -224,7 +224,7 @@ playlist::SetPriorityId(struct player_control &pc,
...
@@ -224,7 +224,7 @@ playlist::SetPriorityId(struct player_control &pc,
}
}
void
void
playlist
::
DeleteInternal
(
player_c
ontrol
&
pc
,
playlist
::
DeleteInternal
(
PlayerC
ontrol
&
pc
,
unsigned
song
,
const
Song
**
queued_p
)
unsigned
song
,
const
Song
**
queued_p
)
{
{
assert
(
song
<
GetLength
());
assert
(
song
<
GetLength
());
...
@@ -270,7 +270,7 @@ playlist::DeleteInternal(player_control &pc,
...
@@ -270,7 +270,7 @@ playlist::DeleteInternal(player_control &pc,
}
}
PlaylistResult
PlaylistResult
playlist
::
DeletePosition
(
struct
player_c
ontrol
&
pc
,
unsigned
song
)
playlist
::
DeletePosition
(
PlayerC
ontrol
&
pc
,
unsigned
song
)
{
{
if
(
song
>=
queue
.
GetLength
())
if
(
song
>=
queue
.
GetLength
())
return
PlaylistResult
::
BAD_RANGE
;
return
PlaylistResult
::
BAD_RANGE
;
...
@@ -286,7 +286,7 @@ playlist::DeletePosition(struct player_control &pc, unsigned song)
...
@@ -286,7 +286,7 @@ playlist::DeletePosition(struct player_control &pc, unsigned song)
}
}
PlaylistResult
PlaylistResult
playlist
::
DeleteRange
(
struct
player_c
ontrol
&
pc
,
unsigned
start
,
unsigned
end
)
playlist
::
DeleteRange
(
PlayerC
ontrol
&
pc
,
unsigned
start
,
unsigned
end
)
{
{
if
(
start
>=
queue
.
GetLength
())
if
(
start
>=
queue
.
GetLength
())
return
PlaylistResult
::
BAD_RANGE
;
return
PlaylistResult
::
BAD_RANGE
;
...
@@ -310,7 +310,7 @@ playlist::DeleteRange(struct player_control &pc, unsigned start, unsigned end)
...
@@ -310,7 +310,7 @@ playlist::DeleteRange(struct player_control &pc, unsigned start, unsigned end)
}
}
PlaylistResult
PlaylistResult
playlist
::
DeleteId
(
struct
player_c
ontrol
&
pc
,
unsigned
id
)
playlist
::
DeleteId
(
PlayerC
ontrol
&
pc
,
unsigned
id
)
{
{
int
song
=
queue
.
IdToPosition
(
id
);
int
song
=
queue
.
IdToPosition
(
id
);
if
(
song
<
0
)
if
(
song
<
0
)
...
@@ -320,7 +320,7 @@ playlist::DeleteId(struct player_control &pc, unsigned id)
...
@@ -320,7 +320,7 @@ playlist::DeleteId(struct player_control &pc, unsigned id)
}
}
void
void
playlist
::
DeleteSong
(
struct
player_c
ontrol
&
pc
,
const
struct
Song
&
song
)
playlist
::
DeleteSong
(
PlayerC
ontrol
&
pc
,
const
struct
Song
&
song
)
{
{
for
(
int
i
=
queue
.
GetLength
()
-
1
;
i
>=
0
;
--
i
)
for
(
int
i
=
queue
.
GetLength
()
-
1
;
i
>=
0
;
--
i
)
if
(
SongEquals
(
song
,
queue
.
Get
(
i
)))
if
(
SongEquals
(
song
,
queue
.
Get
(
i
)))
...
@@ -328,7 +328,7 @@ playlist::DeleteSong(struct player_control &pc, const struct Song &song)
...
@@ -328,7 +328,7 @@ playlist::DeleteSong(struct player_control &pc, const struct Song &song)
}
}
PlaylistResult
PlaylistResult
playlist
::
MoveRange
(
player_c
ontrol
&
pc
,
unsigned
start
,
unsigned
end
,
int
to
)
playlist
::
MoveRange
(
PlayerC
ontrol
&
pc
,
unsigned
start
,
unsigned
end
,
int
to
)
{
{
if
(
!
queue
.
IsValidPosition
(
start
)
||
!
queue
.
IsValidPosition
(
end
-
1
))
if
(
!
queue
.
IsValidPosition
(
start
)
||
!
queue
.
IsValidPosition
(
end
-
1
))
return
PlaylistResult
::
BAD_RANGE
;
return
PlaylistResult
::
BAD_RANGE
;
...
@@ -381,7 +381,7 @@ playlist::MoveRange(player_control &pc, unsigned start, unsigned end, int to)
...
@@ -381,7 +381,7 @@ playlist::MoveRange(player_control &pc, unsigned start, unsigned end, int to)
}
}
PlaylistResult
PlaylistResult
playlist
::
MoveId
(
player_c
ontrol
&
pc
,
unsigned
id1
,
int
to
)
playlist
::
MoveId
(
PlayerC
ontrol
&
pc
,
unsigned
id1
,
int
to
)
{
{
int
song
=
queue
.
IdToPosition
(
id1
);
int
song
=
queue
.
IdToPosition
(
id1
);
if
(
song
<
0
)
if
(
song
<
0
)
...
@@ -391,7 +391,7 @@ playlist::MoveId(player_control &pc, unsigned id1, int to)
...
@@ -391,7 +391,7 @@ playlist::MoveId(player_control &pc, unsigned id1, int to)
}
}
void
void
playlist
::
Shuffle
(
player_c
ontrol
&
pc
,
unsigned
start
,
unsigned
end
)
playlist
::
Shuffle
(
PlayerC
ontrol
&
pc
,
unsigned
start
,
unsigned
end
)
{
{
if
(
end
>
GetLength
())
if
(
end
>
GetLength
())
/* correct the "end" offset */
/* correct the "end" offset */
...
...
src/PlaylistQueue.cxx
View file @
5b5675cc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
PlaylistResult
PlaylistResult
playlist_load_into_queue
(
const
char
*
uri
,
SongEnumerator
&
e
,
playlist_load_into_queue
(
const
char
*
uri
,
SongEnumerator
&
e
,
unsigned
start_index
,
unsigned
end_index
,
unsigned
start_index
,
unsigned
end_index
,
playlist
&
dest
,
player_c
ontrol
&
pc
,
playlist
&
dest
,
PlayerC
ontrol
&
pc
,
bool
secure
)
bool
secure
)
{
{
const
std
::
string
base_uri
=
uri
!=
nullptr
const
std
::
string
base_uri
=
uri
!=
nullptr
...
@@ -66,7 +66,7 @@ playlist_load_into_queue(const char *uri, SongEnumerator &e,
...
@@ -66,7 +66,7 @@ playlist_load_into_queue(const char *uri, SongEnumerator &e,
PlaylistResult
PlaylistResult
playlist_open_into_queue
(
const
char
*
uri
,
playlist_open_into_queue
(
const
char
*
uri
,
unsigned
start_index
,
unsigned
end_index
,
unsigned
start_index
,
unsigned
end_index
,
playlist
&
dest
,
player_c
ontrol
&
pc
,
playlist
&
dest
,
PlayerC
ontrol
&
pc
,
bool
secure
)
bool
secure
)
{
{
Mutex
mutex
;
Mutex
mutex
;
...
...
src/PlaylistQueue.hxx
View file @
5b5675cc
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
class
SongEnumerator
;
class
SongEnumerator
;
struct
playlist
;
struct
playlist
;
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
/**
/**
* Loads the contents of a playlist and append it to the specified
* Loads the contents of a playlist and append it to the specified
...
@@ -42,7 +42,7 @@ struct player_control;
...
@@ -42,7 +42,7 @@ struct player_control;
PlaylistResult
PlaylistResult
playlist_load_into_queue
(
const
char
*
uri
,
SongEnumerator
&
e
,
playlist_load_into_queue
(
const
char
*
uri
,
SongEnumerator
&
e
,
unsigned
start_index
,
unsigned
end_index
,
unsigned
start_index
,
unsigned
end_index
,
playlist
&
dest
,
player_c
ontrol
&
pc
,
playlist
&
dest
,
PlayerC
ontrol
&
pc
,
bool
secure
);
bool
secure
);
/**
/**
...
@@ -52,7 +52,7 @@ playlist_load_into_queue(const char *uri, SongEnumerator &e,
...
@@ -52,7 +52,7 @@ playlist_load_into_queue(const char *uri, SongEnumerator &e,
PlaylistResult
PlaylistResult
playlist_open_into_queue
(
const
char
*
uri
,
playlist_open_into_queue
(
const
char
*
uri
,
unsigned
start_index
,
unsigned
end_index
,
unsigned
start_index
,
unsigned
end_index
,
playlist
&
dest
,
player_c
ontrol
&
pc
,
playlist
&
dest
,
PlayerC
ontrol
&
pc
,
bool
secure
);
bool
secure
);
#endif
#endif
...
...
src/PlaylistSave.cxx
View file @
5b5675cc
...
@@ -101,7 +101,7 @@ spl_save_playlist(const char *name_utf8, const playlist &playlist)
...
@@ -101,7 +101,7 @@ spl_save_playlist(const char *name_utf8, const playlist &playlist)
}
}
bool
bool
playlist_load_spl
(
struct
playlist
&
playlist
,
player_c
ontrol
&
pc
,
playlist_load_spl
(
struct
playlist
&
playlist
,
PlayerC
ontrol
&
pc
,
const
char
*
name_utf8
,
const
char
*
name_utf8
,
unsigned
start_index
,
unsigned
end_index
,
unsigned
start_index
,
unsigned
end_index
,
Error
&
error
)
Error
&
error
)
...
...
src/PlaylistSave.hxx
View file @
5b5675cc
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
struct
Song
;
struct
Song
;
struct
queue
;
struct
queue
;
struct
playlist
;
struct
playlist
;
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
class
Error
;
class
Error
;
void
void
...
@@ -53,7 +53,7 @@ spl_save_playlist(const char *name_utf8, const playlist &playlist);
...
@@ -53,7 +53,7 @@ spl_save_playlist(const char *name_utf8, const playlist &playlist);
* playlist.
* playlist.
*/
*/
bool
bool
playlist_load_spl
(
struct
playlist
&
playlist
,
player_c
ontrol
&
pc
,
playlist_load_spl
(
struct
playlist
&
playlist
,
PlayerC
ontrol
&
pc
,
const
char
*
name_utf8
,
const
char
*
name_utf8
,
unsigned
start_index
,
unsigned
end_index
,
unsigned
start_index
,
unsigned
end_index
,
Error
&
error
);
Error
&
error
);
...
...
src/PlaylistState.cxx
View file @
5b5675cc
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
void
void
playlist_state_save
(
FILE
*
fp
,
const
struct
playlist
&
playlist
,
playlist_state_save
(
FILE
*
fp
,
const
struct
playlist
&
playlist
,
player_c
ontrol
&
pc
)
PlayerC
ontrol
&
pc
)
{
{
const
auto
player_status
=
pc
.
GetStatus
();
const
auto
player_status
=
pc
.
GetStatus
();
...
@@ -128,7 +128,7 @@ playlist_state_load(TextFile &file, struct playlist &playlist)
...
@@ -128,7 +128,7 @@ playlist_state_load(TextFile &file, struct playlist &playlist)
bool
bool
playlist_state_restore
(
const
char
*
line
,
TextFile
&
file
,
playlist_state_restore
(
const
char
*
line
,
TextFile
&
file
,
struct
playlist
&
playlist
,
player_c
ontrol
&
pc
)
struct
playlist
&
playlist
,
PlayerC
ontrol
&
pc
)
{
{
int
current
=
-
1
;
int
current
=
-
1
;
int
seek_time
=
0
;
int
seek_time
=
0
;
...
@@ -217,7 +217,7 @@ playlist_state_restore(const char *line, TextFile &file,
...
@@ -217,7 +217,7 @@ playlist_state_restore(const char *line, TextFile &file,
unsigned
unsigned
playlist_state_get_hash
(
const
playlist
&
playlist
,
playlist_state_get_hash
(
const
playlist
&
playlist
,
player_c
ontrol
&
pc
)
PlayerC
ontrol
&
pc
)
{
{
const
auto
player_status
=
pc
.
GetStatus
();
const
auto
player_status
=
pc
.
GetStatus
();
...
...
src/PlaylistState.hxx
View file @
5b5675cc
...
@@ -28,16 +28,16 @@
...
@@ -28,16 +28,16 @@
#include <stdio.h>
#include <stdio.h>
struct
playlist
;
struct
playlist
;
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
class
TextFile
;
class
TextFile
;
void
void
playlist_state_save
(
FILE
*
fp
,
const
struct
playlist
&
playlist
,
playlist_state_save
(
FILE
*
fp
,
const
struct
playlist
&
playlist
,
player_c
ontrol
&
pc
);
PlayerC
ontrol
&
pc
);
bool
bool
playlist_state_restore
(
const
char
*
line
,
TextFile
&
file
,
playlist_state_restore
(
const
char
*
line
,
TextFile
&
file
,
struct
playlist
&
playlist
,
player_c
ontrol
&
pc
);
struct
playlist
&
playlist
,
PlayerC
ontrol
&
pc
);
/**
/**
* Generates a hash number for the current state of the playlist and
* Generates a hash number for the current state of the playlist and
...
@@ -47,6 +47,6 @@ playlist_state_restore(const char *line, TextFile &file,
...
@@ -47,6 +47,6 @@ playlist_state_restore(const char *line, TextFile &file,
*/
*/
unsigned
unsigned
playlist_state_get_hash
(
const
struct
playlist
&
playlist
,
playlist_state_get_hash
(
const
struct
playlist
&
playlist
,
player_c
ontrol
&
c
);
PlayerC
ontrol
&
c
);
#endif
#endif
test/run_output.cxx
View file @
5b5675cc
...
@@ -72,9 +72,9 @@ find_named_config_block(ConfigOption option, const char *name)
...
@@ -72,9 +72,9 @@ find_named_config_block(ConfigOption option, const char *name)
return
NULL
;
return
NULL
;
}
}
player_control
::
player_c
ontrol
(
gcc_unused
unsigned
_buffer_chunks
,
PlayerControl
::
PlayerC
ontrol
(
gcc_unused
unsigned
_buffer_chunks
,
gcc_unused
unsigned
_buffered_before_play
)
{}
gcc_unused
unsigned
_buffered_before_play
)
{}
player_control
::~
player_c
ontrol
()
{}
PlayerControl
::~
PlayerC
ontrol
()
{}
static
struct
audio_output
*
static
struct
audio_output
*
load_audio_output
(
const
char
*
name
)
load_audio_output
(
const
char
*
name
)
...
@@ -87,7 +87,7 @@ load_audio_output(const char *name)
...
@@ -87,7 +87,7 @@ load_audio_output(const char *name)
return
nullptr
;
return
nullptr
;
}
}
static
struct
player_c
ontrol
dummy_player_control
(
32
,
4
);
static
struct
PlayerC
ontrol
dummy_player_control
(
32
,
4
);
Error
error
;
Error
error
;
struct
audio_output
*
ao
=
struct
audio_output
*
ao
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment