Client: replace playlist and player_control with getter methods
Prepare to convert "partition" to a mutable pointer.
This commit is contained in:
@@ -25,6 +25,18 @@
|
||||
|
||||
const Domain client_domain("client");
|
||||
|
||||
playlist &
|
||||
Client::GetPlaylist()
|
||||
{
|
||||
return partition.playlist;
|
||||
}
|
||||
|
||||
PlayerControl &
|
||||
Client::GetPlayerControl()
|
||||
{
|
||||
return partition.pc;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DATABASE
|
||||
|
||||
const Database *
|
||||
|
@@ -41,6 +41,8 @@ class SocketAddress;
|
||||
class EventLoop;
|
||||
class Path;
|
||||
struct Partition;
|
||||
struct PlayerControl;
|
||||
struct playlist;
|
||||
class Database;
|
||||
class Storage;
|
||||
|
||||
@@ -49,8 +51,6 @@ class Client final
|
||||
public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>> {
|
||||
public:
|
||||
Partition &partition;
|
||||
struct playlist &playlist;
|
||||
struct PlayerControl &player_control;
|
||||
|
||||
unsigned permission;
|
||||
|
||||
@@ -187,6 +187,12 @@ public:
|
||||
*/
|
||||
void AllowFile(Path path_fs) const;
|
||||
|
||||
gcc_pure
|
||||
playlist &GetPlaylist();
|
||||
|
||||
gcc_pure
|
||||
PlayerControl &GetPlayerControl();
|
||||
|
||||
/**
|
||||
* Wrapper for Instance::GetDatabase().
|
||||
*/
|
||||
|
@@ -46,7 +46,6 @@ Client::Client(EventLoop &_loop, Partition &_partition,
|
||||
:FullyBufferedSocket(_fd, _loop, 16384, client_max_output_buffer_size),
|
||||
TimeoutMonitor(_loop),
|
||||
partition(_partition),
|
||||
playlist(partition.playlist), player_control(partition.pc),
|
||||
permission(getDefaultPermissions()),
|
||||
uid(_uid),
|
||||
num(_num),
|
||||
|
Reference in New Issue
Block a user