From 399ddfc5b1d4f1f131362d0439821778c6681b23 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 30 Sep 2007 21:12:16 +0000 Subject: Better design for process() signature (pass everything needed in a single object parameter). Working port "monitoring" (connect an output to a control input, GUI will animate controller). git-svn-id: http://svn.drobilla.net/lad/ingen@788 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/SetPortValueEvent.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/libs/engine/events/SetPortValueEvent.cpp') diff --git a/src/libs/engine/events/SetPortValueEvent.cpp b/src/libs/engine/events/SetPortValueEvent.cpp index c1f3c890..b0fc273e 100644 --- a/src/libs/engine/events/SetPortValueEvent.cpp +++ b/src/libs/engine/events/SetPortValueEvent.cpp @@ -25,6 +25,7 @@ #include "ObjectStore.hpp" #include "AudioBuffer.hpp" #include "MidiBuffer.hpp" +#include "ProcessContext.hpp" using namespace std; @@ -79,10 +80,10 @@ SetPortValueEvent::~SetPortValueEvent() void -SetPortValueEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) +SetPortValueEvent::execute(ProcessContext& context) { - Event::execute(nframes, start, end); - assert(_time >= start && _time <= end); + Event::execute(context); + assert(_time >= context.start() && _time <= context.end()); if (_port == NULL) _port = _engine.object_store()->find_port(_port_path); @@ -95,7 +96,7 @@ SetPortValueEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) Buffer* const buf = _port->buffer(0); AudioBuffer* const abuf = dynamic_cast(buf); if (abuf) { - const uint32_t offset = (buf->size() == 1) ? 0 : _time - start; + const uint32_t offset = (buf->size() == 1) ? 0 : _time - context.start(); if (_omni) for (uint32_t i=0; i < _port->poly(); ++i) @@ -108,7 +109,7 @@ SetPortValueEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) MidiBuffer* const mbuf = dynamic_cast(buf); if (mbuf) { - const double stamp = std::max((double)(_time - start), mbuf->latest_stamp()); + const double stamp = std::max((double)(_time - context.start()), mbuf->latest_stamp()); mbuf->append(stamp, _data_size, (const unsigned char*)_data); } } -- cgit v1.2.1