diff options
author | David Robillard <d@drobilla.net> | 2008-04-12 18:07:44 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-04-12 18:07:44 +0000 |
commit | 56b36b843389f6e52dcdb31878ea6262cca56b42 (patch) | |
tree | 81d75b35176054fabaf7e51c8f8bbb0a85a68f68 /src | |
parent | a6ab331fb757ff0f20d9b7c2fd0079210b303d96 (diff) | |
download | ingen-56b36b843389f6e52dcdb31878ea6262cca56b42.tar.gz ingen-56b36b843389f6e52dcdb31878ea6262cca56b42.tar.bz2 ingen-56b36b843389f6e52dcdb31878ea6262cca56b42.zip |
LV2 event/MIDI fixed for Ingen from larsl.
git-svn-id: http://svn.drobilla.net/lad/ingen@1180 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/engine/EventBuffer.cpp | 5 | ||||
-rw-r--r-- | src/libs/engine/JackMidiDriver.cpp | 5 | ||||
-rw-r--r-- | src/libs/engine/LV2Info.cpp | 6 | ||||
-rw-r--r-- | src/libs/gui/WindowFactory.hpp | 4 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/libs/engine/EventBuffer.cpp b/src/libs/engine/EventBuffer.cpp index a9a6c938..2173551a 100644 --- a/src/libs/engine/EventBuffer.cpp +++ b/src/libs/engine/EventBuffer.cpp @@ -49,6 +49,7 @@ EventBuffer::EventBuffer(size_t capacity) _local_buf->event_count = 0; _local_buf->capacity = (uint32_t)capacity; _local_buf->size = 0; + _local_buf->data = reinterpret_cast<uint8_t*>(_local_buf + 1); _buf = _local_buf; reset(0); @@ -165,9 +166,7 @@ EventBuffer::append(uint32_t frames, || (last_event->frames == frames && last_event->subframes <= subframes)); #endif - bool ret = lv2_event_is_valid(&_iter); - if (ret) - ret = lv2_event_write(&_iter, frames, subframes, type, size, data); + bool ret = lv2_event_write(&_iter, frames, subframes, type, size, data); if (!ret) cerr << "ERROR: Failed to write event." << endl; diff --git a/src/libs/engine/JackMidiDriver.cpp b/src/libs/engine/JackMidiDriver.cpp index 8d9853f2..2cdd2489 100644 --- a/src/libs/engine/JackMidiDriver.cpp +++ b/src/libs/engine/JackMidiDriver.cpp @@ -86,8 +86,9 @@ JackMidiPort::pre_process(ProcessContext& context) jack_midi_event_t ev; jack_midi_event_get(&ev, jack_buffer, i); - // FIXME: type - const bool success = patch_buf->append(ev.time, 0, 0, ev.size, ev.buffer); + // FIXME: type is hardcoded for now, we should get it from + // the type map instead + const bool success = patch_buf->append(ev.time, 0, 1, ev.size, ev.buffer); if (!success) cerr << "WARNING: Failed to write MIDI to port buffer, event(s) lost!" << endl; } diff --git a/src/libs/engine/LV2Info.cpp b/src/libs/engine/LV2Info.cpp index 23f2ede6..d1af757f 100644 --- a/src/libs/engine/LV2Info.cpp +++ b/src/libs/engine/LV2Info.cpp @@ -41,6 +41,12 @@ LV2Info::LV2Info(SLV2World world) lv2_features[0] = &uri_map_feature; lv2_features[1] = NULL; + + /* this is needed so we get a fixed type ID for MIDI, it would + probably be better to make the type map accessible from any + JackMidiPort. */ + next_uri_id++; + uri_map.insert(make_pair(string("http://lv2plug.in/ns/ext/midi#MidiEvent"), 1)); } diff --git a/src/libs/gui/WindowFactory.hpp b/src/libs/gui/WindowFactory.hpp index 06f2f637..618b027c 100644 --- a/src/libs/gui/WindowFactory.hpp +++ b/src/libs/gui/WindowFactory.hpp @@ -58,9 +58,9 @@ public: PatchWindow* patch_window(SharedPtr<PatchModel> patch); NodeControlWindow* control_window(SharedPtr<NodeModel> node); - void present_patch(SharedPtr<PatchModel> patch, + void present_patch(SharedPtr<PatchModel> model, PatchWindow* preferred = NULL, - SharedPtr<PatchView> patch = SharedPtr<PatchView>()); + SharedPtr<PatchView> view = SharedPtr<PatchView>()); void present_controls(SharedPtr<NodeModel> node); |