alsa: Call action_epilogue (#2381)

This commit is contained in:
Patrick Ziegler 2021-02-15 23:49:21 +01:00 committed by GitHub
parent 529843b6ba
commit 4f16a4fb6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,24 +235,27 @@ namespace modules {
if (!m_mixer[mixer::MASTER]) {
return;
}
auto mixers = get_mixers();
const auto& mixers = get_mixers();
for (auto&& mixer : mixers) {
mixer->set_mute(m_muted || mixers[0]->is_muted());
}
action_epilogue(mixers);
}
void alsa_module::change_volume(int interval) {
if (!m_mixer[mixer::MASTER]) {
return;
}
auto mixers = get_mixers();
const auto& mixers = get_mixers();
for (auto&& mixer : mixers) {
m_mapped ? mixer->set_normalized_volume(math_util::cap<float>(mixer->get_normalized_volume() + interval, 0, 100))
: mixer->set_volume(math_util::cap<float>(mixer->get_volume() + interval, 0, 100));
}
action_epilogue(mixers);
}
void action_epilogue(const vector<mixer_t>& mixers) {
void alsa_module::action_epilogue(const vector<mixer_t>& mixers) {
for (auto&& mixer : mixers) {
if (mixer->wait(0)) {
mixer->process_events();