From 1e972174a64dbfa911fe548a6340d557bcac61da Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Feb 2017 23:53:44 +0100 Subject: [PATCH] output/MultipleOutputs: add method AddNullOutput() --- src/output/MultipleOutputs.cxx | 14 ++++++++++++++ src/output/MultipleOutputs.hxx | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/src/output/MultipleOutputs.cxx b/src/output/MultipleOutputs.cxx index 9b1f8169c..5cf7b0a40 100644 --- a/src/output/MultipleOutputs.cxx +++ b/src/output/MultipleOutputs.cxx @@ -93,6 +93,20 @@ MultipleOutputs::Configure(EventLoop &event_loop, } } +void +MultipleOutputs::AddNullOutput(EventLoop &event_loop, + const ReplayGainConfig &replay_gain_config, + AudioOutputClient &client) +{ + ConfigBlock block; + block.AddBlockParam("type", "null"); + + auto output = LoadOutput(event_loop, replay_gain_config, + mixer_listener, + client, block); + outputs.push_back(output); +} + AudioOutput * MultipleOutputs::FindByName(const char *name) const { diff --git a/src/output/MultipleOutputs.hxx b/src/output/MultipleOutputs.hxx index a6366cf89..b9e12c07e 100644 --- a/src/output/MultipleOutputs.hxx +++ b/src/output/MultipleOutputs.hxx @@ -80,6 +80,10 @@ public: const ReplayGainConfig &replay_gain_config, AudioOutputClient &client); + void AddNullOutput(EventLoop &event_loop, + const ReplayGainConfig &replay_gain_config, + AudioOutputClient &client); + /** * Returns the total number of audio output devices, including * those which are disabled right now.