summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/DuplexPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-13 20:35:29 +0000
committerDavid Robillard <d@drobilla.net>2007-10-13 20:35:29 +0000
commitcf63c971c2a8ee8cc2ddcddb52ce8135cd29619b (patch)
treecaea057e24a2d498b8fc88a44867891e1ec3766c /src/libs/engine/DuplexPort.cpp
parent4d440f54870cd3934a49bab1ae98fad3f13f00d4 (diff)
downloadingen-cf63c971c2a8ee8cc2ddcddb52ce8135cd29619b.tar.gz
ingen-cf63c971c2a8ee8cc2ddcddb52ce8135cd29619b.tar.bz2
ingen-cf63c971c2a8ee8cc2ddcddb52ce8135cd29619b.zip
Fix sub-patch MIDI I/O.
Make buffer 'joining' (zero-copy connections) significantly less retarded. git-svn-id: http://svn.drobilla.net/lad/ingen@882 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/DuplexPort.cpp')
-rw-r--r--src/libs/engine/DuplexPort.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/libs/engine/DuplexPort.cpp b/src/libs/engine/DuplexPort.cpp
index 93b61b8c..0da8d9d4 100644
--- a/src/libs/engine/DuplexPort.cpp
+++ b/src/libs/engine/DuplexPort.cpp
@@ -23,6 +23,7 @@
#include "ConnectionImpl.hpp"
#include "OutputPort.hpp"
#include "NodeImpl.hpp"
+#include "ProcessContext.hpp"
using namespace std;
@@ -43,10 +44,26 @@ void
DuplexPort::pre_process(ProcessContext& context)
{
// <BrainHurt>
- InputPort::pre_process(context);
+
+ /*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 (_is_output) {
+
+ for (uint32_t i=0; i < _poly; ++i)
+ _buffers->at(i)->prepare_write(context.nframes());
+
+ } else {
+
+ for (uint32_t i=0; i < _poly; ++i)
+ _buffers->at(i)->prepare_read(context.nframes());
- if ( ! _is_output)
broadcast(context);
+ }
+
+ //cerr << "} pre " << path() << endl;
+
// </BrainHurt>
}
@@ -54,12 +71,20 @@ DuplexPort::pre_process(ProcessContext& context)
void
DuplexPort::post_process(ProcessContext& context)
{
+ /*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;*/
+
// <BrainHurt>
- if (_is_output)
+ if (_is_output) {
+ InputPort::pre_process(context); // Mix down inputs
broadcast(context);
+ }
OutputPort::pre_process(context);
// </BrainHurt>
+
+ //cerr << "} post " << path() << endl;
}