output/Internal: hide Configure() and remove the non-configuring constructor

This commit is contained in:
Max Kellermann 2016-11-09 12:04:54 +01:00
parent d0aa154ea6
commit bbe7a37359
3 changed files with 4 additions and 12 deletions

View File

@ -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());

View File

@ -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();

View File

@ -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