Client: replace playlist and player_control with getter methods

Prepare to convert "partition" to a mutable pointer.
This commit is contained in:
Max Kellermann
2017-02-20 12:44:09 +01:00
parent 71ce1a25dd
commit 668724de4e
7 changed files with 54 additions and 33 deletions

View File

@@ -164,8 +164,8 @@ handle_rangeid(Client &client, Request args, Response &r)
return CommandResult::ERROR;
}
client.partition.playlist.SetSongIdRange(client.partition.pc,
id, start, end);
client.GetPlaylist().SetSongIdRange(client.GetPlayerControl(),
id, start, end);
return CommandResult::OK;
}
@@ -188,7 +188,7 @@ handle_deleteid(Client &client, Request args, gcc_unused Response &r)
CommandResult
handle_playlist(Client &client, gcc_unused Request args, Response &r)
{
playlist_print_uris(r, client.playlist);
playlist_print_uris(r, client.GetPlaylist());
return CommandResult::OK;
}
@@ -212,7 +212,7 @@ handle_plchanges(Client &client, Request args, Response &r)
{
uint32_t version = ParseCommandArgU32(args.front());
RangeArg range = args.ParseOptional(1, RangeArg::All());
playlist_print_changes_info(r, client.playlist, version,
playlist_print_changes_info(r, client.GetPlaylist(), version,
range.start, range.end);
return CommandResult::OK;
}
@@ -222,7 +222,7 @@ handle_plchangesposid(Client &client, Request args, Response &r)
{
uint32_t version = ParseCommandArgU32(args.front());
RangeArg range = args.ParseOptional(1, RangeArg::All());
playlist_print_changes_position(r, client.playlist, version,
playlist_print_changes_position(r, client.GetPlaylist(), version,
range.start, range.end);
return CommandResult::OK;
}
@@ -232,7 +232,7 @@ handle_playlistinfo(Client &client, Request args, Response &r)
{
RangeArg range = args.ParseOptional(0, RangeArg::All());
playlist_print_info(r, client.playlist,
playlist_print_info(r, client.GetPlaylist(),
range.start, range.end);
return CommandResult::OK;
}
@@ -242,9 +242,9 @@ handle_playlistid(Client &client, Request args, Response &r)
{
if (!args.IsEmpty()) {
unsigned id = args.ParseUnsigned(0);
playlist_print_id(r, client.playlist, id);
playlist_print_id(r, client.GetPlaylist(), id);
} else {
playlist_print_info(r, client.playlist,
playlist_print_info(r, client.GetPlaylist(),
0, std::numeric_limits<unsigned>::max());
}
@@ -261,7 +261,7 @@ handle_playlist_match(Client &client, Request args, Response &r,
return CommandResult::ERROR;
}
playlist_print_find(r, client.playlist, filter);
playlist_print_find(r, client.GetPlaylist(), filter);
return CommandResult::OK;
}