From bbe7a37359de2d2c3452239c90ecf67f2337b40f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 9 Nov 2016 12:04:54 +0100 Subject: [PATCH] output/Internal: hide Configure() and remove the non-configuring constructor --- src/output/Init.cxx | 8 ++------ src/output/Internal.hxx | 4 ++-- src/output/plugins/SolarisOutputPlugin.cxx | 4 ---- 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