aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/plugins/JackOutputPlugin.cxx
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 /src/output/plugins/JackOutputPlugin.cxx
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 '')
-rw-r--r--src/output/plugins/JackOutputPlugin.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/output/plugins/JackOutputPlugin.cxx b/src/output/plugins/JackOutputPlugin.cxx
index 5c136b81f..23843ab5e 100644
--- a/src/output/plugins/JackOutputPlugin.cxx
+++ b/src/output/plugins/JackOutputPlugin.cxx
@@ -83,7 +83,7 @@ struct JackOutput {
JackOutput()
:base(jack_output_plugin) {}
- bool Configure(const config_param &param, Error &error);
+ bool Configure(const ConfigBlock &block, Error &error);
bool Connect(Error &error);
@@ -376,14 +376,14 @@ parse_port_list(const char *source, std::string dest[], Error &error)
}
bool
-JackOutput::Configure(const config_param &param, Error &error)
+JackOutput::Configure(const ConfigBlock &block, Error &error)
{
- if (!base.Configure(param, error))
+ if (!base.Configure(block, error))
return false;
options = JackNullOption;
- name = param.GetBlockValue("client_name", nullptr);
+ name = block.GetBlockValue("client_name", nullptr);
if (name != nullptr)
options = jack_options_t(options | JackUseExactName);
else
@@ -391,30 +391,30 @@ JackOutput::Configure(const config_param &param, Error &error)
care about the JackUseExactName option */
name = "Music Player Daemon";
- server_name = param.GetBlockValue("server_name", nullptr);
+ server_name = block.GetBlockValue("server_name", nullptr);
if (server_name != nullptr)
options = jack_options_t(options | JackServerName);
- if (!param.GetBlockValue("autostart", false))
+ if (!block.GetBlockValue("autostart", false))
options = jack_options_t(options | JackNoStartServer);
/* configure the source ports */
- const char *value = param.GetBlockValue("source_ports", "left,right");
+ const char *value = block.GetBlockValue("source_ports", "left,right");
num_source_ports = parse_port_list(value, source_ports, error);
if (num_source_ports == 0)
return false;
/* configure the destination ports */
- value = param.GetBlockValue("destination_ports", nullptr);
+ value = block.GetBlockValue("destination_ports", nullptr);
if (value == nullptr) {
/* compatibility with MPD < 0.16 */
- value = param.GetBlockValue("ports", nullptr);
+ value = block.GetBlockValue("ports", nullptr);
if (value != nullptr)
FormatWarning(jack_output_domain,
"deprecated option 'ports' in line %d",
- param.line);
+ block.line);
}
if (value != nullptr) {
@@ -432,9 +432,9 @@ JackOutput::Configure(const config_param &param, Error &error)
"number of source ports (%u) mismatches the "
"number of destination ports (%u) in line %d",
num_source_ports, num_destination_ports,
- param.line);
+ block.line);
- ringbuffer_size = param.GetBlockValue("ringbuffer_size", 32768u);
+ ringbuffer_size = block.GetBlockValue("ringbuffer_size", 32768u);
return true;
}
@@ -463,11 +463,11 @@ JackOutput::Disable()
}
static AudioOutput *
-mpd_jack_init(const config_param &param, Error &error)
+mpd_jack_init(const ConfigBlock &block, Error &error)
{
JackOutput *jd = new JackOutput();
- if (!jd->Configure(param, error)) {
+ if (!jd->Configure(block, error)) {
delete jd;
return nullptr;
}