summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-11-09 12:04:54 +0100
committerMax Kellermann <max@musicpd.org>2016-11-09 12:06:06 +0100
commitbbe7a37359de2d2c3452239c90ecf67f2337b40f (patch)
tree33f03122a2b3d98242d3bad2785ff2c10da0a2d4 /src
parentd0aa154ea6f842fd03eeebabad015ef0872d9d37 (diff)
output/Internal: hide Configure() and remove the non-configuring constructor
Diffstat (limited to 'src')
-rw-r--r--src/output/Init.cxx8
-rw-r--r--src/output/Internal.hxx4
-rw-r--r--src/output/plugins/SolarisOutputPlugin.cxx4
3 files changed, 4 insertions, 12 deletions
diff --git a/src/output/Init.cxx b/src/output/Init.cxx
index 683999e6d..afdf50b7d 100644
--- a/src/output/Init.cxx
+++ b/src/output/Init.cxx
@@ -49,19 +49,15 @@
#define AUDIO_OUTPUT_FORMAT "format"
#define AUDIO_FILTERS "filters"
-AudioOutput::AudioOutput(const AudioOutputPlugin &_plugin)
+AudioOutput::AudioOutput(const AudioOutputPlugin &_plugin,
+ const ConfigBlock &block)
:plugin(_plugin)
{
assert(plugin.finish != nullptr);
assert(plugin.open != nullptr);
assert(plugin.close != nullptr);
assert(plugin.play != nullptr);
-}
-AudioOutput::AudioOutput(const AudioOutputPlugin &_plugin,
- const ConfigBlock &block)
- :AudioOutput(_plugin)
-{
Error error;
if (!Configure(block, error))
throw std::runtime_error(error.GetMessage());
diff --git a/src/output/Internal.hxx b/src/output/Internal.hxx
index 053a7db0c..8512ecf97 100644
--- a/src/output/Internal.hxx
+++ b/src/output/Internal.hxx
@@ -282,8 +282,6 @@ struct AudioOutput {
*/
bool current_chunk_finished;
- AudioOutput(const AudioOutputPlugin &_plugin);
-
/**
* Throws #std::runtime_error on error.
*/
@@ -292,8 +290,10 @@ struct AudioOutput {
~AudioOutput();
+private:
bool Configure(const ConfigBlock &block, Error &error);
+public:
void StartThread();
void StopThread();
diff --git a/src/output/plugins/SolarisOutputPlugin.cxx b/src/output/plugins/SolarisOutputPlugin.cxx
index 5de3b9734..4f7608ef4 100644
--- a/src/output/plugins/SolarisOutputPlugin.cxx
+++ b/src/output/plugins/SolarisOutputPlugin.cxx
@@ -60,10 +60,6 @@ struct SolarisOutput {
explicit SolarisOutput(const ConfigBlock &block)
:base(solaris_output_plugin, block),
device(block.GetBlockValue("device", "/dev/audio")) {}
-
- bool Initialize(const ConfigBlock &block, Error &error_r) {
- return base.Configure(block, error_r);
- }
};
static bool