summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/SetPortValueEvent.cpp
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/SetPortValueEvent.cpp
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/SetPortValueEvent.cpp')
-rw-r--r--src/libs/engine/events/SetPortValueEvent.cpp8
1 files changed, 3 insertions, 5 deletions
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);