summaryrefslogtreecommitdiffstats
path: root/src/common/interface
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-09 01:32:38 +0000
committerDavid Robillard <d@drobilla.net>2008-11-09 01:32:38 +0000
commit5d1f579900182f283a1c21ad4e59daf7f035e219 (patch)
treee73066002177cf48a31eef91712aa74839dfc555 /src/common/interface
parent23bb407a4f0db71eb15cbf8bbb8e82e02088a998 (diff)
downloadingen-5d1f579900182f283a1c21ad4e59daf7f035e219.tar.gz
ingen-5d1f579900182f283a1c21ad4e59daf7f035e219.tar.bz2
ingen-5d1f579900182f283a1c21ad4e59daf7f035e219.zip
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
Diffstat (limited to 'src/common/interface')
-rw-r--r--src/common/interface/Plugin.hpp29
1 files changed, 22 insertions, 7 deletions
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;
}
};