2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Copyright The Music Player Daemon Project
|
2009-02-10 18:51:42 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Protocol specific code for the audio output library.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-04-28 21:42:24 +02:00
|
|
|
#include "Print.hxx"
|
2014-01-27 08:20:25 +01:00
|
|
|
#include "MultipleOutputs.hxx"
|
2015-08-06 22:10:25 +02:00
|
|
|
#include "client/Response.hxx"
|
2013-01-03 10:58:39 +01:00
|
|
|
|
2021-05-21 20:35:29 +02:00
|
|
|
#include <fmt/format.h>
|
|
|
|
|
2009-02-10 18:51:42 +01:00
|
|
|
void
|
2015-08-06 22:10:25 +02:00
|
|
|
printAudioDevices(Response &r, const MultipleOutputs &outputs)
|
2009-02-10 18:51:42 +01:00
|
|
|
{
|
2014-01-27 08:20:25 +01:00
|
|
|
for (unsigned i = 0, n = outputs.Size(); i != n; ++i) {
|
2017-02-27 22:55:20 +01:00
|
|
|
const auto &ao = outputs.Get(i);
|
2009-02-10 18:51:42 +01:00
|
|
|
|
2021-05-21 20:35:29 +02:00
|
|
|
r.Fmt(FMT_STRING("outputid: {}\n"
|
|
|
|
"outputname: {}\n"
|
|
|
|
"plugin: {}\n"
|
|
|
|
"outputenabled: {}\n"),
|
|
|
|
i,
|
|
|
|
ao.GetName(), ao.GetPluginName(),
|
2021-05-28 18:00:55 +02:00
|
|
|
(unsigned)ao.IsEnabled());
|
2017-12-19 08:45:34 +01:00
|
|
|
|
2020-10-22 10:36:13 +02:00
|
|
|
for (const auto &[attribute, value] : ao.GetAttributes())
|
2021-05-21 20:35:29 +02:00
|
|
|
r.Fmt(FMT_STRING("attribute: {}={}\n"),
|
|
|
|
attribute, value);
|
2009-02-10 18:51:42 +01:00
|
|
|
}
|
|
|
|
}
|