output/Client: new interface to replace direct access to class PlayerControl
This commit is contained in:
@@ -53,11 +53,11 @@ static AudioOutput *
|
||||
LoadOutput(EventLoop &event_loop,
|
||||
const ReplayGainConfig &replay_gain_config,
|
||||
MixerListener &mixer_listener,
|
||||
PlayerControl &pc, const ConfigBlock &block)
|
||||
AudioOutputClient &client, const ConfigBlock &block)
|
||||
try {
|
||||
return audio_output_new(event_loop, replay_gain_config, block,
|
||||
mixer_listener,
|
||||
pc);
|
||||
client);
|
||||
} catch (const std::runtime_error &e) {
|
||||
if (block.line > 0)
|
||||
std::throw_with_nested(FormatRuntimeError("Failed to configure output in line %i",
|
||||
@@ -69,13 +69,13 @@ try {
|
||||
void
|
||||
MultipleOutputs::Configure(EventLoop &event_loop,
|
||||
const ReplayGainConfig &replay_gain_config,
|
||||
PlayerControl &pc)
|
||||
AudioOutputClient &client)
|
||||
{
|
||||
for (const auto *param = config_get_block(ConfigBlockOption::AUDIO_OUTPUT);
|
||||
param != nullptr; param = param->next) {
|
||||
auto output = LoadOutput(event_loop, replay_gain_config,
|
||||
mixer_listener,
|
||||
pc, *param);
|
||||
client, *param);
|
||||
if (FindByName(output->name) != nullptr)
|
||||
throw FormatRuntimeError("output devices with identical "
|
||||
"names: %s", output->name);
|
||||
@@ -88,7 +88,7 @@ MultipleOutputs::Configure(EventLoop &event_loop,
|
||||
const ConfigBlock empty;
|
||||
auto output = LoadOutput(event_loop, replay_gain_config,
|
||||
mixer_listener,
|
||||
pc, empty);
|
||||
client, empty);
|
||||
outputs.push_back(output);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user