config: allow configuring partitions
This just allows creating empty partitions. More features to come.
This commit is contained in:
@@ -410,6 +410,15 @@ MainConfigured(const CommandLineOptions &options,
|
||||
partition.UpdateEffectiveReplayGainMode();
|
||||
}
|
||||
|
||||
raw_config.WithEach(ConfigBlockOption::PARTITION, [&](const auto &block){
|
||||
const char *name = block.GetBlockValue("name");
|
||||
if (name == nullptr)
|
||||
throw std::runtime_error("Missing 'name'");
|
||||
|
||||
instance.partitions.emplace_back(instance, name,
|
||||
partition_config);
|
||||
});
|
||||
|
||||
client_manager_init(raw_config);
|
||||
const ScopeInputPluginsInit input_plugins_init(raw_config,
|
||||
instance.io_thread.GetEventLoop());
|
||||
|
@@ -97,6 +97,7 @@ enum class ConfigBlockOption {
|
||||
AUDIO_FILTER,
|
||||
DATABASE,
|
||||
NEIGHBORS,
|
||||
PARTITION,
|
||||
MAX
|
||||
};
|
||||
|
||||
|
@@ -96,6 +96,7 @@ const ConfigTemplate config_block_templates[] = {
|
||||
{ "filter", true },
|
||||
{ "database" },
|
||||
{ "neighbors", true },
|
||||
{ "partition", true },
|
||||
};
|
||||
|
||||
static constexpr unsigned n_config_block_templates =
|
||||
|
Reference in New Issue
Block a user