output/Init: add constructor overload which calls Configure()
This commit is contained in:
parent
13001c018c
commit
c4acccac14
@ -58,6 +58,15 @@ AudioOutput::AudioOutput(const AudioOutputPlugin &_plugin)
|
|||||||
assert(plugin.play != 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());
|
||||||
|
}
|
||||||
|
|
||||||
static const AudioOutputPlugin *
|
static const AudioOutputPlugin *
|
||||||
audio_output_detect(Error &error)
|
audio_output_detect(Error &error)
|
||||||
{
|
{
|
||||||
|
@ -283,6 +283,13 @@ struct AudioOutput {
|
|||||||
bool current_chunk_finished;
|
bool current_chunk_finished;
|
||||||
|
|
||||||
AudioOutput(const AudioOutputPlugin &_plugin);
|
AudioOutput(const AudioOutputPlugin &_plugin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Throws #std::runtime_error on error.
|
||||||
|
*/
|
||||||
|
AudioOutput(const AudioOutputPlugin &_plugin,
|
||||||
|
const ConfigBlock &block);
|
||||||
|
|
||||||
~AudioOutput();
|
~AudioOutput();
|
||||||
|
|
||||||
bool Configure(const ConfigBlock &block, Error &error);
|
bool Configure(const ConfigBlock &block, Error &error);
|
||||||
|
Loading…
Reference in New Issue
Block a user