summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/JackMidiDriver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-21 15:14:53 +0000
committerDavid Robillard <d@drobilla.net>2008-01-21 15:14:53 +0000
commitd6b87aa26ef482a8952437f7472b81a2240f01fd (patch)
tree620d233b902c78413dc17ee5f921633251239695 /src/libs/engine/JackMidiDriver.cpp
parent2356f96fbd6c9d70dedcd0d64bf0d72786ea36bb (diff)
downloadingen-d6b87aa26ef482a8952437f7472b81a2240f01fd.tar.gz
ingen-d6b87aa26ef482a8952437f7472b81a2240f01fd.tar.bz2
ingen-d6b87aa26ef482a8952437f7472b81a2240f01fd.zip
Work on generic LV2 events.
git-svn-id: http://svn.drobilla.net/lad/ingen@1090 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/JackMidiDriver.cpp')
-rw-r--r--src/libs/engine/JackMidiDriver.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/libs/engine/JackMidiDriver.cpp b/src/libs/engine/JackMidiDriver.cpp
index ff052256..8d9853f2 100644
--- a/src/libs/engine/JackMidiDriver.cpp
+++ b/src/libs/engine/JackMidiDriver.cpp
@@ -24,7 +24,7 @@
#include "JackMidiDriver.hpp"
#include "ThreadManager.hpp"
#include "AudioDriver.hpp"
-#include "MidiBuffer.hpp"
+#include "EventBuffer.hpp"
#include "DuplexPort.hpp"
#include "ProcessContext.hpp"
#include "jack_compat.h"
@@ -73,7 +73,7 @@ JackMidiPort::pre_process(ProcessContext& context)
assert(_patch_port->poly() == 1);
- MidiBuffer* patch_buf = dynamic_cast<MidiBuffer*>(_patch_port->buffer(0));
+ EventBuffer* patch_buf = dynamic_cast<EventBuffer*>(_patch_port->buffer(0));
assert(patch_buf);
void* jack_buffer = jack_port_get_buffer(_jack_port, context.nframes());
@@ -86,7 +86,8 @@ JackMidiPort::pre_process(ProcessContext& context)
jack_midi_event_t ev;
jack_midi_event_get(&ev, jack_buffer, i);
- bool success = patch_buf->append(ev.time, ev.size, ev.buffer);
+ // FIXME: type
+ const bool success = patch_buf->append(ev.time, 0, 0, ev.size, ev.buffer);
if (!success)
cerr << "WARNING: Failed to write MIDI to port buffer, event(s) lost!" << endl;
}
@@ -108,7 +109,7 @@ JackMidiPort::post_process(ProcessContext& context)
assert(_patch_port->poly() == 1);
- MidiBuffer* patch_buf = dynamic_cast<MidiBuffer*>(_patch_port->buffer(0));
+ EventBuffer* patch_buf = dynamic_cast<EventBuffer*>(_patch_port->buffer(0));
assert(patch_buf);
void* jack_buffer = jack_port_get_buffer(_jack_port, context.nframes());
@@ -118,14 +119,17 @@ JackMidiPort::post_process(ProcessContext& context)
jack_midi_clear_buffer(jack_buffer);
- double time = 0;
- uint32_t size = 0;
- unsigned char* data = NULL;
+ uint32_t frames = 0;
+ uint32_t subframes = 0;
+ uint16_t type = 0;
+ uint16_t size = 0;
+ uint8_t* data = NULL;
// Copy events from Jack port buffer into patch port buffer
for (jack_nframes_t i=0; i < event_count; ++i) {
- patch_buf->get_event(&time, &size, &data);
- jack_midi_event_write(jack_buffer, time, data, size);
+ patch_buf->get_event(&frames, &subframes, &type, &size, &data);
+ // FIXME: type
+ jack_midi_event_write(jack_buffer, frames, data, size);
}
//if (event_count)