summaryrefslogtreecommitdiffstats
path: root/src/common/interface/EventType.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/EventType.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/EventType.hpp')
-rw-r--r--src/common/interface/EventType.hpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/common/interface/EventType.hpp b/src/common/interface/EventType.hpp
index 3f3def1d..1e9a1b16 100644
--- a/src/common/interface/EventType.hpp
+++ b/src/common/interface/EventType.hpp
@@ -18,6 +18,8 @@
#ifndef INGEN_INTERFACE_EVENTTYPE_HPP
#define INGEN_INTERFACE_EVENTTYPE_HPP
+#include "raul/URI.hpp"
+
namespace Ingen {
namespace Shared {
@@ -33,7 +35,7 @@ public:
OSC = 2
};
- EventType(const std::string& uri)
+ EventType(const Raul::URI& uri)
: _symbol(UNKNOWN)
{
if (uri == type_uri(MIDI)) {
@@ -47,7 +49,7 @@ public:
: _symbol(symbol)
{}
- inline const char* uri() const { return type_uri(_symbol); }
+ inline const Raul::URI& uri() const { return type_uri(_symbol); }
inline bool operator==(const Symbol& symbol) const { return (_symbol == symbol); }
inline bool operator!=(const Symbol& symbol) const { return (_symbol != symbol); }
@@ -58,13 +60,14 @@ public:
inline bool is_osc() { return _symbol == OSC; }
private:
-
- static inline const char* type_uri(unsigned symbol_num) {
- switch (symbol_num) {
- case 1: return "ingen:MidiEvent";
- case 2: return "ingen:OSCEvent";
- default: return "";
- }
+ static inline const Raul::URI& type_uri(unsigned symbol_num) {
+ assert(symbol_num <= OSC);
+ static const Raul::URI uris[] = {
+ "http://drobilla.net/ns/ingen#nil",
+ "http://drobilla.net/ns/ingen#MidiEvent",
+ "http://drobilla.net/ns/ingen#OSCEvent"
+ };
+ return uris[symbol_num];
}
Symbol _symbol;