output/Internal: hide Configure() and remove the non-configuring constructor
This commit is contained in:
parent
d0aa154ea6
commit
bbe7a37359
@ -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());
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user