summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/InputPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-08-02 07:23:56 +0000
committerDavid Robillard <d@drobilla.net>2007-08-02 07:23:56 +0000
commit191b78d09365112a868ddaf3f813ef2b5bc2c252 (patch)
tree48000d7f46c7b7102f1e8f013b72eccd41418abe /src/libs/engine/InputPort.cpp
parenta8ea9db4af11208293543f50392127819c8007cd (diff)
downloadingen-191b78d09365112a868ddaf3f813ef2b5bc2c252.tar.gz
ingen-191b78d09365112a868ddaf3f813ef2b5bc2c252.tar.bz2
ingen-191b78d09365112a868ddaf3f813ef2b5bc2c252.zip
Implement MIDI copying, fixes MIDI patching from patch input -> patch output (fix ticket 70).
git-svn-id: http://svn.drobilla.net/lad/ingen@670 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/InputPort.cpp')
-rw-r--r--src/libs/engine/InputPort.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/libs/engine/InputPort.cpp b/src/libs/engine/InputPort.cpp
index 3b853edd..1580dc81 100644
--- a/src/libs/engine/InputPort.cpp
+++ b/src/libs/engine/InputPort.cpp
@@ -191,21 +191,32 @@ InputPort::pre_process(SampleCount nframes, FrameTime start, FrameTime end)
/*assert(!_is_tied || _tied_port != NULL);
assert(!_is_tied || _buffers.at(0)->data() == _tied_port->buffer(0)->data());*/
- for (uint32_t voice=0; voice < _poly; ++voice) {
- assert(_type == DataType::FLOAT);
- // Copy first connection
- ((AudioBuffer*)_buffers.at(voice))->copy(
- ((AudioBuffer*)(*_connections.begin())->buffer(voice)), 0, _buffer_size-1);
-
- // Accumulate the rest
- if (_connections.size() > 1) {
+ if (_type == DataType::FLOAT) {
+ for (uint32_t voice=0; voice < _poly; ++voice) {
+ // Copy first connection
+ _buffers.at(voice)->copy(
+ (*_connections.begin())->buffer(voice), 0, _buffer_size-1);
- Connections::iterator c = _connections.begin();
+ // Accumulate the rest
+ if (_connections.size() > 1) {
- for (++c; c != _connections.end(); ++c)
- ((AudioBuffer*)_buffers.at(voice))->accumulate(
+ Connections::iterator c = _connections.begin();
+
+ for (++c; c != _connections.end(); ++c)
+ ((AudioBuffer*)_buffers.at(voice))->accumulate(
((AudioBuffer*)(*c)->buffer(voice)), 0, _buffer_size-1);
+ }
}
+ } else {
+ assert(_poly == 1);
+
+ // FIXME
+ //if (_connections.size() > 1)
+ // cerr << "WARNING: MIDI mixing not implemented, only first connection used." << endl;
+
+ // Copy first connection
+ _buffers.at(0)->copy(
+ (*_connections.begin())->buffer(0), 0, _buffer_size-1);
}
}