summaryrefslogtreecommitdiffstats
path: root/src/common/interface/Plugin.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-03 04:46:56 +0000
committerDavid Robillard <d@drobilla.net>2010-02-03 04:46:56 +0000
commit87597f85c5a69a9accd3ce2ed88f2a006173e885 (patch)
treea3ffa393e9aecbc55dae64bad3bd45ee317e6d26 /src/common/interface/Plugin.hpp
parenta645d2b8be4d7d31f6eef1649156b166a01e0c31 (diff)
downloadingen-87597f85c5a69a9accd3ce2ed88f2a006173e885.tar.gz
ingen-87597f85c5a69a9accd3ce2ed88f2a006173e885.tar.bz2
ingen-87597f85c5a69a9accd3ce2ed88f2a006173e885.zip
Comprehensive use of cached URIs and more advanced Value (Atom) system.
Atoms (e.g. property values or port values) can now be an Atom::DICT, which maps directly to/from an RDF resource. This is now used to store control bindings as a port property, eliminating the special API. Full interned URIs used everywhere, instead of CURIEs pretending to be URIs. Avoid converting string literals to URIs all over the place. Support for binding MIDI pitch bender and MIDI channel pressure. Saving/restoring of MIDI bindings as a free side-effect of the above. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2409 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/common/interface/Plugin.hpp')
-rw-r--r--src/common/interface/Plugin.hpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/common/interface/Plugin.hpp b/src/common/interface/Plugin.hpp
index d3d74970..22464e91 100644
--- a/src/common/interface/Plugin.hpp
+++ b/src/common/interface/Plugin.hpp
@@ -19,6 +19,7 @@
#define INGEN_INTERFACE_PLUGIN_HPP
#include <string>
+#include "raul/URI.hpp"
#include "interface/Resource.hpp"
namespace Ingen {
@@ -32,26 +33,31 @@ public:
virtual Type type() const = 0;
- inline const char* type_uri() const {
- 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 const Raul::URI& type_uri(Type type) {
+ static const Raul::URI uris[] = {
+ "http://drobilla.net/ns/ingen#nil",
+ "http://lv2plug.in/ns/lv2core#Plugin",
+ "http://drobilla.net/ns/ingen#LADSPAPlugin",
+ "http://drobilla.net/ns/ingen#Internal",
+ "http://drobilla.net/ns/ingen#Patch"
+ };
+
+ return uris[type];
}
- static inline Type type_from_uri(const std::string& uri) {
- if (uri == "lv2:Plugin")
+ inline const Raul::URI& type_uri() const { return type_uri(type()); }
+
+ static inline Type type_from_uri(const Raul::URI& uri) {
+ if (uri == type_uri(LV2))
return LV2;
- else if (uri == "ingen:LADSPAPlugin")
+ else if (uri == type_uri(LADSPA))
return LADSPA;
- else if (uri == "ingen:Internal")
+ else if (uri == type_uri(Internal))
return Internal;
- else if (uri == "ingen:Patch")
+ else if (uri == type_uri(Patch))
return Patch;
- return NIL;
+ else
+ return NIL;
}
};