filter/LoadChain: use struct ConfigData
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include "plugins/ChainFilterPlugin.hxx"
|
||||
#include "config/Param.hxx"
|
||||
#include "config/Option.hxx"
|
||||
#include "config/Global.hxx"
|
||||
#include "config/Data.hxx"
|
||||
#include "config/Domain.hxx"
|
||||
#include "config/Block.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
@@ -34,10 +34,11 @@
|
||||
#include <string.h>
|
||||
|
||||
static void
|
||||
filter_chain_append_new(PreparedFilter &chain, const char *template_name)
|
||||
filter_chain_append_new(PreparedFilter &chain, const ConfigData &config,
|
||||
const char *template_name)
|
||||
{
|
||||
const auto *cfg = config_find_block(ConfigBlockOption::AUDIO_FILTER,
|
||||
"name", template_name);
|
||||
const auto *cfg = config.FindBlock(ConfigBlockOption::AUDIO_FILTER,
|
||||
"name", template_name);
|
||||
if (cfg == nullptr)
|
||||
throw FormatRuntimeError("Filter template not found: %s",
|
||||
template_name);
|
||||
@@ -53,7 +54,9 @@ filter_chain_append_new(PreparedFilter &chain, const char *template_name)
|
||||
}
|
||||
|
||||
void
|
||||
filter_chain_parse(PreparedFilter &chain, const char *spec)
|
||||
filter_chain_parse(PreparedFilter &chain,
|
||||
const ConfigData &config,
|
||||
const char *spec)
|
||||
{
|
||||
const char *const end = spec + strlen(spec);
|
||||
|
||||
@@ -61,7 +64,7 @@ filter_chain_parse(PreparedFilter &chain, const char *spec)
|
||||
const char *comma = std::find(spec, end, ',');
|
||||
if (comma > spec) {
|
||||
const std::string name(spec, comma);
|
||||
filter_chain_append_new(chain, name.c_str());
|
||||
filter_chain_append_new(chain, config, name.c_str());
|
||||
}
|
||||
|
||||
if (comma == end)
|
||||
|
||||
Reference in New Issue
Block a user