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
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
135 additions
and
135 deletions
+135
-135
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
+21
-21
PlayerControl.hxx
src/PlayerControl.hxx
+6
-6
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 {
public
:
Partition
&
partition
;
struct
playlist
&
playlist
;
struct
player_c
ontrol
&
player_control
;
struct
PlayerC
ontrol
&
player_control
;
unsigned
permission
;
...
...
src/OutputAll.cxx
View file @
5b5675cc
...
...
@@ -103,7 +103,7 @@ audio_output_config_count(void)
}
void
audio_output_all_init
(
player_c
ontrol
&
pc
)
audio_output_all_init
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
unsigned
threshold
)
audio_output_all_wait
(
PlayerC
ontrol
&
pc
,
unsigned
threshold
)
{
pc
.
Lock
();
...
...
src/OutputAll.hxx
View file @
5b5675cc
...
...
@@ -32,7 +32,7 @@
struct
AudioFormat
;
class
MusicBuffer
;
struct
music_chunk
;
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
class
Error
;
/**
...
...
@@ -40,7 +40,7 @@ class Error;
* file and initialize them.
*/
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
...
...
@@ -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_c
ontrol
&
pc
,
unsigned
threshold
);
audio_output_all_wait
(
PlayerC
ontrol
&
pc
,
unsigned
threshold
);
/**
* Puts all audio outputs into pause mode. Most implementations will
...
...
src/OutputControl.hxx
View file @
5b5675cc
...
...
@@ -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
,
...
...
src/OutputInit.cxx
View file @
5b5675cc
...
...
@@ -281,7 +281,7 @@ audio_output_setup(struct audio_output *ao, const config_param ¶m,
struct
audio_output
*
audio_output_new
(
const
config_param
&
param
,
player_c
ontrol
&
pc
,
PlayerC
ontrol
&
pc
,
Error
&
error
)
{
const
struct
audio_output_plugin
*
plugin
;
...
...
src/OutputInternal.hxx
View file @
5b5675cc
...
...
@@ -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_c
ontrol object which "owns" this output. This
* The
PlayerC
ontrol object which "owns" this output. This
* 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
...
...
@@ -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_c
ontrol
&
pc
,
PlayerC
ontrol
&
pc
,
Error
&
error
);
bool
...
...
src/Partition.hxx
View file @
5b5675cc
...
...
@@ -34,7 +34,7 @@ struct Partition {
struct
playlist
playlist
;
player_c
ontrol
pc
;
PlayerC
ontrol
pc
;
Partition
(
Instance
&
_instance
,
unsigned
max_length
,
...
...
src/PlayerControl.cxx
View file @
5b5675cc
...
...
@@ -27,7 +27,7 @@
#include <assert.h>
player_control
::
player_c
ontrol
(
unsigned
_buffer_chunks
,
PlayerControl
::
PlayerC
ontrol
(
unsigned
_buffer_chunks
,
unsigned
_buffered_before_play
)
:
buffer_chunks
(
_buffer_chunks
),
buffered_before_play
(
_buffered_before_play
),
...
...
@@ -50,7 +50,7 @@ player_control::player_control(unsigned _buffer_chunks,
{
}
player_control
::~
player_c
ontrol
()
PlayerControl
::~
PlayerC
ontrol
()
{
if
(
next_song
!=
nullptr
)
next_song
->
Free
();
...
...
@@ -60,7 +60,7 @@ player_control::~player_control()
}
void
player_c
ontrol
::
Play
(
Song
*
song
)
PlayerC
ontrol
::
Play
(
Song
*
song
)
{
assert
(
song
!=
nullptr
);
...
...
@@ -79,14 +79,14 @@ player_control::Play(Song *song)
}
void
player_c
ontrol
::
Cancel
()
PlayerC
ontrol
::
Cancel
()
{
LockSynchronousCommand
(
PlayerCommand
::
CANCEL
);
assert
(
next_song
==
nullptr
);
}
void
player_c
ontrol
::
Stop
()
PlayerC
ontrol
::
Stop
()
{
LockSynchronousCommand
(
PlayerCommand
::
CLOSE_AUDIO
);
assert
(
next_song
==
nullptr
);
...
...
@@ -95,13 +95,13 @@ player_control::Stop()
}
void
player_c
ontrol
::
UpdateAudio
()
PlayerC
ontrol
::
UpdateAudio
()
{
LockSynchronousCommand
(
PlayerCommand
::
UPDATE_AUDIO
);
}
void
player_c
ontrol
::
Kill
()
PlayerC
ontrol
::
Kill
()
{
assert
(
thread
.
IsDefined
());
...
...
@@ -112,7 +112,7 @@ player_control::Kill()
}
void
player_c
ontrol
::
PauseLocked
()
PlayerC
ontrol
::
PauseLocked
()
{
if
(
state
!=
PlayerState
::
STOP
)
{
SynchronousCommand
(
PlayerCommand
::
PAUSE
);
...
...
@@ -121,7 +121,7 @@ player_control::PauseLocked()
}
void
player_c
ontrol
::
Pause
()
PlayerC
ontrol
::
Pause
()
{
Lock
();
PauseLocked
();
...
...
@@ -129,7 +129,7 @@ player_control::Pause()
}
void
player_c
ontrol
::
SetPause
(
bool
pause_flag
)
PlayerC
ontrol
::
SetPause
(
bool
pause_flag
)
{
Lock
();
...
...
@@ -152,7 +152,7 @@ player_control::SetPause(bool pause_flag)
}
void
player_c
ontrol
::
SetBorderPause
(
bool
_border_pause
)
PlayerC
ontrol
::
SetBorderPause
(
bool
_border_pause
)
{
Lock
();
border_pause
=
_border_pause
;
...
...
@@ -160,7 +160,7 @@ player_control::SetBorderPause(bool _border_pause)
}
player_status
player_c
ontrol
::
GetStatus
()
PlayerC
ontrol
::
GetStatus
()
{
player_status
status
;
...
...
@@ -182,7 +182,7 @@ player_control::GetStatus()
}
void
player_c
ontrol
::
SetError
(
PlayerError
type
,
Error
&&
_error
)
PlayerC
ontrol
::
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_c
ontrol
::
ClearError
()
PlayerC
ontrol
::
ClearError
()
{
Lock
();
...
...
@@ -205,7 +205,7 @@ player_control::ClearError()
}
void
player_c
ontrol
::
LockSetTaggedSong
(
const
Song
&
song
)
PlayerC
ontrol
::
LockSetTaggedSong
(
const
Song
&
song
)
{
Lock
();
if
(
tagged_song
!=
nullptr
)
...
...
@@ -215,7 +215,7 @@ player_control::LockSetTaggedSong(const Song &song)
}
void
player_c
ontrol
::
ClearTaggedSong
()
PlayerC
ontrol
::
ClearTaggedSong
()
{
if
(
tagged_song
!=
nullptr
)
{
tagged_song
->
Free
();
...
...
@@ -224,7 +224,7 @@ player_control::ClearTaggedSong()
}
void
player_c
ontrol
::
EnqueueSong
(
Song
*
song
)
PlayerC
ontrol
::
EnqueueSong
(
Song
*
song
)
{
assert
(
song
!=
nullptr
);
...
...
@@ -234,7 +234,7 @@ player_control::EnqueueSong(Song *song)
}
bool
player_c
ontrol
::
Seek
(
Song
*
song
,
float
seek_time
)
PlayerC
ontrol
::
Seek
(
Song
*
song
,
float
seek_time
)
{
assert
(
song
!=
nullptr
);
...
...
@@ -256,7 +256,7 @@ player_control::Seek(Song *song, float seek_time)
}
void
player_c
ontrol
::
SetCrossFade
(
float
_cross_fade_seconds
)
PlayerC
ontrol
::
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_c
ontrol
::
SetMixRampDb
(
float
_mixramp_db
)
PlayerC
ontrol
::
SetMixRampDb
(
float
_mixramp_db
)
{
mixramp_db
=
_mixramp_db
;
...
...
@@ -274,7 +274,7 @@ player_control::SetMixRampDb(float _mixramp_db)
}
void
player_c
ontrol
::
SetMixRampDelay
(
float
_mixramp_delay_seconds
)
PlayerC
ontrol
::
SetMixRampDelay
(
float
_mixramp_delay_seconds
)
{
mixramp_delay_seconds
=
_mixramp_delay_seconds
;
...
...
src/PlayerControl.hxx
View file @
5b5675cc
...
...
@@ -50,18 +50,18 @@ enum class PlayerCommand : uint8_t {
*/
UPDATE_AUDIO
,
/**
player_c
ontrol.next_song has been updated */
/**
PlayerC
ontrol.next_song has been updated */
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
* stop
*/
CANCEL
,
/**
* Refresh status information in the #
player_c
ontrol struct,
* Refresh status information in the #
PlayerC
ontrol struct,
* e.g. elapsed_time.
*/
REFRESH
,
...
...
@@ -89,7 +89,7 @@ struct player_status {
float
elapsed_time
;
};
struct
player_c
ontrol
{
struct
PlayerC
ontrol
{
unsigned
buffer_chunks
;
unsigned
int
buffered_before_play
;
...
...
@@ -169,9 +169,9 @@ struct player_control {
*/
bool
border_pause
;
player_c
ontrol
(
unsigned
buffer_chunks
,
PlayerC
ontrol
(
unsigned
buffer_chunks
,
unsigned
buffered_before_play
);
~
player_c
ontrol
();
~
PlayerC
ontrol
();
/**
* Locks the object.
...
...
src/PlayerThread.cxx
View file @
5b5675cc
...
...
@@ -51,7 +51,7 @@ enum class CrossFadeState : int8_t {
};
class
Player
{
player_c
ontrol
&
pc
;
PlayerC
ontrol
&
pc
;
DecoderControl
&
dc
;
...
...
@@ -130,7 +130,7 @@ class Player {
float
elapsed_time
;
public
:
Player
(
player_c
ontrol
&
_pc
,
DecoderControl
&
_dc
,
Player
(
PlayerC
ontrol
&
_pc
,
DecoderControl
&
_dc
,
MusicBuffer
&
_buffer
)
:
pc
(
_pc
),
dc
(
_dc
),
buffer
(
_buffer
),
buffering
(
false
),
...
...
@@ -275,7 +275,7 @@ public:
};
static
void
player_command_finished
(
player_c
ontrol
&
pc
)
player_command_finished
(
PlayerC
ontrol
&
pc
)
{
pc
.
Lock
();
pc
.
CommandFinished
();
...
...
@@ -349,7 +349,7 @@ Player::WaitForDecoder()
pc
.
Lock
();
/* update
player_c
ontrol's song information */
/* update
PlayerC
ontrol'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_c
ontrol
&
pc
,
Song
*
song
,
const
Tag
&
new_tag
)
update_song_tag
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
play_chunk
(
PlayerC
ontrol
&
pc
,
Song
*
song
,
struct
music_chunk
*
chunk
,
MusicBuffer
&
buffer
,
const
AudioFormat
format
,
...
...
@@ -1095,7 +1095,7 @@ Player::Run()
}
static
void
do_play
(
player_c
ontrol
&
pc
,
DecoderControl
&
dc
,
do_play
(
PlayerC
ontrol
&
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_c
ontrol
*
)
arg
;
PlayerControl
&
pc
=
*
(
PlayerC
ontrol
*
)
arg
;
DecoderControl
dc
;
decoder_thread_start
(
dc
);
...
...
@@ -1193,7 +1193,7 @@ player_task(void *arg)
}
void
player_create
(
player_c
ontrol
&
pc
)
player_create
(
PlayerC
ontrol
&
pc
)
{
assert
(
!
pc
.
thread
.
IsDefined
());
...
...
src/PlayerThread.hxx
View file @
5b5675cc
...
...
@@ -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_c
ontrol
;
struct
PlayerC
ontrol
;
void
player_create
(
player_c
ontrol
&
pc
);
player_create
(
PlayerC
ontrol
&
pc
);
#endif
src/Playlist.cxx
View file @
5b5675cc
...
...
@@ -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_c
ontrol
&
pc
,
playlist_queue_song_order
(
playlist
&
playlist
,
PlayerC
ontrol
&
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_c
ontrol
&
pc
)
playlist_song_started
(
playlist
&
playlist
,
PlayerC
ontrol
&
pc
)
{
assert
(
pc
.
next_song
==
nullptr
);
assert
(
playlist
.
queued
>=
-
1
);
...
...
@@ -98,7 +98,7 @@ playlist::GetQueuedSong() const
}
void
playlist
::
UpdateQueuedSong
(
player_c
ontrol
&
pc
,
const
Song
*
prev
)
playlist
::
UpdateQueuedSong
(
PlayerC
ontrol
&
pc
,
const
Song
*
prev
)
{
if
(
!
playing
)
return
;
...
...
@@ -144,7 +144,7 @@ playlist::UpdateQueuedSong(player_control &pc, const Song *prev)
}
void
playlist
::
PlayOrder
(
player_c
ontrol
&
pc
,
int
order
)
playlist
::
PlayOrder
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
);
playlist_resume_playback
(
playlist
&
playlist
,
PlayerC
ontrol
&
pc
);
void
playlist
::
SyncWithPlayer
(
player_c
ontrol
&
pc
)
playlist
::
SyncWithPlayer
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
)
playlist_resume_playback
(
playlist
&
playlist
,
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
bool
status
)
playlist
::
SetRepeat
(
PlayerC
ontrol
&
pc
,
bool
status
)
{
if
(
status
==
queue
.
repeat
)
return
;
...
...
@@ -255,7 +255,7 @@ playlist_order(playlist &playlist)
}
void
playlist
::
SetSingle
(
player_c
ontrol
&
pc
,
bool
status
)
playlist
::
SetSingle
(
PlayerC
ontrol
&
pc
,
bool
status
)
{
if
(
status
==
queue
.
single
)
return
;
...
...
@@ -282,7 +282,7 @@ playlist::SetConsume(bool status)
}
void
playlist
::
SetRandom
(
player_c
ontrol
&
pc
,
bool
status
)
playlist
::
SetRandom
(
PlayerC
ontrol
&
pc
,
bool
status
)
{
if
(
status
==
queue
.
random
)
return
;
...
...
src/Playlist.hxx
View file @
5b5675cc
...
...
@@ -23,7 +23,7 @@
#include "Queue.hxx"
#include "PlaylistError.hxx"
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
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_c
ontrol
&
pc
);
void
SyncWithPlayer
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
const
Song
*
prev
);
void
UpdateQueuedSong
(
PlayerC
ontrol
&
pc
,
const
Song
*
prev
);
public
:
void
Clear
(
player_c
ontrol
&
pc
);
void
Clear
(
PlayerC
ontrol
&
pc
);
/**
* A tag in the play queue has been modified by the player
...
...
@@ -140,7 +140,7 @@ public:
*/
void
DatabaseModified
();
PlaylistResult
AppendSong
(
player_c
ontrol
&
pc
,
PlaylistResult
AppendSong
(
PlayerC
ontrol
&
pc
,
Song
*
song
,
unsigned
*
added_id
=
nullptr
);
...
...
@@ -150,28 +150,28 @@ public:
*
* Note: the caller is responsible for checking permissions.
*/
PlaylistResult
AppendFile
(
player_c
ontrol
&
pc
,
PlaylistResult
AppendFile
(
PlayerC
ontrol
&
pc
,
const
char
*
path_utf8
,
unsigned
*
added_id
=
nullptr
);
PlaylistResult
AppendURI
(
player_c
ontrol
&
pc
,
PlaylistResult
AppendURI
(
PlayerC
ontrol
&
pc
,
const
char
*
uri_utf8
,
unsigned
*
added_id
=
nullptr
);
protected
:
void
DeleteInternal
(
player_c
ontrol
&
pc
,
void
DeleteInternal
(
PlayerC
ontrol
&
pc
,
unsigned
song
,
const
Song
**
queued_p
);
public
:
PlaylistResult
DeletePosition
(
player_c
ontrol
&
pc
,
PlaylistResult
DeletePosition
(
PlayerC
ontrol
&
pc
,
unsigned
position
);
PlaylistResult
DeleteOrder
(
player_c
ontrol
&
pc
,
PlaylistResult
DeleteOrder
(
PlayerC
ontrol
&
pc
,
unsigned
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.
...
...
@@ -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_c
ontrol
&
pc
,
PlaylistResult
DeleteRange
(
PlayerC
ontrol
&
pc
,
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
);
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
);
PlaylistResult
SwapIds
(
player_c
ontrol
&
pc
,
PlaylistResult
SwapIds
(
PlayerC
ontrol
&
pc
,
unsigned
id1
,
unsigned
id2
);
PlaylistResult
SetPriorityRange
(
player_c
ontrol
&
pc
,
PlaylistResult
SetPriorityRange
(
PlayerC
ontrol
&
pc
,
unsigned
start_position
,
unsigned
end_position
,
uint8_t
priority
);
PlaylistResult
SetPriorityId
(
player_c
ontrol
&
pc
,
PlaylistResult
SetPriorityId
(
PlayerC
ontrol
&
pc
,
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
,
float
seek_time
);
PlaylistResult
SeekSongId
(
player_c
ontrol
&
pc
,
PlaylistResult
SeekSongId
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
PlaylistResult
SeekCurrent
(
PlayerC
ontrol
&
pc
,
float
seek_time
,
bool
relative
);
bool
GetRepeat
()
const
{
return
queue
.
repeat
;
}
void
SetRepeat
(
player_c
ontrol
&
pc
,
bool
new_value
);
void
SetRepeat
(
PlayerC
ontrol
&
pc
,
bool
new_value
);
bool
GetRandom
()
const
{
return
queue
.
random
;
}
void
SetRandom
(
player_c
ontrol
&
pc
,
bool
new_value
);
void
SetRandom
(
PlayerC
ontrol
&
pc
,
bool
new_value
);
bool
GetSingle
()
const
{
return
queue
.
single
;
}
void
SetSingle
(
player_c
ontrol
&
pc
,
bool
new_value
);
void
SetSingle
(
PlayerC
ontrol
&
pc
,
bool
new_value
);
bool
GetConsume
()
const
{
return
queue
.
consume
;
...
...
src/PlaylistControl.cxx
View file @
5b5675cc
...
...
@@ -30,7 +30,7 @@
#include "Log.hxx"
void
playlist
::
Stop
(
player_c
ontrol
&
pc
)
playlist
::
Stop
(
PlayerC
ontrol
&
pc
)
{
if
(
!
playing
)
return
;
...
...
@@ -57,7 +57,7 @@ playlist::Stop(player_control &pc)
}
PlaylistResult
playlist
::
PlayPosition
(
player_c
ontrol
&
pc
,
int
song
)
playlist
::
PlayPosition
(
PlayerC
ontrol
&
pc
,
int
song
)
{
pc
.
ClearError
();
...
...
@@ -107,7 +107,7 @@ playlist::PlayPosition(player_control &pc, int song)
}
PlaylistResult
playlist
::
PlayId
(
player_c
ontrol
&
pc
,
int
id
)
playlist
::
PlayId
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
)
playlist
::
PlayNext
(
PlayerC
ontrol
&
pc
)
{
if
(
!
playing
)
return
;
...
...
@@ -166,7 +166,7 @@ playlist::PlayNext(player_control &pc)
}
void
playlist
::
PlayPrevious
(
player_c
ontrol
&
pc
)
playlist
::
PlayPrevious
(
PlayerC
ontrol
&
pc
)
{
if
(
!
playing
)
return
;
...
...
@@ -190,7 +190,7 @@ playlist::PlayPrevious(player_control &pc)
}
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
))
return
PlaylistResult
::
BAD_RANGE
;
...
...
@@ -229,7 +229,7 @@ playlist::SeekSongPosition(player_control &pc, unsigned song, float seek_time)
}
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
);
if
(
song
<
0
)
...
...
@@ -239,7 +239,7 @@ playlist::SeekSongId(player_control &pc, unsigned id, float seek_time)
}
PlaylistResult
playlist
::
SeekCurrent
(
player_c
ontrol
&
pc
,
float
seek_time
,
bool
relative
)
playlist
::
SeekCurrent
(
PlayerC
ontrol
&
pc
,
float
seek_time
,
bool
relative
)
{
if
(
!
playing
)
return
PlaylistResult
::
NOT_PLAYING
;
...
...
src/PlaylistEdit.cxx
View file @
5b5675cc
...
...
@@ -46,7 +46,7 @@ playlist::OnModified()
}
void
playlist
::
Clear
(
player_c
ontrol
&
pc
)
playlist
::
Clear
(
PlayerC
ontrol
&
pc
)
{
Stop
(
pc
);
...
...
@@ -57,7 +57,7 @@ playlist::Clear(player_control &pc)
}
PlaylistResult
playlist
::
AppendFile
(
struct
player_c
ontrol
&
pc
,
playlist
::
AppendFile
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
playlist
::
AppendSong
(
PlayerC
ontrol
&
pc
,
Song
*
song
,
unsigned
*
added_id
)
{
unsigned
id
;
...
...
@@ -105,7 +105,7 @@ playlist::AppendSong(struct player_control &pc,
}
PlaylistResult
playlist
::
AppendURI
(
struct
player_c
ontrol
&
pc
,
playlist
::
AppendURI
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
unsigned
song1
,
unsigned
song2
)
playlist
::
SwapPositions
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
unsigned
id1
,
unsigned
id2
)
playlist
::
SwapIds
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
playlist
::
SetPriorityRange
(
PlayerC
ontrol
&
pc
,
unsigned
start
,
unsigned
end
,
uint8_t
priority
)
{
...
...
@@ -211,7 +211,7 @@ playlist::SetPriorityRange(player_control &pc,
}
PlaylistResult
playlist
::
SetPriorityId
(
struct
player_c
ontrol
&
pc
,
playlist
::
SetPriorityId
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
playlist
::
DeleteInternal
(
PlayerC
ontrol
&
pc
,
unsigned
song
,
const
Song
**
queued_p
)
{
assert
(
song
<
GetLength
());
...
...
@@ -270,7 +270,7 @@ playlist::DeleteInternal(player_control &pc,
}
PlaylistResult
playlist
::
DeletePosition
(
struct
player_c
ontrol
&
pc
,
unsigned
song
)
playlist
::
DeletePosition
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
unsigned
start
,
unsigned
end
)
playlist
::
DeleteRange
(
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
unsigned
id
)
playlist
::
DeleteId
(
PlayerC
ontrol
&
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_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
)
if
(
SongEquals
(
song
,
queue
.
Get
(
i
)))
...
...
@@ -328,7 +328,7 @@ playlist::DeleteSong(struct player_control &pc, const struct Song &song)
}
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
))
return
PlaylistResult
::
BAD_RANGE
;
...
...
@@ -381,7 +381,7 @@ playlist::MoveRange(player_control &pc, unsigned start, unsigned end, int to)
}
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
);
if
(
song
<
0
)
...
...
@@ -391,7 +391,7 @@ playlist::MoveId(player_control &pc, unsigned id1, int to)
}
void
playlist
::
Shuffle
(
player_c
ontrol
&
pc
,
unsigned
start
,
unsigned
end
)
playlist
::
Shuffle
(
PlayerC
ontrol
&
pc
,
unsigned
start
,
unsigned
end
)
{
if
(
end
>
GetLength
())
/* correct the "end" offset */
...
...
src/PlaylistQueue.cxx
View file @
5b5675cc
...
...
@@ -32,7 +32,7 @@
PlaylistResult
playlist_load_into_queue
(
const
char
*
uri
,
SongEnumerator
&
e
,
unsigned
start_index
,
unsigned
end_index
,
playlist
&
dest
,
player_c
ontrol
&
pc
,
playlist
&
dest
,
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
playlist
&
dest
,
PlayerC
ontrol
&
pc
,
bool
secure
)
{
Mutex
mutex
;
...
...
src/PlaylistQueue.hxx
View file @
5b5675cc
...
...
@@ -28,7 +28,7 @@
class
SongEnumerator
;
struct
playlist
;
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
/**
* 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_c
ontrol
&
pc
,
playlist
&
dest
,
PlayerC
ontrol
&
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_c
ontrol
&
pc
,
playlist
&
dest
,
PlayerC
ontrol
&
pc
,
bool
secure
);
#endif
...
...
src/PlaylistSave.cxx
View file @
5b5675cc
...
...
@@ -101,7 +101,7 @@ spl_save_playlist(const char *name_utf8, const playlist &playlist)
}
bool
playlist_load_spl
(
struct
playlist
&
playlist
,
player_c
ontrol
&
pc
,
playlist_load_spl
(
struct
playlist
&
playlist
,
PlayerC
ontrol
&
pc
,
const
char
*
name_utf8
,
unsigned
start_index
,
unsigned
end_index
,
Error
&
error
)
...
...
src/PlaylistSave.hxx
View file @
5b5675cc
...
...
@@ -27,7 +27,7 @@
struct
Song
;
struct
queue
;
struct
playlist
;
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
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_c
ontrol
&
pc
,
playlist_load_spl
(
struct
playlist
&
playlist
,
PlayerC
ontrol
&
pc
,
const
char
*
name_utf8
,
unsigned
start_index
,
unsigned
end_index
,
Error
&
error
);
...
...
src/PlaylistState.cxx
View file @
5b5675cc
...
...
@@ -60,7 +60,7 @@
void
playlist_state_save
(
FILE
*
fp
,
const
struct
playlist
&
playlist
,
player_c
ontrol
&
pc
)
PlayerC
ontrol
&
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_c
ontrol
&
pc
)
struct
playlist
&
playlist
,
PlayerC
ontrol
&
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_c
ontrol
&
pc
)
PlayerC
ontrol
&
pc
)
{
const
auto
player_status
=
pc
.
GetStatus
();
...
...
src/PlaylistState.hxx
View file @
5b5675cc
...
...
@@ -28,16 +28,16 @@
#include <stdio.h>
struct
playlist
;
struct
player_c
ontrol
;
struct
PlayerC
ontrol
;
class
TextFile
;
void
playlist_state_save
(
FILE
*
fp
,
const
struct
playlist
&
playlist
,
player_c
ontrol
&
pc
);
PlayerC
ontrol
&
pc
);
bool
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
...
...
@@ -47,6 +47,6 @@ playlist_state_restore(const char *line, TextFile &file,
*/
unsigned
playlist_state_get_hash
(
const
struct
playlist
&
playlist
,
player_c
ontrol
&
c
);
PlayerC
ontrol
&
c
);
#endif
test/run_output.cxx
View file @
5b5675cc
...
...
@@ -72,9 +72,9 @@ find_named_config_block(ConfigOption option, const char *name)
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
)
{}
player_control
::~
player_c
ontrol
()
{}
PlayerControl
::~
PlayerC
ontrol
()
{}
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_c
ontrol
dummy_player_control
(
32
,
4
);
static
struct
PlayerC
ontrol
dummy_player_control
(
32
,
4
);
Error
error
;
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