Commit 3b6d4e66 authored by Max Kellermann's avatar Max Kellermann

mixer/alsa: move alsa_mixer_elem_callback() into the AlsaMixer class

parent e8f328d8
...@@ -112,6 +112,10 @@ private: ...@@ -112,6 +112,10 @@ private:
unsigned GetPercentVolume() const noexcept { unsigned GetPercentVolume() const noexcept {
return NormalizedToPercent(GetNormalizedVolume()); return NormalizedToPercent(GetNormalizedVolume());
} }
static int ElemCallback(snd_mixer_elem_t *elem,
unsigned mask) noexcept;
}; };
static constexpr Domain alsa_mixer_domain("alsa_mixer"); static constexpr Domain alsa_mixer_domain("alsa_mixer");
...@@ -155,8 +159,8 @@ AlsaMixerMonitor::DispatchSockets() noexcept ...@@ -155,8 +159,8 @@ AlsaMixerMonitor::DispatchSockets() noexcept
* *
*/ */
static int int
alsa_mixer_elem_callback(snd_mixer_elem_t *elem, unsigned mask) AlsaMixer::ElemCallback(snd_mixer_elem_t *elem, unsigned mask) noexcept
{ {
AlsaMixer &mixer = *(AlsaMixer *) AlsaMixer &mixer = *(AlsaMixer *)
snd_mixer_elem_get_callback_private(elem); snd_mixer_elem_get_callback_private(elem);
...@@ -244,7 +248,7 @@ AlsaMixer::Setup() ...@@ -244,7 +248,7 @@ AlsaMixer::Setup()
throw FormatRuntimeError("no such mixer control: %s", control); throw FormatRuntimeError("no such mixer control: %s", control);
snd_mixer_elem_set_callback_private(elem, this); 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); monitor = new AlsaMixerMonitor(event_loop, handle);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment