From 34093b89423e7d195972e68676c73853228d35f6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 20 May 2008 05:21:43 +0000 Subject: Fix direct midi in -> midi out connections in root patch with plugins present. Fix Jack MIDI output. Attempted fixes for LV2 UI MIDI event writing, but.. still not working? git-svn-id: http://svn.drobilla.net/lad/ingen@1223 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/DuplexPort.cpp | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'src/libs/engine/DuplexPort.cpp') diff --git a/src/libs/engine/DuplexPort.cpp b/src/libs/engine/DuplexPort.cpp index 7fde9d0d..71a65e4f 100644 --- a/src/libs/engine/DuplexPort.cpp +++ b/src/libs/engine/DuplexPort.cpp @@ -24,6 +24,7 @@ #include "OutputPort.hpp" #include "NodeImpl.hpp" #include "ProcessContext.hpp" +#include "EventBuffer.hpp" using namespace std; @@ -45,14 +46,22 @@ DuplexPort::pre_process(ProcessContext& context) { // - /*cerr << path() << " duplex pre: fixed buffers: " << fixed_buffers() << endl; + /*cerr << endl << "{ duplex pre" << endl; + cerr << path() << " duplex pre: fixed buffers: " << fixed_buffers() << endl; cerr << path() << " duplex pre: buffer: " << buffer(0) << endl; cerr << path() << " duplex pre: is_output: " << _is_output << " { " << endl;*/ + /*if (type() == DataType::EVENT) + for (uint32_t i=0; i < _poly; ++i) + cerr << path() << " (" << buffer(i) << ") # events: " + << ((EventBuffer*)buffer(i))->event_count() + << ", joined: " << _buffers->at(i)->is_joined() << endl;*/ + if (_is_output) { for (uint32_t i=0; i < _poly; ++i) - _buffers->at(i)->prepare_write(context.nframes()); + if (!_buffers->at(i)->is_joined()) + _buffers->at(i)->prepare_write(context.nframes()); } else { @@ -62,7 +71,7 @@ DuplexPort::pre_process(ProcessContext& context) broadcast(context); } - //cerr << "} pre " << path() << endl; + //cerr << "} duplex pre " << path() << endl; // } @@ -71,20 +80,27 @@ DuplexPort::pre_process(ProcessContext& context) void DuplexPort::post_process(ProcessContext& context) { - /*cerr << path() << " duplex post: fixed buffers: " << fixed_buffers() << endl; + // + + /*cerr << endl << "{ duplex post" << endl; + cerr << path() << " duplex post: fixed buffers: " << fixed_buffers() << endl; cerr << path() << " duplex post: buffer: " << buffer(0) << endl; - cerr << path() << " duplex post: is_output: " << _is_output << " { " << endl;*/ + cerr << path() << " duplex post: is_output: " << _is_output << " { " << endl; - // + if (type() == DataType::EVENT) + for (uint32_t i=0; i < _poly; ++i) + cerr << path() << " (" << buffer(i) << ") # events: " + << ((EventBuffer*)buffer(i))->event_count() + << ", joined: " << _buffers->at(i)->is_joined() << endl;*/ + if (_is_output) { InputPort::pre_process(context); // Mix down inputs broadcast(context); } - - OutputPort::pre_process(context); - // - //cerr << "} post " << path() << endl; + //cerr << "} duplex post " << path() << endl; + + // } -- cgit v1.2.1