summaryrefslogtreecommitdiff
path: root/src/mixer
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-04 13:43:36 +0200
committerMax Kellermann <max@duempel.org>2013-08-04 14:07:50 +0200
commita0beb5fa26e2b66d01a3b21534b848930929a333 (patch)
treeeb6e661a05b5d9994f514a6fbcc50a72d94df722 /src/mixer
parentf54bcc1f16f815fb507ac8a8ffd7913f686969d2 (diff)
MixerPlugin: pass config_param reference
Diffstat (limited to 'src/mixer')
-rw-r--r--src/mixer/AlsaMixerPlugin.cxx20
-rw-r--r--src/mixer/OssMixerPlugin.cxx10
-rw-r--r--src/mixer/PulseMixerPlugin.cxx2
-rw-r--r--src/mixer/RoarMixerPlugin.cxx2
-rw-r--r--src/mixer/SoftwareMixerPlugin.cxx2
-rw-r--r--src/mixer/WinmmMixerPlugin.cxx2
6 files changed, 19 insertions, 19 deletions
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 &param);
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 &param)
{
- 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 &param,
G_GNUC_UNUSED GError **error_r)
{
AlsaMixer *am = new AlsaMixer();
diff --git a/src/mixer/OssMixerPlugin.cxx b/src/mixer/OssMixerPlugin.cxx
index 5c2bdec8d..bbb5b6c88 100644
--- a/src/mixer/OssMixerPlugin.cxx
+++ b/src/mixer/OssMixerPlugin.cxx
@@ -51,7 +51,7 @@ class OssMixer : public Mixer {
public:
OssMixer():Mixer(oss_mixer_plugin) {}
- bool Configure(const config_param *param, GError **error_r);
+ bool Configure(const config_param &param, GError **error_r);
bool Open(GError **error_r);
void Close();
@@ -84,11 +84,11 @@ oss_find_mixer(const char *name)
}
inline bool
-OssMixer::Configure(const config_param *param, GError **error_r)
+OssMixer::Configure(const config_param &param, GError **error_r)
{
- device = config_get_block_string(param, "mixer_device",
+ device = param.GetBlockValue("mixer_device",
VOLUME_MIXER_OSS_DEFAULT);
- control = config_get_block_string(param, "mixer_control", NULL);
+ control = param.GetBlockValue("mixer_control");
if (control != NULL) {
volume_control = oss_find_mixer(control);
@@ -104,7 +104,7 @@ OssMixer::Configure(const config_param *param, GError **error_r)
}
static Mixer *
-oss_mixer_init(G_GNUC_UNUSED void *ao, const struct config_param *param,
+oss_mixer_init(G_GNUC_UNUSED void *ao, const config_param &param,
GError **error_r)
{
OssMixer *om = new OssMixer();
diff --git a/src/mixer/PulseMixerPlugin.cxx b/src/mixer/PulseMixerPlugin.cxx
index 389f077f3..9cfd2dcf8 100644
--- a/src/mixer/PulseMixerPlugin.cxx
+++ b/src/mixer/PulseMixerPlugin.cxx
@@ -153,7 +153,7 @@ pulse_mixer_on_change(PulseMixer *pm,
}
static Mixer *
-pulse_mixer_init(void *ao, G_GNUC_UNUSED const struct config_param *param,
+pulse_mixer_init(void *ao, gcc_unused const config_param &param,
GError **error_r)
{
PulseOutput *po = (PulseOutput *)ao;
diff --git a/src/mixer/RoarMixerPlugin.cxx b/src/mixer/RoarMixerPlugin.cxx
index 92a22f51b..90d54ddaa 100644
--- a/src/mixer/RoarMixerPlugin.cxx
+++ b/src/mixer/RoarMixerPlugin.cxx
@@ -34,7 +34,7 @@ struct RoarMixer final : public Mixer {
};
static Mixer *
-roar_mixer_init(void *ao, gcc_unused const struct config_param *param,
+roar_mixer_init(void *ao, gcc_unused const config_param &param,
gcc_unused GError **error_r)
{
return new RoarMixer((RoarOutput *)ao);
diff --git a/src/mixer/SoftwareMixerPlugin.cxx b/src/mixer/SoftwareMixerPlugin.cxx
index bb0b890ca..8a268aaf1 100644
--- a/src/mixer/SoftwareMixerPlugin.cxx
+++ b/src/mixer/SoftwareMixerPlugin.cxx
@@ -51,7 +51,7 @@ struct SoftwareMixer final : public Mixer {
static Mixer *
software_mixer_init(gcc_unused void *ao,
- gcc_unused const struct config_param *param,
+ gcc_unused const config_param &param,
gcc_unused GError **error_r)
{
return new SoftwareMixer();
diff --git a/src/mixer/WinmmMixerPlugin.cxx b/src/mixer/WinmmMixerPlugin.cxx
index 89ed854ae..139cb1399 100644
--- a/src/mixer/WinmmMixerPlugin.cxx
+++ b/src/mixer/WinmmMixerPlugin.cxx
@@ -60,7 +60,7 @@ winmm_volume_encode(int volume)
}
static Mixer *
-winmm_mixer_init(void *ao, G_GNUC_UNUSED const struct config_param *param,
+winmm_mixer_init(void *ao, gcc_unused const config_param &param,
G_GNUC_UNUSED GError **error_r)
{
assert(ao != nullptr);