output/MultipleOutputs: wrap AudioOutputControl in std::unique_ptr<>

This commit is contained in:
Max Kellermann
2019-04-26 14:28:59 +02:00
parent b42f19f514
commit 376f4a2b16
3 changed files with 45 additions and 54 deletions

View File

@@ -56,7 +56,7 @@ MultipleOutputs::GetVolume() const noexcept
unsigned ok = 0;
int total = 0;
for (auto *ao : outputs) {
for (const auto &ao : outputs) {
int volume = output_mixer_get_volume(*ao);
if (volume >= 0) {
total += volume;
@@ -99,7 +99,7 @@ MultipleOutputs::SetVolume(unsigned volume) noexcept
assert(volume <= 100);
bool success = false;
for (auto *ao : outputs)
for (const auto &ao : outputs)
success = output_mixer_set_volume(*ao, volume)
|| success;
@@ -125,7 +125,7 @@ MultipleOutputs::GetSoftwareVolume() const noexcept
unsigned ok = 0;
int total = 0;
for (auto *ao : outputs) {
for (const auto &ao : outputs) {
int volume = output_mixer_get_software_volume(*ao);
if (volume >= 0) {
total += volume;
@@ -144,7 +144,7 @@ MultipleOutputs::SetSoftwareVolume(unsigned volume) noexcept
{
assert(volume <= PCM_VOLUME_1);
for (auto *ao : outputs) {
for (const auto &ao : outputs) {
auto *mixer = ao->GetMixer();
if (mixer != nullptr &&