diff options
author | Max Kellermann <max@musicpd.org> | 2017-02-27 22:55:20 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-04-28 22:04:24 +0200 |
commit | 8bb9d0960bb44ee9e274ae2dde5ed8240c376622 (patch) | |
tree | 7d06092e2a0d17aed293d0b9de0b1b8a96dd8766 /src/mixer | |
parent | 59181ac5fb4ce199922794228274b8b56cf2ff79 (diff) |
output/Control: add struct AudioOutputControl
Will move attributes from struct AudioOutput that are specific to the
OutputThread. The new struct AudioOutputControl is a holder for the
AudioOutput pointer.
This prepares for making the output list more dynamic, to allow moving
outputs to between partitions.
Diffstat (limited to 'src/mixer')
-rw-r--r-- | src/mixer/MixerAll.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mixer/MixerAll.cxx b/src/mixer/MixerAll.cxx index e9bcde93a..cb50c3418 100644 --- a/src/mixer/MixerAll.cxx +++ b/src/mixer/MixerAll.cxx @@ -31,12 +31,12 @@ #include <assert.h> static int -output_mixer_get_volume(const AudioOutput &ao) +output_mixer_get_volume(const AudioOutputControl &ao) { - if (!ao.enabled) + if (!ao.IsEnabled()) return -1; - Mixer *mixer = ao.mixer; + auto *mixer = ao.GetMixer(); if (mixer == nullptr) return -1; @@ -56,7 +56,7 @@ MultipleOutputs::GetVolume() const unsigned ok = 0; int total = 0; - for (auto ao : outputs) { + for (auto *ao : outputs) { int volume = output_mixer_get_volume(*ao); if (volume >= 0) { total += volume; @@ -71,14 +71,14 @@ MultipleOutputs::GetVolume() const } static bool -output_mixer_set_volume(AudioOutput &ao, unsigned volume) +output_mixer_set_volume(AudioOutputControl &ao, unsigned volume) { assert(volume <= 100); - if (!ao.enabled) + if (!ao.IsEnabled()) return false; - Mixer *mixer = ao.mixer; + auto *mixer = ao.GetMixer(); if (mixer == nullptr) return false; @@ -99,7 +99,7 @@ MultipleOutputs::SetVolume(unsigned volume) assert(volume <= 100); bool success = false; - for (auto ao : outputs) + for (auto *ao : outputs) success = output_mixer_set_volume(*ao, volume) || success; @@ -107,12 +107,12 @@ MultipleOutputs::SetVolume(unsigned volume) } static int -output_mixer_get_software_volume(const AudioOutput &ao) +output_mixer_get_software_volume(const AudioOutputControl &ao) { - if (!ao.enabled) + if (!ao.IsEnabled()) return -1; - Mixer *mixer = ao.mixer; + auto *mixer = ao.GetMixer(); if (mixer == nullptr || !mixer->IsPlugin(software_mixer_plugin)) return -1; @@ -125,7 +125,7 @@ MultipleOutputs::GetSoftwareVolume() const unsigned ok = 0; int total = 0; - for (auto ao : outputs) { + for (auto *ao : outputs) { int volume = output_mixer_get_software_volume(*ao); if (volume >= 0) { total += volume; @@ -144,8 +144,8 @@ MultipleOutputs::SetSoftwareVolume(unsigned volume) { assert(volume <= PCM_VOLUME_1); - for (auto ao : outputs) { - const auto mixer = ao->mixer; + for (auto *ao : outputs) { + auto *mixer = ao->GetMixer(); if (mixer != nullptr && (&mixer->plugin == &software_mixer_plugin || |