From b59584b387c4b77d09ba4c791eb711597f67c8c8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Apr 2007 08:11:59 +0000 Subject: MIDI patching fixes (clean disconnecting). git-svn-id: http://svn.drobilla.net/lad/ingen@416 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/DuplexPort.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/libs/engine/DuplexPort.cpp') diff --git a/src/libs/engine/DuplexPort.cpp b/src/libs/engine/DuplexPort.cpp index f4a71aae..c498c774 100644 --- a/src/libs/engine/DuplexPort.cpp +++ b/src/libs/engine/DuplexPort.cpp @@ -40,5 +40,31 @@ DuplexPort::DuplexPort(Node* parent, const string& name, size_t index, size_t po } +void +DuplexPort::pre_process(SampleCount nframes, FrameTime start, FrameTime end) +{ + if (_is_output) { + for (size_t i=0; i < _poly; ++i) + _buffers.at(i)->prepare_write(nframes); + } else { + for (size_t i=0; i < _poly; ++i) + _buffers.at(i)->prepare_read(nframes); + } +} + + +void +DuplexPort::post_process(SampleCount nframes, FrameTime start, FrameTime end) +{ + if (_is_output) { + for (size_t i=0; i < _poly; ++i) + _buffers.at(i)->prepare_read(nframes); + } else { + for (size_t i=0; i < _poly; ++i) + _buffers.at(i)->prepare_write(nframes); + } +} + + } // namespace Ingen -- cgit v1.2.1