From 5d1f579900182f283a1c21ad4e59daf7f035e219 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 9 Nov 2008 01:32:38 +0000 Subject: Move patch to /patch via HTTP to give a place for RESTful access to other things. Implement HTTP access to plugins. Work towards client being able to use HTTP to connect. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1712 a436a847-0d15-0410-975c-d299462d15a1 --- src/common/interface/Plugin.hpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/common/interface/Plugin.hpp') diff --git a/src/common/interface/Plugin.hpp b/src/common/interface/Plugin.hpp index 716c240e..db67bf08 100644 --- a/src/common/interface/Plugin.hpp +++ b/src/common/interface/Plugin.hpp @@ -29,15 +29,30 @@ class Plugin public: enum Type { LV2, LADSPA, Internal, Patch }; - virtual Type type() const = 0; - virtual const std::string& uri() const = 0; + virtual Type type() const = 0; + virtual const std::string& uri() const = 0; inline const char* type_uri() const { - if (type() == LV2) return "ingen:LV2"; - else if (type() == LADSPA) return "ingen:LADSPA"; - else if (type() == Internal) return "ingen:Internal"; - else if (type() == Patch) return "ingen:Patch"; - else return ""; + switch (type()) { + case LV2: return "lv2:Plugin"; + case LADSPA: return "ingen:LADSPAPlugin"; + case Internal: return "ingen:Internal"; + case Patch: return "ingen:Patch"; + default: return ""; + } + } + + static inline Type type_from_uri(const std::string& uri) { + if (uri == "lv2:Plugin") + return LV2; + else if (uri == "ingen:LADSPAPlugin") + return LADSPA; + else if (uri == "ingen:Internal") + return Internal; + else if (uri == "ingen:Patch") + return Patch; + else + return Internal; } }; -- cgit v1.2.1