Registry.cxx 2.92 KB
Newer Older
1
/*
Max Kellermann's avatar
Max Kellermann committed
2
 * Copyright 2003-2021 The Music Player Daemon Project
3
 * http://www.musicpd.org
4 5 6 7 8 9 10 11 12 13
 *
 * 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.
14 15 16 17
 *
 * 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.
18 19
 */

20
#include "config.h"
21
#include "Registry.hxx"
22
#include "OutputPlugin.hxx"
23
#include "output/Features.h"
24 25 26
#include "plugins/AlsaOutputPlugin.hxx"
#include "plugins/AoOutputPlugin.hxx"
#include "plugins/FifoOutputPlugin.hxx"
27
#include "plugins/SndioOutputPlugin.hxx"
28
#include "plugins/httpd/HttpdOutputPlugin.hxx"
29
#include "plugins/HaikuOutputPlugin.hxx"
30 31 32 33 34 35 36 37 38
#include "plugins/JackOutputPlugin.hxx"
#include "plugins/NullOutputPlugin.hxx"
#include "plugins/OpenALOutputPlugin.hxx"
#include "plugins/OssOutputPlugin.hxx"
#include "plugins/OSXOutputPlugin.hxx"
#include "plugins/PipeOutputPlugin.hxx"
#include "plugins/PulseOutputPlugin.hxx"
#include "plugins/RecorderOutputPlugin.hxx"
#include "plugins/ShoutOutputPlugin.hxx"
39
#include "plugins/sles/SlesOutputPlugin.hxx"
40
#include "plugins/SolarisOutputPlugin.hxx"
41
#ifdef ENABLE_WINMM_OUTPUT
42
#include "plugins/WinmmOutputPlugin.hxx"
43 44 45 46
#endif
#ifdef ENABLE_WASAPI_OUTPUT
#include "plugins/WasapiOutputPlugin.hxx"
#endif
47
#include "util/StringAPI.hxx"
Max Kellermann's avatar
Max Kellermann committed
48

49
constexpr const AudioOutputPlugin *audio_output_plugins[] = {
50
#ifdef HAVE_SHOUT
51
	&shout_output_plugin,
52
#endif
Max Kellermann's avatar
Max Kellermann committed
53
	&null_output_plugin,
54 55 56
#ifdef ANDROID
	&sles_output_plugin,
#endif
57
#ifdef HAVE_FIFO
Max Kellermann's avatar
Max Kellermann committed
58
	&fifo_output_plugin,
59
#endif
60
#ifdef ENABLE_SNDIO
61 62
	&sndio_output_plugin,
#endif
63
#ifdef ENABLE_HAIKU
64 65
	&haiku_output_plugin,
#endif
66 67 68
#ifdef ENABLE_PIPE_OUTPUT
	&pipe_output_plugin,
#endif
69
#ifdef ENABLE_ALSA
70
	&alsa_output_plugin,
71
#endif
72
#ifdef ENABLE_AO
Max Kellermann's avatar
Max Kellermann committed
73
	&ao_output_plugin,
74 75
#endif
#ifdef HAVE_OSS
Max Kellermann's avatar
Max Kellermann committed
76
	&oss_output_plugin,
77
#endif
Serge Ziryukin's avatar
Serge Ziryukin committed
78 79 80
#ifdef HAVE_OPENAL
	&openal_output_plugin,
#endif
81
#ifdef HAVE_OSX
82
	&osx_output_plugin,
83
#endif
84 85 86
#ifdef ENABLE_SOLARIS_OUTPUT
	&solaris_output_plugin,
#endif
87
#ifdef ENABLE_PULSE
88
	&pulse_output_plugin,
89
#endif
90
#ifdef ENABLE_JACK
91
	&jack_output_plugin,
92 93 94
#endif
#ifdef ENABLE_HTTPD_OUTPUT
	&httpd_output_plugin,
95 96 97
#endif
#ifdef ENABLE_RECORDER_OUTPUT
	&recorder_output_plugin,
98
#endif
99 100
#ifdef ENABLE_WINMM_OUTPUT
	&winmm_output_plugin,
101 102 103
#endif
#ifdef ENABLE_WASAPI_OUTPUT
	&wasapi_output_plugin,
104
#endif
105
	nullptr
106 107
};

108 109
const AudioOutputPlugin *
AudioOutputPlugin_get(const char *name)
110
{
111
	audio_output_plugins_for_each(plugin)
112
		if (StringIsEqual(plugin->name, name))
113
			return plugin;
114

115
	return nullptr;
116
}