diff options
author | David Robillard <d@drobilla.net> | 2011-03-10 03:09:51 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-03-10 03:09:51 +0000 |
commit | aae0d7d82bcc60d6977dd11bcdc60579aace04cb (patch) | |
tree | bf0a4cf310e166448cf6295d799c75f9bd476409 | |
parent | 2290ef683f154abebe60dfb0392a21325d2a61e0 (diff) | |
download | ingen-aae0d7d82bcc60d6977dd11bcdc60579aace04cb.tar.gz ingen-aae0d7d82bcc60d6977dd11bcdc60579aace04cb.tar.bz2 ingen-aae0d7d82bcc60d6977dd11bcdc60579aace04cb.zip |
Use LV2_EVENT_URI.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3062 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/engine/JackDriver.cpp | 4 | ||||
-rw-r--r-- | src/shared/LV2URIMap.cpp | 17 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp index 5f7a7d83..6b9e3f93 100644 --- a/src/engine/JackDriver.cpp +++ b/src/engine/JackDriver.cpp @@ -145,7 +145,9 @@ JackPort::pre_process(ProcessContext& context) jack_midi_event_t ev; jack_midi_event_get(&ev, jack_buf, i); - if (!patch_buf->append(ev.time, 0, _driver->_midi_event_type, ev.size, ev.buffer)) + if (!patch_buf->append(ev.time, 0, + _driver->_midi_event_type, + ev.size, ev.buffer)) LOG(warn) << "Failed to write MIDI to port buffer, event(s) lost!" << endl; } } diff --git a/src/shared/LV2URIMap.cpp b/src/shared/LV2URIMap.cpp index d72739df..b7ad7b07 100644 --- a/src/shared/LV2URIMap.cpp +++ b/src/shared/LV2URIMap.cpp @@ -16,12 +16,19 @@ */ #define __STDC_LIMIT_MACROS 1 -#include <cassert> + +#include <assert.h> #include <stdint.h> + #include <glib.h> + #include <boost/shared_ptr.hpp> + #include "raul/log.hpp" + #include "lv2/lv2plug.in/ns/ext/atom/atom.h" +#include "lv2/lv2plug.in/ns/ext/event/event.h" + #include "LV2URIMap.hpp" using namespace std; @@ -132,18 +139,18 @@ LV2URIMap::uri_to_id(const char* map, const char* uri) { const uint32_t id = static_cast<uint32_t>(g_quark_from_string(uri)); - if (map && !strcmp(map, "http://lv2plug.in/ns/ext/event")) { + if (map && !strcmp(map, LV2_EVENT_URI)) { GlobalToEvent::iterator i = _global_to_event.find(id); if (i != _global_to_event.end()) { return i->second; } else { if (_global_to_event.size() + 1 > UINT16_MAX) { error << "Event URI " << uri << " ID out of range." << endl; - return NULL; + return 0; } const uint16_t ev_id = _global_to_event.size() + 1; assert(_event_to_global.find(ev_id) == _event_to_global.end()); - _global_to_event.insert(make_pair(id, ev_id)); + _global_to_event.insert(make_pair(id, ev_id)); _event_to_global.insert(make_pair(ev_id, id)); return ev_id; } @@ -157,7 +164,7 @@ const char* LV2URIMap::id_to_uri(const char* map, const uint32_t id) { - if (map && !strcmp(map, "http://lv2plug.in/ns/ext/event")) { + if (map && !strcmp(map, LV2_EVENT_URI)) { EventToGlobal::iterator i = _event_to_global.find(id); if (i == _event_to_global.end()) { error << "Failed to unmap event URI " << id << endl; |