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();
|
~FilteredAudioOutput();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plugins shall call this method if they require an
|
||||||
|
* "audio_format" setting which evaluates
|
||||||
|
* AudioFormat::IsFullyDefined().
|
||||||
|
*/
|
||||||
|
void NeedFullyDefinedAudioFormat();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Configure(const ConfigBlock &block);
|
void Configure(const ConfigBlock &block);
|
||||||
|
|
||||||
|
@ -62,6 +62,13 @@ FilteredAudioOutput::FilteredAudioOutput(const AudioOutputPlugin &_plugin,
|
|||||||
Configure(block);
|
Configure(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
FilteredAudioOutput::NeedFullyDefinedAudioFormat()
|
||||||
|
{
|
||||||
|
if (!config_audio_format.IsFullyDefined())
|
||||||
|
throw std::runtime_error("Need full audio format specification");
|
||||||
|
}
|
||||||
|
|
||||||
static const AudioOutputPlugin *
|
static const AudioOutputPlugin *
|
||||||
audio_output_detect()
|
audio_output_detect()
|
||||||
{
|
{
|
||||||
|
@ -117,9 +117,7 @@ ShoutOutput::ShoutOutput(const ConfigBlock &block)
|
|||||||
shout_conn(shout_new()),
|
shout_conn(shout_new()),
|
||||||
shout_meta(shout_metadata_new())
|
shout_meta(shout_metadata_new())
|
||||||
{
|
{
|
||||||
const AudioFormat audio_format = base.config_audio_format;
|
base.NeedFullyDefinedAudioFormat();
|
||||||
if (!audio_format.IsFullyDefined())
|
|
||||||
throw std::runtime_error("Need full audio format specification");
|
|
||||||
|
|
||||||
const char *host = require_block_string(block, "host");
|
const char *host = require_block_string(block, "host");
|
||||||
const char *mount = require_block_string(block, "mount");
|
const char *mount = require_block_string(block, "mount");
|
||||||
|
Loading…
Reference in New Issue
Block a user