aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/HttpdOutputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-04 12:25:08 +0200
committerMax Kellermann <max@duempel.org>2013-08-04 14:07:49 +0200
commit81c3224076da6ad727debc6bab8a5422f7322451 (patch)
tree1da1912caa6c7ff863f7affeafae22e9e6004e8f /src/output/HttpdOutputPlugin.cxx
parent7a1d466fb279659048e80e2853a7906c90d73235 (diff)
downloadmpd-81c3224076da6ad727debc6bab8a5422f7322451.tar.gz
mpd-81c3224076da6ad727debc6bab8a5422f7322451.tar.xz
mpd-81c3224076da6ad727debc6bab8a5422f7322451.zip
OutputPlugin: pass config_param reference
Diffstat (limited to '')
-rw-r--r--src/output/HttpdOutputPlugin.cxx22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/output/HttpdOutputPlugin.cxx b/src/output/HttpdOutputPlugin.cxx
index 462dd3429..21774bac9 100644
--- a/src/output/HttpdOutputPlugin.cxx
+++ b/src/output/HttpdOutputPlugin.cxx
@@ -91,18 +91,17 @@ HttpdOutput::Unbind()
}
inline bool
-HttpdOutput::Configure(const config_param *param, GError **error_r)
+HttpdOutput::Configure(const config_param &param, GError **error_r)
{
/* read configuration */
- name = config_get_block_string(param, "name", "Set name in config");
- genre = config_get_block_string(param, "genre", "Set genre in config");
- website = config_get_block_string(param, "website",
- "Set website in config");
+ name = param.GetBlockValue("name", "Set name in config");
+ genre = param.GetBlockValue("genre", "Set genre in config");
+ website = param.GetBlockValue("website", "Set website in config");
- guint port = config_get_block_unsigned(param, "port", 8000);
+ guint port = param.GetBlockValue("port", 8000u);
const char *encoder_name =
- config_get_block_string(param, "encoder", "vorbis");
+ param.GetBlockValue("encoder", "vorbis");
const auto encoder_plugin = encoder_plugin_get(encoder_name);
if (encoder_plugin == NULL) {
g_set_error(error_r, httpd_output_quark(), 0,
@@ -110,12 +109,11 @@ HttpdOutput::Configure(const config_param *param, GError **error_r)
return false;
}
- clients_max = config_get_block_unsigned(param,"max_clients", 0);
+ clients_max = param.GetBlockValue("max_clients", 0u);
/* set up bind_to_address */
- const char *bind_to_address =
- config_get_block_string(param, "bind_to_address", NULL);
+ const char *bind_to_address = param.GetBlockValue("bind_to_address");
bool success = bind_to_address != NULL &&
strcmp(bind_to_address, "any") != 0
? AddHost(bind_to_address, port, error_r)
@@ -125,7 +123,7 @@ HttpdOutput::Configure(const config_param *param, GError **error_r)
/* initialize encoder */
- encoder = encoder_init(*encoder_plugin, param, error_r);
+ encoder = encoder_init(*encoder_plugin, &param, error_r);
if (encoder == nullptr)
return false;
@@ -138,7 +136,7 @@ HttpdOutput::Configure(const config_param *param, GError **error_r)
}
static struct audio_output *
-httpd_output_init(const struct config_param *param,
+httpd_output_init(const struct config_param &param,
GError **error_r)
{
HttpdOutput *httpd = new HttpdOutput(*main_loop);