diff options
author | Max Kellermann <max@duempel.org> | 2014-02-05 00:02:02 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-05 00:02:02 +0100 |
commit | e8938b1069739eca2bd2f27705c1c7783e834e59 (patch) | |
tree | 482330dbf228c12a60c9a401f0428cc4e292e234 /src/mixer/plugins | |
parent | 4a283330394fd2e1541a03bd312e5fadf54aa055 (diff) | |
download | mpd-e8938b1069739eca2bd2f27705c1c7783e834e59.tar.gz mpd-e8938b1069739eca2bd2f27705c1c7783e834e59.tar.xz mpd-e8938b1069739eca2bd2f27705c1c7783e834e59.zip |
MixerPlugin: add EventLoop& init() parameter
Diffstat (limited to 'src/mixer/plugins')
-rw-r--r-- | src/mixer/plugins/AlsaMixerPlugin.cxx | 13 | ||||
-rw-r--r-- | src/mixer/plugins/OssMixerPlugin.cxx | 3 | ||||
-rw-r--r-- | src/mixer/plugins/PulseMixerPlugin.cxx | 3 | ||||
-rw-r--r-- | src/mixer/plugins/RoarMixerPlugin.cxx | 3 | ||||
-rw-r--r-- | src/mixer/plugins/SoftwareMixerPlugin.cxx | 2 | ||||
-rw-r--r-- | src/mixer/plugins/WinmmMixerPlugin.cxx | 3 |
6 files changed, 17 insertions, 10 deletions
diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx index a15820fc7..6e99cfa3e 100644 --- a/src/mixer/plugins/AlsaMixerPlugin.cxx +++ b/src/mixer/plugins/AlsaMixerPlugin.cxx @@ -21,7 +21,6 @@ #include "mixer/MixerInternal.hxx" #include "output/OutputAPI.hxx" #include "GlobalEvents.hxx" -#include "Main.hxx" #include "event/MultiSocketMonitor.hxx" #include "event/DeferredMonitor.hxx" #include "event/Loop.hxx" @@ -62,6 +61,8 @@ private: }; class AlsaMixer final : public Mixer { + EventLoop &event_loop; + const char *device; const char *control; unsigned int index; @@ -75,7 +76,8 @@ class AlsaMixer final : public Mixer { AlsaMixerMonitor *monitor; public: - AlsaMixer():Mixer(alsa_mixer_plugin) {} + AlsaMixer(EventLoop &_event_loop) + :Mixer(alsa_mixer_plugin), event_loop(_event_loop) {} void Configure(const config_param ¶m); bool Setup(Error &error); @@ -162,10 +164,11 @@ AlsaMixer::Configure(const config_param ¶m) } static Mixer * -alsa_mixer_init(gcc_unused void *ao, const config_param ¶m, +alsa_mixer_init(EventLoop &event_loop, gcc_unused void *ao, + const config_param ¶m, gcc_unused Error &error) { - AlsaMixer *am = new AlsaMixer(); + AlsaMixer *am = new AlsaMixer(event_loop); am->Configure(param); return am; @@ -237,7 +240,7 @@ AlsaMixer::Setup(Error &error) snd_mixer_elem_set_callback(elem, alsa_mixer_elem_callback); - monitor = new AlsaMixerMonitor(*main_loop, handle); + monitor = new AlsaMixerMonitor(event_loop, handle); return true; } diff --git a/src/mixer/plugins/OssMixerPlugin.cxx b/src/mixer/plugins/OssMixerPlugin.cxx index 095ace015..96dade06e 100644 --- a/src/mixer/plugins/OssMixerPlugin.cxx +++ b/src/mixer/plugins/OssMixerPlugin.cxx @@ -96,7 +96,8 @@ OssMixer::Configure(const config_param ¶m, Error &error) } static Mixer * -oss_mixer_init(gcc_unused void *ao, const config_param ¶m, +oss_mixer_init(gcc_unused EventLoop &event_loop, gcc_unused void *ao, + const config_param ¶m, Error &error) { OssMixer *om = new OssMixer(); diff --git a/src/mixer/plugins/PulseMixerPlugin.cxx b/src/mixer/plugins/PulseMixerPlugin.cxx index 4df88d06b..636656081 100644 --- a/src/mixer/plugins/PulseMixerPlugin.cxx +++ b/src/mixer/plugins/PulseMixerPlugin.cxx @@ -143,7 +143,8 @@ pulse_mixer_on_change(PulseMixer *pm, } static Mixer * -pulse_mixer_init(void *ao, gcc_unused const config_param ¶m, +pulse_mixer_init(gcc_unused EventLoop &event_loop, void *ao, + gcc_unused const config_param ¶m, Error &error) { PulseOutput *po = (PulseOutput *)ao; diff --git a/src/mixer/plugins/RoarMixerPlugin.cxx b/src/mixer/plugins/RoarMixerPlugin.cxx index 958688cd7..ce0462520 100644 --- a/src/mixer/plugins/RoarMixerPlugin.cxx +++ b/src/mixer/plugins/RoarMixerPlugin.cxx @@ -34,7 +34,8 @@ struct RoarMixer final : public Mixer { }; static Mixer * -roar_mixer_init(void *ao, gcc_unused const config_param ¶m, +roar_mixer_init(gcc_unused EventLoop &event_loop, void *ao, + gcc_unused const config_param ¶m, gcc_unused Error &error) { return new RoarMixer((RoarOutput *)ao); diff --git a/src/mixer/plugins/SoftwareMixerPlugin.cxx b/src/mixer/plugins/SoftwareMixerPlugin.cxx index 67ddee1a4..e5d4ba5ca 100644 --- a/src/mixer/plugins/SoftwareMixerPlugin.cxx +++ b/src/mixer/plugins/SoftwareMixerPlugin.cxx @@ -67,7 +67,7 @@ struct SoftwareMixer final : public Mixer { }; static Mixer * -software_mixer_init(gcc_unused void *ao, +software_mixer_init(gcc_unused EventLoop &event_loop, gcc_unused void *ao, gcc_unused const config_param ¶m, gcc_unused Error &error) { diff --git a/src/mixer/plugins/WinmmMixerPlugin.cxx b/src/mixer/plugins/WinmmMixerPlugin.cxx index 093a026a9..c040b19fd 100644 --- a/src/mixer/plugins/WinmmMixerPlugin.cxx +++ b/src/mixer/plugins/WinmmMixerPlugin.cxx @@ -55,7 +55,8 @@ winmm_volume_encode(int volume) } static Mixer * -winmm_mixer_init(void *ao, gcc_unused const config_param ¶m, +winmm_mixer_init(gcc_unused EventLoop &event_loop, void *ao, + gcc_unused const config_param ¶m, gcc_unused Error &error) { assert(ao != nullptr); |