From a0beb5fa26e2b66d01a3b21534b848930929a333 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Aug 2013 13:43:36 +0200 Subject: MixerPlugin: pass config_param reference --- src/mixer/AlsaMixerPlugin.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/mixer/AlsaMixerPlugin.cxx') diff --git a/src/mixer/AlsaMixerPlugin.cxx b/src/mixer/AlsaMixerPlugin.cxx index a78b83f8a..31e9997e3 100644 --- a/src/mixer/AlsaMixerPlugin.cxx +++ b/src/mixer/AlsaMixerPlugin.cxx @@ -31,7 +31,7 @@ #define VOLUME_MIXER_ALSA_DEFAULT "default" #define VOLUME_MIXER_ALSA_CONTROL_DEFAULT "PCM" -#define VOLUME_MIXER_ALSA_INDEX_DEFAULT 0 +static constexpr unsigned VOLUME_MIXER_ALSA_INDEX_DEFAULT = 0; class AlsaMixerMonitor final : private MultiSocketMonitor { snd_mixer_t *const mixer; @@ -61,7 +61,7 @@ class AlsaMixer final : public Mixer { public: AlsaMixer():Mixer(alsa_mixer_plugin) {} - void Configure(const config_param *param); + void Configure(const config_param ¶m); bool Setup(GError **error_r); bool Open(GError **error_r); void Close(); @@ -138,18 +138,18 @@ alsa_mixer_elem_callback(G_GNUC_UNUSED snd_mixer_elem_t *elem, unsigned mask) */ inline void -AlsaMixer::Configure(const config_param *param) +AlsaMixer::Configure(const config_param ¶m) { - device = config_get_block_string(param, "mixer_device", - VOLUME_MIXER_ALSA_DEFAULT); - control = config_get_block_string(param, "mixer_control", - VOLUME_MIXER_ALSA_CONTROL_DEFAULT); - index = config_get_block_unsigned(param, "mixer_index", - VOLUME_MIXER_ALSA_INDEX_DEFAULT); + device = param.GetBlockValue("mixer_device", + VOLUME_MIXER_ALSA_DEFAULT); + control = param.GetBlockValue("mixer_control", + VOLUME_MIXER_ALSA_CONTROL_DEFAULT); + index = param.GetBlockValue("mixer_index", + VOLUME_MIXER_ALSA_INDEX_DEFAULT); } static Mixer * -alsa_mixer_init(G_GNUC_UNUSED void *ao, const struct config_param *param, +alsa_mixer_init(G_GNUC_UNUSED void *ao, const config_param ¶m, G_GNUC_UNUSED GError **error_r) { AlsaMixer *am = new AlsaMixer(); -- cgit v1.2.3