diff options
author | Max Kellermann <max@musicpd.org> | 2018-07-17 22:11:57 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-07-17 22:11:57 +0200 |
commit | d6b0ecac1b9a6c5ea95fc45aa546ce990f21cdf0 (patch) | |
tree | fffe3a86c751eeff98f432d0a71e4641ea90e343 /test | |
parent | 61a119b607e082978f7e8695cba22867253129bc (diff) |
test/run_filter: use struct ConfigData
Diffstat (limited to 'test')
-rw-r--r-- | test/run_filter.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/run_filter.cxx b/test/run_filter.cxx index 8cd144c8e..fef36b4c0 100644 --- a/test/run_filter.cxx +++ b/test/run_filter.cxx @@ -19,7 +19,8 @@ #include "config.h" #include "config/Param.hxx" -#include "config/Global.hxx" +#include "config/Data.hxx" +#include "config/File.hxx" #include "fs/Path.hxx" #include "AudioParser.hxx" #include "AudioFormat.hxx" @@ -50,10 +51,10 @@ mixer_set_volume(gcc_unused Mixer *mixer, } static std::unique_ptr<PreparedFilter> -load_filter(const char *name) +LoadFilter(const ConfigData &config, const char *name) { - const auto *param = config_find_block(ConfigBlockOption::AUDIO_FILTER, - "name", name); + const auto *param = config.FindBlock(ConfigBlockOption::AUDIO_FILTER, + "name", name); if (param == NULL) throw FormatRuntimeError("No such configured filter: %s", name); @@ -76,8 +77,8 @@ try { /* read configuration file (mpd.conf) */ - config_global_init(); - ReadConfigFile(config_path); + ConfigData config; + ReadConfigFile(config, config_path); /* parse the audio format */ @@ -86,7 +87,7 @@ try { /* initialize the filter */ - auto prepared_filter = load_filter(argv[2]); + auto prepared_filter = LoadFilter(config, argv[2]); /* open the filter */ @@ -118,8 +119,6 @@ try { /* cleanup and exit */ - config_global_finish(); - return EXIT_SUCCESS; } catch (...) { PrintException(std::current_exception()); |