Registry.cxx 2.19 KB
Newer Older
1
/*
2
 * Copyright 2003-2018 The Music Player Daemon Project
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 * 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.
 */

Max Kellermann's avatar
Max Kellermann committed
20
#include "Registry.hxx"
21
#include "InputPlugin.hxx"
22
#include "util/Macros.hxx"
23
#include "plugins/TidalInputPlugin.hxx"
24
#include "plugins/QobuzInputPlugin.hxx"
25
#include "config.h"
26

27
#ifdef ENABLE_ALSA
Max Kellermann's avatar
Max Kellermann committed
28
#include "plugins/AlsaInputPlugin.hxx"
29 30
#endif

31
#ifdef ENABLE_CURL
Max Kellermann's avatar
Max Kellermann committed
32
#include "plugins/CurlInputPlugin.hxx"
33 34
#endif

35
#ifdef ENABLE_FFMPEG
Max Kellermann's avatar
Max Kellermann committed
36
#include "plugins/FfmpegInputPlugin.hxx"
37 38
#endif

39
#ifdef ENABLE_SMBCLIENT
Max Kellermann's avatar
Max Kellermann committed
40
#include "plugins/SmbclientInputPlugin.hxx"
41 42
#endif

43 44 45 46
#ifdef ENABLE_NFS
#include "plugins/NfsInputPlugin.hxx"
#endif

47
#ifdef ENABLE_MMS
Max Kellermann's avatar
Max Kellermann committed
48
#include "plugins/MmsInputPlugin.hxx"
49 50
#endif

51
#ifdef ENABLE_CDIO_PARANOIA
Max Kellermann's avatar
Max Kellermann committed
52
#include "plugins/CdioParanoiaInputPlugin.hxx"
53 54
#endif

55
const InputPlugin *const input_plugins[] = {
56
#ifdef ENABLE_ALSA
57 58
	&input_plugin_alsa,
#endif
59 60 61
#ifdef ENABLE_TIDAL
	&tidal_input_plugin,
#endif
62 63 64
#ifdef ENABLE_QOBUZ
	&qobuz_input_plugin,
#endif
65 66 67
#ifdef ENABLE_CURL
	&input_plugin_curl,
#endif
68
#ifdef ENABLE_FFMPEG
69 70
	&input_plugin_ffmpeg,
#endif
71 72 73
#ifdef ENABLE_SMBCLIENT
	&input_plugin_smbclient,
#endif
74 75 76
#ifdef ENABLE_NFS
	&input_plugin_nfs,
#endif
77 78
#ifdef ENABLE_MMS
	&input_plugin_mms,
79 80 81
#endif
#ifdef ENABLE_CDIO_PARANOIA
	&input_plugin_cdio_paranoia,
82
#endif
83
	nullptr
84 85
};

86
bool input_plugins_enabled[ARRAY_SIZE(input_plugins) - 1];
87 88 89 90 91 92 93 94 95 96 97

bool
HasRemoteTagScanner(const char *uri) noexcept
{
	input_plugins_for_each_enabled(plugin)
		if (plugin->scan_tags != nullptr &&
		    plugin->SupportsUri(uri))
			return true;

	return false;
}