diff options
author | David Robillard <d@drobilla.net> | 2007-09-30 21:12:16 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-09-30 21:12:16 +0000 |
commit | 399ddfc5b1d4f1f131362d0439821778c6681b23 (patch) | |
tree | e8ca2536fa251f474817d0575bc3b4747c494954 /src/libs/engine/events/SetPortValueQueuedEvent.cpp | |
parent | c40ddfc0eebbcb3333d6cc9e3df7fb62ecb45941 (diff) | |
download | ingen-399ddfc5b1d4f1f131362d0439821778c6681b23.tar.gz ingen-399ddfc5b1d4f1f131362d0439821778c6681b23.tar.bz2 ingen-399ddfc5b1d4f1f131362d0439821778c6681b23.zip |
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
Diffstat (limited to 'src/libs/engine/events/SetPortValueQueuedEvent.cpp')
-rw-r--r-- | src/libs/engine/events/SetPortValueQueuedEvent.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libs/engine/events/SetPortValueQueuedEvent.cpp b/src/libs/engine/events/SetPortValueQueuedEvent.cpp index d0bfff4a..00de1cce 100644 --- a/src/libs/engine/events/SetPortValueQueuedEvent.cpp +++ b/src/libs/engine/events/SetPortValueQueuedEvent.cpp @@ -26,6 +26,7 @@ #include "ObjectStore.hpp" #include "AudioBuffer.hpp" #include "MidiBuffer.hpp" +#include "ProcessContext.hpp" namespace Ingen { @@ -88,10 +89,10 @@ SetPortValueQueuedEvent::pre_process() void -SetPortValueQueuedEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) +SetPortValueQueuedEvent::execute(ProcessContext& context) { - QueuedEvent::execute(nframes, start, end); - assert(_time >= start && _time <= end); + QueuedEvent::execute(context); + assert(_time >= context.start() && _time <= context.end()); if (_error == NO_ERROR) { assert(_port); @@ -99,7 +100,7 @@ SetPortValueQueuedEvent::execute(SampleCount nframes, FrameTime start, FrameTime Buffer* const buf = _port->buffer(0); AudioBuffer* const abuf = dynamic_cast<AudioBuffer*>(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) @@ -112,7 +113,7 @@ SetPortValueQueuedEvent::execute(SampleCount nframes, FrameTime start, FrameTime MidiBuffer* const mbuf = dynamic_cast<MidiBuffer*>(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); } } |