diff --git a/src/mixer/MixerAll.cxx b/src/mixer/MixerAll.cxx index 08775bdb2..0f20c05f1 100644 --- a/src/mixer/MixerAll.cxx +++ b/src/mixer/MixerAll.cxx @@ -20,7 +20,8 @@ #include "output/MultipleOutputs.hxx" #include "MixerControl.hxx" #include "MixerInternal.hxx" -#include "MixerList.hxx" +#include "plugins/NullMixerPlugin.hxx" +#include "plugins/SoftwareMixerPlugin.hxx" #include "lib/fmt/ExceptionFormatter.hxx" #include "pcm/Volume.hxx" #include "util/Domain.hxx" diff --git a/src/mixer/MixerInternal.hxx b/src/mixer/MixerInternal.hxx index 47d0c3507..2efbd7308 100644 --- a/src/mixer/MixerInternal.hxx +++ b/src/mixer/MixerInternal.hxx @@ -21,7 +21,6 @@ #define MPD_MIXER_INTERNAL_HXX #include "MixerPlugin.hxx" -#include "MixerList.hxx" #include "thread/Mutex.hxx" #include "util/Compiler.h" diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx index bd59088c7..e665449e4 100644 --- a/src/mixer/plugins/AlsaMixerPlugin.cxx +++ b/src/mixer/plugins/AlsaMixerPlugin.cxx @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "AlsaMixerPlugin.hxx" #include "lib/alsa/NonBlock.hxx" #include "lib/alsa/Error.hxx" #include "mixer/MixerInternal.hxx" diff --git a/src/mixer/plugins/AlsaMixerPlugin.hxx b/src/mixer/plugins/AlsaMixerPlugin.hxx new file mode 100644 index 000000000..dc77cdbae --- /dev/null +++ b/src/mixer/plugins/AlsaMixerPlugin.hxx @@ -0,0 +1,24 @@ +/* + * Copyright 2003-2022 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +struct MixerPlugin; + +extern const MixerPlugin alsa_mixer_plugin; diff --git a/src/mixer/plugins/AndroidMixerPlugin.cxx b/src/mixer/plugins/AndroidMixerPlugin.cxx index dff634db3..3be74eecd 100644 --- a/src/mixer/plugins/AndroidMixerPlugin.cxx +++ b/src/mixer/plugins/AndroidMixerPlugin.cxx @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "AndroidMixerPlugin.hxx" #include "mixer/MixerInternal.hxx" #include "filter/plugins/VolumeFilterPlugin.hxx" #include "pcm/Volume.hxx" diff --git a/src/mixer/MixerList.hxx b/src/mixer/plugins/AndroidMixerPlugin.hxx similarity index 61% rename from src/mixer/MixerList.hxx rename to src/mixer/plugins/AndroidMixerPlugin.hxx index 41f8eebbf..6481543e1 100644 --- a/src/mixer/MixerList.hxx +++ b/src/mixer/plugins/AndroidMixerPlugin.hxx @@ -17,25 +17,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/** \file - * - * This header provides "extern" declarations for all mixer plugins. - */ - -#ifndef MPD_MIXER_LIST_HXX -#define MPD_MIXER_LIST_HXX +#pragma once struct MixerPlugin; -extern const MixerPlugin null_mixer_plugin; -extern const MixerPlugin software_mixer_plugin; extern const MixerPlugin android_mixer_plugin; -extern const MixerPlugin alsa_mixer_plugin; -extern const MixerPlugin oss_mixer_plugin; -extern const MixerPlugin osx_mixer_plugin; -extern const MixerPlugin pulse_mixer_plugin; -extern const MixerPlugin winmm_mixer_plugin; -extern const MixerPlugin wasapi_mixer_plugin; -extern const MixerPlugin sndio_mixer_plugin; - -#endif diff --git a/src/mixer/plugins/NullMixerPlugin.cxx b/src/mixer/plugins/NullMixerPlugin.cxx index 8293d94bd..0deaeffe0 100644 --- a/src/mixer/plugins/NullMixerPlugin.cxx +++ b/src/mixer/plugins/NullMixerPlugin.cxx @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "NullMixerPlugin.hxx" #include "mixer/MixerInternal.hxx" class NullMixer final : public Mixer { diff --git a/src/mixer/plugins/NullMixerPlugin.hxx b/src/mixer/plugins/NullMixerPlugin.hxx new file mode 100644 index 000000000..5347c31ff --- /dev/null +++ b/src/mixer/plugins/NullMixerPlugin.hxx @@ -0,0 +1,24 @@ +/* + * Copyright 2003-2022 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +struct MixerPlugin; + +extern const MixerPlugin null_mixer_plugin; diff --git a/src/mixer/plugins/OSXMixerPlugin.cxx b/src/mixer/plugins/OSXMixerPlugin.cxx index 52bdaeaab..ac7b653a3 100644 --- a/src/mixer/plugins/OSXMixerPlugin.cxx +++ b/src/mixer/plugins/OSXMixerPlugin.cxx @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "OSXMixerPlugin.hxx" #include "mixer/MixerInternal.hxx" #include "output/plugins/OSXOutputPlugin.hxx" diff --git a/src/mixer/plugins/OSXMixerPlugin.hxx b/src/mixer/plugins/OSXMixerPlugin.hxx new file mode 100644 index 000000000..be190f3ef --- /dev/null +++ b/src/mixer/plugins/OSXMixerPlugin.hxx @@ -0,0 +1,24 @@ +/* + * Copyright 2003-2022 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +struct MixerPlugin; + +extern const MixerPlugin osx_mixer_plugin; diff --git a/src/mixer/plugins/OssMixerPlugin.cxx b/src/mixer/plugins/OssMixerPlugin.cxx index 2072805ec..5bf166649 100644 --- a/src/mixer/plugins/OssMixerPlugin.cxx +++ b/src/mixer/plugins/OssMixerPlugin.cxx @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "OssMixerPlugin.hxx" #include "mixer/MixerInternal.hxx" #include "config/Block.hxx" #include "io/FileDescriptor.hxx" diff --git a/src/mixer/plugins/OssMixerPlugin.hxx b/src/mixer/plugins/OssMixerPlugin.hxx new file mode 100644 index 000000000..91dd45984 --- /dev/null +++ b/src/mixer/plugins/OssMixerPlugin.hxx @@ -0,0 +1,24 @@ +/* + * Copyright 2003-2022 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +struct MixerPlugin; + +extern const MixerPlugin oss_mixer_plugin; diff --git a/src/mixer/plugins/PulseMixerPlugin.hxx b/src/mixer/plugins/PulseMixerPlugin.hxx index ac833f913..f009e7edf 100644 --- a/src/mixer/plugins/PulseMixerPlugin.hxx +++ b/src/mixer/plugins/PulseMixerPlugin.hxx @@ -17,13 +17,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MPD_PULSE_MIXER_PLUGIN_HXX -#define MPD_PULSE_MIXER_PLUGIN_HXX +#pragma once +struct MixerPlugin; class PulseMixer; struct pa_context; struct pa_stream; +extern const MixerPlugin pulse_mixer_plugin; + void pulse_mixer_on_connect(PulseMixer &pm, pa_context *context); @@ -32,5 +34,3 @@ pulse_mixer_on_disconnect(PulseMixer &pm); void pulse_mixer_on_change(PulseMixer &pm, pa_context *context, pa_stream *stream); - -#endif diff --git a/src/mixer/plugins/SndioMixerPlugin.cxx b/src/mixer/plugins/SndioMixerPlugin.cxx index f55691833..7e966b47c 100644 --- a/src/mixer/plugins/SndioMixerPlugin.cxx +++ b/src/mixer/plugins/SndioMixerPlugin.cxx @@ -16,6 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "SndioMixerPlugin.hxx" #include "mixer/MixerInternal.hxx" #include "output/plugins/SndioOutputPlugin.hxx" diff --git a/src/mixer/plugins/SndioMixerPlugin.hxx b/src/mixer/plugins/SndioMixerPlugin.hxx new file mode 100644 index 000000000..ddd1d4ba4 --- /dev/null +++ b/src/mixer/plugins/SndioMixerPlugin.hxx @@ -0,0 +1,24 @@ +/* + * Copyright 2003-2022 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +struct MixerPlugin; + +extern const MixerPlugin sndio_mixer_plugin; diff --git a/src/mixer/plugins/SoftwareMixerPlugin.hxx b/src/mixer/plugins/SoftwareMixerPlugin.hxx index 89cb057b2..bf1b20528 100644 --- a/src/mixer/plugins/SoftwareMixerPlugin.hxx +++ b/src/mixer/plugins/SoftwareMixerPlugin.hxx @@ -17,12 +17,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MPD_SOFTWARE_MIXER_PLUGIN_HXX -#define MPD_SOFTWARE_MIXER_PLUGIN_HXX +#pragma once +struct MixerPlugin; class Mixer; class Filter; +extern const MixerPlugin software_mixer_plugin; + /** * Attach a #VolumeFilter to this mixer. The #VolumeFilter is the * entity which actually applies the volume; it is created and managed @@ -31,5 +33,3 @@ class Filter; */ void software_mixer_set_filter(Mixer &mixer, Filter *filter) noexcept; - -#endif diff --git a/src/mixer/plugins/WasapiMixerPlugin.cxx b/src/mixer/plugins/WasapiMixerPlugin.cxx index 885b38e73..928e2eee9 100644 --- a/src/mixer/plugins/WasapiMixerPlugin.cxx +++ b/src/mixer/plugins/WasapiMixerPlugin.cxx @@ -19,6 +19,7 @@ #undef NOUSER // COM needs the "MSG" typedef +#include "WasapiMixerPlugin.hxx" #include "output/plugins/wasapi/ForMixer.hxx" #include "output/plugins/wasapi/AudioClient.hxx" #include "output/plugins/wasapi/Device.hxx" diff --git a/src/mixer/plugins/WasapiMixerPlugin.hxx b/src/mixer/plugins/WasapiMixerPlugin.hxx new file mode 100644 index 000000000..7bd52891d --- /dev/null +++ b/src/mixer/plugins/WasapiMixerPlugin.hxx @@ -0,0 +1,24 @@ +/* + * Copyright 2003-2022 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +struct MixerPlugin; + +extern const MixerPlugin wasapi_mixer_plugin; diff --git a/src/mixer/plugins/WinmmMixerPlugin.cxx b/src/mixer/plugins/WinmmMixerPlugin.cxx index 7307d474b..dc47649ae 100644 --- a/src/mixer/plugins/WinmmMixerPlugin.cxx +++ b/src/mixer/plugins/WinmmMixerPlugin.cxx @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "WinmmMixerPlugin.hxx" #include "mixer/MixerInternal.hxx" #include "output/Features.h" #include "output/OutputAPI.hxx" diff --git a/src/mixer/plugins/WinmmMixerPlugin.hxx b/src/mixer/plugins/WinmmMixerPlugin.hxx new file mode 100644 index 000000000..581064516 --- /dev/null +++ b/src/mixer/plugins/WinmmMixerPlugin.hxx @@ -0,0 +1,24 @@ +/* + * Copyright 2003-2022 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +struct MixerPlugin; + +extern const MixerPlugin winmm_mixer_plugin; diff --git a/src/output/Init.cxx b/src/output/Init.cxx index e14290993..29b1c8c6a 100644 --- a/src/output/Init.cxx +++ b/src/output/Init.cxx @@ -24,9 +24,10 @@ #include "Defaults.hxx" #include "lib/fmt/ExceptionFormatter.hxx" #include "pcm/AudioParser.hxx" -#include "mixer/MixerList.hxx" #include "mixer/MixerType.hxx" #include "mixer/MixerControl.hxx" +#include "mixer/plugins/NullMixerPlugin.hxx" +#include "mixer/plugins/SoftwareMixerPlugin.hxx" #include "filter/LoadChain.hxx" #include "filter/Prepared.hxx" #include "filter/plugins/AutoConvertFilterPlugin.hxx" diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index 3c5ed784a..c59b469f4 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -27,7 +27,7 @@ #include "lib/alsa/Version.hxx" #include "../OutputAPI.hxx" #include "../Error.hxx" -#include "mixer/MixerList.hxx" +#include "mixer/plugins/AlsaMixerPlugin.hxx" #include "pcm/Export.hxx" #include "system/PeriodClock.hxx" #include "thread/Mutex.hxx" diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx index 069e8329f..1a86ea02b 100644 --- a/src/output/plugins/OSXOutputPlugin.cxx +++ b/src/output/plugins/OSXOutputPlugin.cxx @@ -24,7 +24,7 @@ #include "apple/StringRef.hxx" #include "apple/Throw.hxx" #include "../OutputAPI.hxx" -#include "mixer/MixerList.hxx" +#include "mixer/plugins/OSXMixerPlugin.hxx" #include "util/RuntimeError.hxx" #include "util/Domain.hxx" #include "util/Manual.hxx" diff --git a/src/output/plugins/OssOutputPlugin.cxx b/src/output/plugins/OssOutputPlugin.cxx index 92a6f6d7a..f98bf6f1a 100644 --- a/src/output/plugins/OssOutputPlugin.cxx +++ b/src/output/plugins/OssOutputPlugin.cxx @@ -19,7 +19,7 @@ #include "OssOutputPlugin.hxx" #include "../OutputAPI.hxx" -#include "mixer/MixerList.hxx" +#include "mixer/plugins/OssMixerPlugin.hxx" #include "pcm/Export.hxx" #include "io/UniqueFileDescriptor.hxx" #include "system/Error.hxx" diff --git a/src/output/plugins/PulseOutputPlugin.cxx b/src/output/plugins/PulseOutputPlugin.cxx index 1ada1b4bf..c2ece7136 100644 --- a/src/output/plugins/PulseOutputPlugin.cxx +++ b/src/output/plugins/PulseOutputPlugin.cxx @@ -23,7 +23,6 @@ #include "lib/pulse/LockGuard.hxx" #include "../OutputAPI.hxx" #include "../Error.hxx" -#include "mixer/MixerList.hxx" #include "mixer/plugins/PulseMixerPlugin.hxx" #include "util/ScopeExit.hxx" diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx index bc1477d4c..8d1189f79 100644 --- a/src/output/plugins/SndioOutputPlugin.cxx +++ b/src/output/plugins/SndioOutputPlugin.cxx @@ -18,8 +18,8 @@ */ #include "SndioOutputPlugin.hxx" -#include "mixer/MixerList.hxx" #include "mixer/Listener.hxx" +#include "mixer/plugins/SndioMixerPlugin.hxx" #include "util/Domain.hxx" #include "Log.hxx" diff --git a/src/output/plugins/WinmmOutputPlugin.cxx b/src/output/plugins/WinmmOutputPlugin.cxx index 6e80ffe8c..34a5c40f7 100644 --- a/src/output/plugins/WinmmOutputPlugin.cxx +++ b/src/output/plugins/WinmmOutputPlugin.cxx @@ -20,7 +20,7 @@ #include "WinmmOutputPlugin.hxx" #include "../OutputAPI.hxx" #include "pcm/Buffer.hxx" -#include "mixer/MixerList.hxx" +#include "mixer/plugins/WinmmMixerPlugin.hxx" #include "fs/AllocatedPath.hxx" #include "util/RuntimeError.hxx" #include "util/StringCompare.hxx" diff --git a/src/output/plugins/sles/SlesOutputPlugin.cxx b/src/output/plugins/sles/SlesOutputPlugin.cxx index babb5447e..16f13fcd3 100644 --- a/src/output/plugins/sles/SlesOutputPlugin.cxx +++ b/src/output/plugins/sles/SlesOutputPlugin.cxx @@ -27,7 +27,7 @@ #include "thread/Cond.hxx" #include "util/Domain.hxx" #include "util/ByteOrder.hxx" -#include "mixer/MixerList.hxx" +#include "mixer/plugins/AndroidMixerPlugin.hxx" #include "Log.hxx" #include diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx index d56501312..940c79f08 100644 --- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx +++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx @@ -27,7 +27,7 @@ #include "output/OutputAPI.hxx" #include "lib/icu/Win32.hxx" #include "lib/fmt/AudioFormatFormatter.hxx" -#include "mixer/MixerList.hxx" +#include "mixer/plugins/WasapiMixerPlugin.hxx" #include "output/Error.hxx" #include "pcm/Export.hxx" #include "thread/Cond.hxx" diff --git a/test/read_mixer.cxx b/test/read_mixer.cxx index 5725d30e7..5887d14f0 100644 --- a/test/read_mixer.cxx +++ b/test/read_mixer.cxx @@ -19,7 +19,7 @@ #include "NullMixerListener.hxx" #include "mixer/MixerControl.hxx" -#include "mixer/MixerList.hxx" +#include "mixer/plugins/AlsaMixerPlugin.hxx" #include "filter/Registry.hxx" #include "event/Loop.hxx" #include "config/Block.hxx"