summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-08-06 18:00:04 +0200
committerMax Kellermann <max@musicpd.org>2021-08-06 18:01:19 +0200
commit3b6d4e66735a0ec9bfe205a528df1a617e78b575 (patch)
treed757241facae0f3443db8bc125d4092305d1ae22
parente8f328d8adc91568e5c0c683e640b4e70bdeb563 (diff)
mixer/alsa: move alsa_mixer_elem_callback() into the AlsaMixer class
-rw-r--r--src/mixer/plugins/AlsaMixerPlugin.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx
index 844b56105..17f38a14b 100644
--- a/src/mixer/plugins/AlsaMixerPlugin.cxx
+++ b/src/mixer/plugins/AlsaMixerPlugin.cxx
@@ -112,6 +112,10 @@ private:
unsigned GetPercentVolume() const noexcept {
return NormalizedToPercent(GetNormalizedVolume());
}
+
+ static int ElemCallback(snd_mixer_elem_t *elem,
+ unsigned mask) noexcept;
+
};
static constexpr Domain alsa_mixer_domain("alsa_mixer");
@@ -155,8 +159,8 @@ AlsaMixerMonitor::DispatchSockets() noexcept
*
*/
-static int
-alsa_mixer_elem_callback(snd_mixer_elem_t *elem, unsigned mask)
+int
+AlsaMixer::ElemCallback(snd_mixer_elem_t *elem, unsigned mask) noexcept
{
AlsaMixer &mixer = *(AlsaMixer *)
snd_mixer_elem_get_callback_private(elem);
@@ -244,7 +248,7 @@ AlsaMixer::Setup()
throw FormatRuntimeError("no such mixer control: %s", control);
snd_mixer_elem_set_callback_private(elem, this);
- snd_mixer_elem_set_callback(elem, alsa_mixer_elem_callback);
+ snd_mixer_elem_set_callback(elem, ElemCallback);
monitor = new AlsaMixerMonitor(event_loop, handle);
}