Commit c335f18b authored by Max Kellermann's avatar Max Kellermann

Partition: add "name" attribute

parent 7dc3e737
......@@ -353,6 +353,7 @@ initialize_decoder_and_player(const ReplayGainConfig &replay_gain_config)
}
instance->partition = new Partition(*instance,
"default",
max_length,
buffered_chunks,
buffered_before_play,
......
......@@ -25,12 +25,14 @@
#include "IdleFlags.hxx"
Partition::Partition(Instance &_instance,
const char *_name,
unsigned max_length,
unsigned buffer_chunks,
unsigned buffered_before_play,
AudioFormat configured_audio_format,
const ReplayGainConfig &replay_gain_config)
:instance(_instance),
name(_name),
global_events(instance.event_loop, BIND_THIS_METHOD(OnGlobalEvent)),
playlist(max_length, *this),
outputs(*this),
......
......@@ -31,6 +31,8 @@
#include "Chrono.hxx"
#include "Compiler.h"
#include <string>
struct Instance;
class MultipleOutputs;
class SongLoader;
......@@ -45,6 +47,8 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
Instance &instance;
const std::string name;
MaskMonitor global_events;
struct playlist playlist;
......@@ -56,6 +60,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
Partition(Instance &_instance,
const char *_name,
unsigned max_length,
unsigned buffer_chunks,
unsigned buffered_before_play,
......
......@@ -20,11 +20,13 @@
#include "config.h"
#include "PartitionCommands.hxx"
#include "Request.hxx"
#include "Partition.hxx"
#include "client/Client.hxx"
#include "client/Response.hxx"
CommandResult
handle_listpartitions(Client &, Request, Response &r)
handle_listpartitions(Client &client, Request, Response &r)
{
r.Write("partition: default\n");
r.Format("partition: %s\n", client.partition.name.c_str());
return CommandResult::OK;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment