aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer/RoarMixerPlugin.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/RoarMixerPlugin.cxx
parent621467717d93221a63c9234d4273d9629635c30f (diff)
downloadmpd-cb8449a66dfa7503951d3c9a27a957918849ac57.tar.gz
mpd-cb8449a66dfa7503951d3c9a27a957918849ac57.tar.xz
mpd-cb8449a66dfa7503951d3c9a27a957918849ac57.zip
MixerInternal: convert to class
Diffstat (limited to 'src/mixer/RoarMixerPlugin.cxx')
-rw-r--r--src/mixer/RoarMixerPlugin.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/mixer/RoarMixerPlugin.cxx b/src/mixer/RoarMixerPlugin.cxx
index a027f8570..0533711c1 100644
--- a/src/mixer/RoarMixerPlugin.cxx
+++ b/src/mixer/RoarMixerPlugin.cxx
@@ -24,26 +24,24 @@
#include "output_api.h"
#include "output/RoarOutputPlugin.hxx"
-struct RoarMixer {
+struct RoarMixer final : public Mixer {
/** the base mixer class */
- struct mixer base;
RoarOutput *self;
- RoarMixer(RoarOutput *_output):self(_output) {
- mixer_init(&base, &roar_mixer_plugin);
- }
+ RoarMixer(RoarOutput *_output)
+ :Mixer(roar_mixer_plugin),
+ self(_output) {}
};
-static struct mixer *
+static Mixer *
roar_mixer_init(void *ao, gcc_unused const struct config_param *param,
gcc_unused GError **error_r)
{
- RoarMixer *self = new RoarMixer((RoarOutput *)ao);
- return &self->base;
+ return new RoarMixer((RoarOutput *)ao);
}
static void
-roar_mixer_finish(struct mixer *data)
+roar_mixer_finish(Mixer *data)
{
RoarMixer *self = (RoarMixer *) data;
@@ -51,14 +49,14 @@ roar_mixer_finish(struct mixer *data)
}
static int
-roar_mixer_get_volume(struct mixer *mixer, gcc_unused GError **error_r)
+roar_mixer_get_volume(Mixer *mixer, gcc_unused GError **error_r)
{
RoarMixer *self = (RoarMixer *)mixer;
return roar_output_get_volume(self->self);
}
static bool
-roar_mixer_set_volume(struct mixer *mixer, unsigned volume,
+roar_mixer_set_volume(Mixer *mixer, unsigned volume,
gcc_unused GError **error_r)
{
RoarMixer *self = (RoarMixer *)mixer;