aboutsummaryrefslogtreecommitdiffstats
path: root/src/ClientNew.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-04 23:07:11 +0100
committerMax Kellermann <max@duempel.org>2013-01-04 23:07:11 +0100
commitfe8e77e556999fcaeaab1bb4a3555fd72529e2e0 (patch)
tree05e7c25e2d78dd9fe32bc5f403040b99cbb85797 /src/ClientNew.cxx
parentb0833084a6e8f13faead5dfda92786a2b0f9e02e (diff)
downloadmpd-fe8e77e556999fcaeaab1bb4a3555fd72529e2e0.tar.gz
mpd-fe8e77e556999fcaeaab1bb4a3555fd72529e2e0.tar.xz
mpd-fe8e77e556999fcaeaab1bb4a3555fd72529e2e0.zip
Client: add "playlist" attribute
Reduce access to the global variable "g_playlist".
Diffstat (limited to '')
-rw-r--r--src/ClientNew.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ClientNew.cxx b/src/ClientNew.cxx
index d6409eb90..1579b9a53 100644
--- a/src/ClientNew.cxx
+++ b/src/ClientNew.cxx
@@ -45,9 +45,10 @@ extern "C" {
static const char GREETING[] = "OK MPD " PROTOCOL_VERSION "\n";
-Client::Client(struct player_control *_player_control,
+Client::Client(struct playlist &_playlist,
+ struct player_control *_player_control,
int fd, int _uid, int _num)
- :player_control(_player_control),
+ :playlist(_playlist), player_control(_player_control),
input(fifo_buffer_new(4096)),
permission(getDefaultPermissions()),
uid(_uid),
@@ -93,7 +94,7 @@ Client::~Client()
}
void
-client_new(struct player_control *player_control,
+client_new(struct playlist &playlist, struct player_control *player_control,
int fd, const struct sockaddr *sa, size_t sa_length, int uid)
{
static unsigned int next_client_num;
@@ -133,7 +134,7 @@ client_new(struct player_control *player_control,
return;
}
- Client *client = new Client(player_control, fd, uid,
+ Client *client = new Client(playlist, player_control, fd, uid,
next_client_num++);
(void)send(fd, GREETING, sizeof(GREETING) - 1, 0);