summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-07-29 05:50:52 +0000
committerDavid Robillard <d@drobilla.net>2008-07-29 05:50:52 +0000
commitf0e920ab170569fc9eaf5858af2e9ae3e8d44993 (patch)
tree1e1fa0a7b2bfeb0e6ca4541c570f445fc4541ff0 /src/libs/engine/events
parentde58b508b28a42b072fb26d2633aa0af37ee7c0e (diff)
downloadingen-f0e920ab170569fc9eaf5858af2e9ae3e8d44993.tar.gz
ingen-f0e920ab170569fc9eaf5858af2e9ae3e8d44993.tar.bz2
ingen-f0e920ab170569fc9eaf5858af2e9ae3e8d44993.zip
Fix stateful port value setting stuff (trigger output ports on note/trigger/etc modules now work correctly).
git-svn-id: http://svn.drobilla.net/lad/ingen@1302 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/NoteEvent.cpp8
-rw-r--r--src/libs/engine/events/SetPortValueEvent.cpp8
2 files changed, 7 insertions, 9 deletions
diff --git a/src/libs/engine/events/NoteEvent.cpp b/src/libs/engine/events/NoteEvent.cpp
index ff96e94c..8f262d14 100644
--- a/src/libs/engine/events/NoteEvent.cpp
+++ b/src/libs/engine/events/NoteEvent.cpp
@@ -72,14 +72,14 @@ NoteEvent::execute(ProcessContext& context)
if (_node != NULL && _node->plugin()->type() == Plugin::Internal) {
if (_on) {
if (_node->plugin_impl()->uri() == "ingen:note_node")
- ((MidiNoteNode*)_node)->note_on(_note_num, _velocity, _time, context);
+ ((MidiNoteNode*)_node)->note_on(context, _note_num, _velocity, _time);
else if (_node->plugin_impl()->uri() == "ingen:trigger_node")
- ((MidiTriggerNode*)_node)->note_on(_note_num, _velocity, _time, context);
+ ((MidiTriggerNode*)_node)->note_on(context, _note_num, _velocity, _time);
} else {
if (_node->plugin_impl()->uri() == "ingen:note_node")
- ((MidiNoteNode*)_node)->note_off(_note_num, _time, context);
+ ((MidiNoteNode*)_node)->note_off(context, _note_num, _time);
else if (_node->plugin_impl()->uri() == "ingen:trigger_node")
- ((MidiTriggerNode*)_node)->note_off(_note_num, _time, context);
+ ((MidiTriggerNode*)_node)->note_off(context, _note_num, _time);
}
}
}
diff --git a/src/libs/engine/events/SetPortValueEvent.cpp b/src/libs/engine/events/SetPortValueEvent.cpp
index cf4ce6fd..267db836 100644
--- a/src/libs/engine/events/SetPortValueEvent.cpp
+++ b/src/libs/engine/events/SetPortValueEvent.cpp
@@ -125,13 +125,11 @@ SetPortValueEvent::execute(ProcessContext& context)
Buffer* const buf = _port->buffer(0);
AudioBuffer* const abuf = dynamic_cast<AudioBuffer*>(buf);
if (abuf) {
- const uint32_t offset = (buf->size() == 1) ? 0 : _time - context.start();
-
if (_omni)
for (uint32_t i=0; i < _port->poly(); ++i)
- ((AudioBuffer*)_port->buffer(i))->set(*(float*)_data, offset);
+ ((AudioBuffer*)_port->buffer(i))->set_value(*(float*)_data, context.start(), _time);
else
- ((AudioBuffer*)_port->buffer(_voice_num))->set(*(float*)_data, offset);
+ ((AudioBuffer*)_port->buffer(_voice_num))->set_value(*(float*)_data, context.start(), _time);
return;
}
@@ -143,7 +141,7 @@ SetPortValueEvent::execute(ProcessContext& context)
LV2URIMap* map = (LV2URIMap*)f->controller;
const uint32_t type_id = map->uri_to_id(NULL, "http://lv2plug.in/ns/ext/midi#MidiEvent");
const uint32_t frames = std::max((uint32_t)(_time - context.start()), ebuf->latest_frames());
- ebuf->prepare_write(context.nframes());
+ ebuf->prepare_write(context.start(), context.nframes());
// FIXME: how should this work? binary over OSC, ick
// Message is an event:
ebuf->append(frames, 0, type_id, _data_size, (const unsigned char*)_data);