aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-01-21 22:13:44 +0100
committerMax Kellermann <max@duempel.org>2015-01-21 23:56:33 +0100
commit4fa5538e2bed36903b403e1aaee2462d22b456dc (patch)
tree292b66e10e6b97e2363fde34a81c027a67d3a9fe /test
parent84e74173de85a3897cfe67150297987f8c8bf52e (diff)
downloadmpd-4fa5538e2bed36903b403e1aaee2462d22b456dc.tar.gz
mpd-4fa5538e2bed36903b403e1aaee2462d22b456dc.tar.xz
mpd-4fa5538e2bed36903b403e1aaee2462d22b456dc.zip
config/Param: split block-specific attributes to new struct ConfigBlock
The old struct config_param remains only for top-level string options.
Diffstat (limited to 'test')
-rw-r--r--test/DumpDatabase.cxx7
-rw-r--r--test/read_mixer.cxx4
-rw-r--r--test/run_encoder.cxx8
-rw-r--r--test/run_filter.cxx4
-rw-r--r--test/run_output.cxx4
-rw-r--r--test/test_vorbis_encoder.cxx8
6 files changed, 18 insertions, 17 deletions
diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx
index 4c5372694..4f00006c7 100644
--- a/test/DumpDatabase.cxx
+++ b/test/DumpDatabase.cxx
@@ -28,6 +28,7 @@
#include "db/PlaylistVector.hxx"
#include "config/ConfigGlobal.hxx"
#include "config/Param.hxx"
+#include "config/Block.hxx"
#include "tag/TagConfig.hxx"
#include "fs/Path.hxx"
#include "event/Loop.hxx"
@@ -121,12 +122,12 @@ main(int argc, char **argv)
/* do it */
const auto *path = config_get_param(ConfigOption::DB_FILE);
- config_param param("database", path != nullptr ? path->line : -1);
+ ConfigBlock block(path != nullptr ? path->line : -1);
if (path != nullptr)
- param.AddBlockParam("path", path->value.c_str(), path->line);
+ block.AddBlockParam("path", path->value.c_str(), path->line);
Database *db = plugin->create(event_loop, database_listener,
- param, error);
+ block, error);
if (db == nullptr) {
cerr << error.GetMessage() << endl;
diff --git a/test/read_mixer.cxx b/test/read_mixer.cxx
index a94462ca3..9c6b31307 100644
--- a/test/read_mixer.cxx
+++ b/test/read_mixer.cxx
@@ -24,7 +24,7 @@
#include "pcm/Volume.hxx"
#include "Main.hxx"
#include "event/Loop.hxx"
-#include "config/Param.hxx"
+#include "config/Block.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
@@ -54,7 +54,7 @@ int main(int argc, gcc_unused char **argv)
Mixer *mixer = mixer_new(event_loop, alsa_mixer_plugin,
*(AudioOutput *)nullptr,
*(MixerListener *)nullptr,
- config_param(), error);
+ ConfigBlock(), error);
if (mixer == NULL) {
LogError(error, "mixer_new() failed");
return EXIT_FAILURE;
diff --git a/test/run_encoder.cxx b/test/run_encoder.cxx
index 04f0f07df..307d1b73d 100644
--- a/test/run_encoder.cxx
+++ b/test/run_encoder.cxx
@@ -24,7 +24,7 @@
#include "encoder/ToOutputStream.hxx"
#include "AudioFormat.hxx"
#include "AudioParser.hxx"
-#include "config/Param.hxx"
+#include "config/Block.hxx"
#include "fs/io/StdioOutputStream.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
@@ -60,11 +60,11 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
- config_param param;
- param.AddBlockParam("quality", "5.0", -1);
+ ConfigBlock block;
+ block.AddBlockParam("quality", "5.0", -1);
Error error;
- const auto encoder = encoder_init(*plugin, param, error);
+ const auto encoder = encoder_init(*plugin, block, error);
if (encoder == NULL) {
LogError(error, "Failed to initialize encoder");
return EXIT_FAILURE;
diff --git a/test/run_filter.cxx b/test/run_filter.cxx
index 04a722f9c..d743937d5 100644
--- a/test/run_filter.cxx
+++ b/test/run_filter.cxx
@@ -50,8 +50,8 @@ mixer_set_volume(gcc_unused Mixer *mixer,
static Filter *
load_filter(const char *name)
{
- const config_param *param =
- config_find_block(ConfigOption::AUDIO_FILTER, "name", name);
+ const auto *param = config_find_block(ConfigBlockOption::AUDIO_FILTER,
+ "name", name);
if (param == NULL) {
fprintf(stderr, "No such configured filter: %s\n", name);
return nullptr;
diff --git a/test/run_output.cxx b/test/run_output.cxx
index d013a9d54..88d9491dd 100644
--- a/test/run_output.cxx
+++ b/test/run_output.cxx
@@ -61,8 +61,8 @@ PlayerControl::~PlayerControl() {}
static AudioOutput *
load_audio_output(EventLoop &event_loop, const char *name)
{
- const config_param *param =
- config_find_block(ConfigOption::AUDIO_OUTPUT, "name", name);
+ const auto *param = config_find_block(ConfigBlockOption::AUDIO_OUTPUT,
+ "name", name);
if (param == NULL) {
fprintf(stderr, "No such configured audio output: %s\n", name);
return nullptr;
diff --git a/test/test_vorbis_encoder.cxx b/test/test_vorbis_encoder.cxx
index 8d3e4bd8a..81b7b1cbe 100644
--- a/test/test_vorbis_encoder.cxx
+++ b/test/test_vorbis_encoder.cxx
@@ -23,7 +23,7 @@
#include "encoder/EncoderInterface.hxx"
#include "encoder/ToOutputStream.hxx"
#include "AudioFormat.hxx"
-#include "config/Param.hxx"
+#include "config/Block.hxx"
#include "fs/io/StdioOutputStream.hxx"
#include "tag/Tag.hxx"
#include "tag/TagBuilder.hxx"
@@ -45,10 +45,10 @@ main(gcc_unused int argc, gcc_unused char **argv)
const auto plugin = encoder_plugin_get("vorbis");
assert(plugin != NULL);
- config_param param;
- param.AddBlockParam("quality", "5.0", -1);
+ ConfigBlock block;
+ block.AddBlockParam("quality", "5.0", -1);
- const auto encoder = encoder_init(*plugin, param, IgnoreError());
+ const auto encoder = encoder_init(*plugin, block, IgnoreError());
assert(encoder != NULL);
/* open the encoder */