output/Control: add method Configure()
Prepare to move some configuration settings from AudioOutput to AudioOutputControl.
This commit is contained in:
parent
e5847f1ddf
commit
2e65686fc0
@ -44,6 +44,12 @@ AudioOutputControl::AudioOutputControl(AudioOutput *_output)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
AudioOutputControl::Configure(const ConfigBlock &block)
|
||||
{
|
||||
(void)block;
|
||||
}
|
||||
|
||||
const char *
|
||||
AudioOutputControl::GetName() const
|
||||
{
|
||||
|
@ -38,6 +38,7 @@
|
||||
enum class ReplayGainMode : uint8_t;
|
||||
struct AudioOutput;
|
||||
struct MusicChunk;
|
||||
struct ConfigBlock;
|
||||
class MusicPipe;
|
||||
class Mutex;
|
||||
class Mixer;
|
||||
@ -158,6 +159,11 @@ public:
|
||||
AudioOutputControl(const AudioOutputControl &) = delete;
|
||||
AudioOutputControl &operator=(const AudioOutputControl &) = delete;
|
||||
|
||||
/**
|
||||
* Throws #std::runtime_error on error.
|
||||
*/
|
||||
void Configure(const ConfigBlock &block);
|
||||
|
||||
gcc_pure
|
||||
const char *GetName() const;
|
||||
|
||||
|
@ -75,7 +75,18 @@ LoadOutputControl(EventLoop &event_loop,
|
||||
auto *output = LoadOutput(event_loop, replay_gain_config,
|
||||
mixer_listener,
|
||||
client, block);
|
||||
return new AudioOutputControl(output);
|
||||
auto *control = new AudioOutputControl(output);
|
||||
|
||||
try {
|
||||
control->Configure(block);
|
||||
} catch (...) {
|
||||
control->BeginDestroy();
|
||||
control->FinishDestroy();
|
||||
delete control;
|
||||
throw;
|
||||
}
|
||||
|
||||
return control;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user