aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer/SoftwareMixerPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-04-16 21:33:25 +0200
committerMax Kellermann <max@duempel.org>2013-04-16 21:33:25 +0200
commitcb8449a66dfa7503951d3c9a27a957918849ac57 (patch)
tree33d1af378739fb46d12569b03022697226f5b40f /src/mixer/SoftwareMixerPlugin.cxx
parent621467717d93221a63c9234d4273d9629635c30f (diff)
downloadmpd-cb8449a66dfa7503951d3c9a27a957918849ac57.tar.gz
mpd-cb8449a66dfa7503951d3c9a27a957918849ac57.tar.xz
mpd-cb8449a66dfa7503951d3c9a27a957918849ac57.zip
MixerInternal: convert to class
Diffstat (limited to 'src/mixer/SoftwareMixerPlugin.cxx')
-rw-r--r--src/mixer/SoftwareMixerPlugin.cxx22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mixer/SoftwareMixerPlugin.cxx b/src/mixer/SoftwareMixerPlugin.cxx
index 2782495f5..20cbf45f0 100644
--- a/src/mixer/SoftwareMixerPlugin.cxx
+++ b/src/mixer/SoftwareMixerPlugin.cxx
@@ -29,18 +29,17 @@
#include <assert.h>
#include <math.h>
-struct SoftwareMixer final : public mixer {
+struct SoftwareMixer final : public Mixer {
Filter *filter;
unsigned volume;
SoftwareMixer()
- :filter(filter_new(&volume_filter_plugin, nullptr, nullptr)),
- volume(100)
+ :Mixer(software_mixer_plugin),
+ filter(filter_new(&volume_filter_plugin, nullptr, nullptr)),
+ volume(100)
{
assert(filter != nullptr);
-
- mixer_init(this, &software_mixer_plugin);
}
~SoftwareMixer() {
@@ -48,7 +47,7 @@ struct SoftwareMixer final : public mixer {
}
};
-static struct mixer *
+static Mixer *
software_mixer_init(G_GNUC_UNUSED void *ao,
G_GNUC_UNUSED const struct config_param *param,
G_GNUC_UNUSED GError **error_r)
@@ -57,7 +56,7 @@ software_mixer_init(G_GNUC_UNUSED void *ao,
}
static void
-software_mixer_finish(struct mixer *data)
+software_mixer_finish(Mixer *data)
{
SoftwareMixer *sm = (SoftwareMixer *)data;
@@ -65,7 +64,7 @@ software_mixer_finish(struct mixer *data)
}
static int
-software_mixer_get_volume(struct mixer *mixer, G_GNUC_UNUSED GError **error_r)
+software_mixer_get_volume(Mixer *mixer, G_GNUC_UNUSED GError **error_r)
{
SoftwareMixer *sm = (SoftwareMixer *)mixer;
@@ -73,7 +72,7 @@ software_mixer_get_volume(struct mixer *mixer, G_GNUC_UNUSED GError **error_r)
}
static bool
-software_mixer_set_volume(struct mixer *mixer, unsigned volume,
+software_mixer_set_volume(Mixer *mixer, unsigned volume,
G_GNUC_UNUSED GError **error_r)
{
SoftwareMixer *sm = (SoftwareMixer *)mixer;
@@ -103,11 +102,10 @@ const struct mixer_plugin software_mixer_plugin = {
};
Filter *
-software_mixer_get_filter(struct mixer *mixer)
+software_mixer_get_filter(Mixer *mixer)
{
SoftwareMixer *sm = (SoftwareMixer *)mixer;
-
- assert(sm->plugin == &software_mixer_plugin);
+ assert(sm->IsPlugin(software_mixer_plugin));
return sm->filter;
}