diff options
author | Max Kellermann <max@musicpd.org> | 2021-08-06 17:56:29 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2021-08-06 17:56:30 +0200 |
commit | e8f328d8adc91568e5c0c683e640b4e70bdeb563 (patch) | |
tree | 3c79b9cab21b7b1d591d79026ff5e3bcc875d533 | |
parent | 5f5b5f63af7018095513ff84ac6d08418fdb42c9 (diff) |
mixer/alsa: move code to GetPercentVolume()
-rw-r--r-- | src/mixer/plugins/AlsaMixerPlugin.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx index fd4c6817d..844b56105 100644 --- a/src/mixer/plugins/AlsaMixerPlugin.cxx +++ b/src/mixer/plugins/AlsaMixerPlugin.cxx @@ -107,6 +107,11 @@ private: return get_normalized_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT); } + + [[gnu::pure]] + unsigned GetPercentVolume() const noexcept { + return NormalizedToPercent(GetNormalizedVolume()); + } }; static constexpr Domain alsa_mixer_domain("alsa_mixer"); @@ -285,7 +290,7 @@ AlsaMixer::GetVolume() throw FormatRuntimeError("snd_mixer_handle_events() failed: %s", snd_strerror(err)); - return NormalizedToPercent(GetNormalizedVolume()); + return GetPercentVolume(); } void |