output/Filtered: add method NeedFullyDefinedAudioFormat()
Avoid accessing FilteredAudioFormat attributes directly.
This commit is contained in:
parent
ccc0fcb5b7
commit
e11229494e
@ -125,6 +125,13 @@ public:
|
||||
|
||||
~FilteredAudioOutput();
|
||||
|
||||
/**
|
||||
* Plugins shall call this method if they require an
|
||||
* "audio_format" setting which evaluates
|
||||
* AudioFormat::IsFullyDefined().
|
||||
*/
|
||||
void NeedFullyDefinedAudioFormat();
|
||||
|
||||
private:
|
||||
void Configure(const ConfigBlock &block);
|
||||
|
||||
|
@ -62,6 +62,13 @@ FilteredAudioOutput::FilteredAudioOutput(const AudioOutputPlugin &_plugin,
|
||||
Configure(block);
|
||||
}
|
||||
|
||||
void
|
||||
FilteredAudioOutput::NeedFullyDefinedAudioFormat()
|
||||
{
|
||||
if (!config_audio_format.IsFullyDefined())
|
||||
throw std::runtime_error("Need full audio format specification");
|
||||
}
|
||||
|
||||
static const AudioOutputPlugin *
|
||||
audio_output_detect()
|
||||
{
|
||||
|
@ -117,9 +117,7 @@ ShoutOutput::ShoutOutput(const ConfigBlock &block)
|
||||
shout_conn(shout_new()),
|
||||
shout_meta(shout_metadata_new())
|
||||
{
|
||||
const AudioFormat audio_format = base.config_audio_format;
|
||||
if (!audio_format.IsFullyDefined())
|
||||
throw std::runtime_error("Need full audio format specification");
|
||||
base.NeedFullyDefinedAudioFormat();
|
||||
|
||||
const char *host = require_block_string(block, "host");
|
||||
const char *mount = require_block_string(block, "mount");
|
||||
|
Loading…
Reference in New Issue
Block a user