summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-10-25 09:09:21 +0200
committerMax Kellermann <max@musicpd.org>2018-10-25 09:09:21 +0200
commit8bb35e7bb65e0303ee26b271dbc41f468dd32cd8 (patch)
tree59d025c2e9f2765518f5b42389a3e0609e4a4acb /src/input
parent3e78c9ab48d9ad1aa525ee3577116c13e9f551ae (diff)
decoder/Thread: reimplement HasRemoteTagScanner() using the InputPlugin list
Diffstat (limited to 'src/input')
-rw-r--r--src/input/Registry.cxx11
-rw-r--r--src/input/Registry.hxx5
2 files changed, 16 insertions, 0 deletions
diff --git a/src/input/Registry.cxx b/src/input/Registry.cxx
index fba83515d..4a4dcff4b 100644
--- a/src/input/Registry.cxx
+++ b/src/input/Registry.cxx
@@ -83,3 +83,14 @@ const InputPlugin *const input_plugins[] = {
};
bool input_plugins_enabled[ARRAY_SIZE(input_plugins) - 1];
+
+bool
+HasRemoteTagScanner(const char *uri) noexcept
+{
+ input_plugins_for_each_enabled(plugin)
+ if (plugin->scan_tags != nullptr &&
+ plugin->SupportsUri(uri))
+ return true;
+
+ return false;
+}
diff --git a/src/input/Registry.hxx b/src/input/Registry.hxx
index 231292be1..6b5e72fb3 100644
--- a/src/input/Registry.hxx
+++ b/src/input/Registry.hxx
@@ -21,6 +21,7 @@
#define MPD_INPUT_REGISTRY_HXX
#include "check.h"
+#include "util/Compiler.h"
/**
* NULL terminated list of all input plugins which were enabled at
@@ -40,4 +41,8 @@ extern bool input_plugins_enabled[];
input_plugins_for_each(plugin) \
if (input_plugins_enabled[input_plugin_iterator - input_plugins])
+gcc_pure
+bool
+HasRemoteTagScanner(const char *uri) noexcept;
+
#endif