diff options
author | Max Kellermann <max@duempel.org> | 2014-02-05 23:20:33 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-19 21:40:14 +0100 |
commit | 8d6fedf8177d0d2ced81e6d93d35c368b2ac69db (patch) | |
tree | 17890432eb5d7f6cbdf5feb32a0105dc6f9d8974 /src/output/Init.cxx | |
parent | f4f8fa7c947af10235d1cdd70b294a3b8810c6f4 (diff) | |
download | mpd-8d6fedf8177d0d2ced81e6d93d35c368b2ac69db.tar.gz mpd-8d6fedf8177d0d2ced81e6d93d35c368b2ac69db.tar.xz mpd-8d6fedf8177d0d2ced81e6d93d35c368b2ac69db.zip |
Mixer: add class MixerListener
Use a listener interface instead of GlobalEvents.
Diffstat (limited to 'src/output/Init.cxx')
-rw-r--r-- | src/output/Init.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/output/Init.cxx b/src/output/Init.cxx index 69ee12b35..eafcec432 100644 --- a/src/output/Init.cxx +++ b/src/output/Init.cxx @@ -116,6 +116,7 @@ audio_output_load_mixer(EventLoop &event_loop, AudioOutput &ao, const config_param ¶m, const MixerPlugin *plugin, Filter &filter_chain, + MixerListener &listener, Error &error) { Mixer *mixer; @@ -129,10 +130,12 @@ audio_output_load_mixer(EventLoop &event_loop, AudioOutput &ao, if (plugin == nullptr) return nullptr; - return mixer_new(event_loop, *plugin, ao, param, error); + return mixer_new(event_loop, *plugin, ao, listener, + param, error); case MIXER_TYPE_SOFTWARE: mixer = mixer_new(event_loop, software_mixer_plugin, ao, + listener, config_param(), IgnoreError()); assert(mixer != nullptr); @@ -212,6 +215,7 @@ AudioOutput::Configure(const config_param ¶m, Error &error) static bool audio_output_setup(EventLoop &event_loop, AudioOutput &ao, + MixerListener &mixer_listener, const config_param ¶m, Error &error) { @@ -244,7 +248,9 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao, Error mixer_error; ao.mixer = audio_output_load_mixer(event_loop, ao, param, ao.plugin.mixer_plugin, - *ao.filter, mixer_error); + *ao.filter, + mixer_listener, + mixer_error); if (ao.mixer == nullptr && mixer_error.IsDefined()) FormatError(mixer_error, "Failed to initialize hardware mixer for '%s'", @@ -279,6 +285,7 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao, AudioOutput * audio_output_new(EventLoop &event_loop, const config_param ¶m, + MixerListener &mixer_listener, PlayerControl &pc, Error &error) { @@ -317,7 +324,8 @@ audio_output_new(EventLoop &event_loop, const config_param ¶m, if (ao == nullptr) return nullptr; - if (!audio_output_setup(event_loop, *ao, param, error)) { + if (!audio_output_setup(event_loop, *ao, mixer_listener, + param, error)) { ao_plugin_finish(ao); return nullptr; } |