summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/InputPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-18 15:13:05 +0000
committerDavid Robillard <d@drobilla.net>2007-09-18 15:13:05 +0000
commitcbc7847a12e57176c5bafa9baa007de6865745c7 (patch)
tree0ca368a06c025c3898682b1bfa18fbb048e45b9b /src/libs/engine/InputPort.cpp
parent33f66f46c1f1e9774e5b59a9637d2bfabd700394 (diff)
downloadingen-cbc7847a12e57176c5bafa9baa007de6865745c7.tar.gz
ingen-cbc7847a12e57176c5bafa9baa007de6865745c7.tar.bz2
ingen-cbc7847a12e57176c5bafa9baa007de6865745c7.zip
Work on dynamic polyphony.
git-svn-id: http://svn.drobilla.net/lad/ingen@720 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/InputPort.cpp')
-rw-r--r--src/libs/engine/InputPort.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/libs/engine/InputPort.cpp b/src/libs/engine/InputPort.cpp
index 5025f6e3..edc89225 100644
--- a/src/libs/engine/InputPort.cpp
+++ b/src/libs/engine/InputPort.cpp
@@ -55,25 +55,25 @@ InputPort::add_connection(Raul::ListNode<Connection*>* const c)
if (_connections.size() == 1) {
// Use buffer directly to avoid copying
for (uint32_t i=0; i < _poly; ++i) {
- _buffers.at(i)->join(c->elem()->buffer(i));
+ _buffers->at(i)->join(c->elem()->buffer(i));
//if (_is_tied)
- // _tied_port->buffer(i)->join(_buffers.at(i));
- //assert(_buffers.at(i)->data() == c->elem()->buffer(i)->data());
+ // _tied_port->buffer(i)->join(_buffers->at(i));
+ //assert(_buffers->at(i)->data() == c->elem()->buffer(i)->data());
}
} else if (_connections.size() == 2) {
// Used to directly use single connection buffer, now there's two
// so have to use local ones again and mix down
for (uint32_t i=0; i < _poly; ++i) {
- _buffers.at(i)->unjoin();
+ _buffers->at(i)->unjoin();
//if (_is_tied)
- // _tied_port->buffer(i)->join(_buffers.at(i));
+ // _tied_port->buffer(i)->join(_buffers->at(i));
}
}
Port::connect_buffers();
}
//assert( ! _is_tied || _tied_port != NULL);
- //assert( ! _is_tied || _buffers.at(0)->data() == _tied_port->buffer(0)->data());
+ //assert( ! _is_tied || _buffers->at(0)->data() == _tied_port->buffer(0)->data());
}
@@ -103,17 +103,17 @@ InputPort::remove_connection(const OutputPort* src_port)
for (uint32_t i=0; i < _poly; ++i) {
// Use a local buffer
if (modify_buffers)
- _buffers.at(i)->unjoin();
- _buffers.at(i)->clear(); // Write silence
+ _buffers->at(i)->unjoin();
+ _buffers->at(i)->clear(); // Write silence
//if (_is_tied)
- //m_tied_port->buffer(i)->join(_buffers.at(i));
+ //m_tied_port->buffer(i)->join(_buffers->at(i));
}
} else if (modify_buffers && _connections.size() == 1) {
// Share a buffer
for (uint32_t i=0; i < _poly; ++i) {
- _buffers.at(i)->join((*_connections.begin())->buffer(i));
+ _buffers->at(i)->join((*_connections.begin())->buffer(i));
//if (_is_tied)
- // _tied_port->buffer(i)->join(_buffers.at(i));
+ // _tied_port->buffer(i)->join(_buffers->at(i));
}
}
}
@@ -122,7 +122,7 @@ InputPort::remove_connection(const OutputPort* src_port)
Port::connect_buffers();
//assert( ! _is_tied || _tied_port != NULL);
- //assert( ! _is_tied || _buffers.at(0)->data() == _tied_port->buffer(0)->data());
+ //assert( ! _is_tied || _buffers->at(0)->data() == _tied_port->buffer(0)->data());
return connection;
}
@@ -153,7 +153,7 @@ InputPort::pre_process(SampleCount nframes, FrameTime start, FrameTime end)
if (_connections.size() == 0) {
for (uint32_t i=0; i < _poly; ++i)
- _buffers.at(i)->prepare_read(nframes);
+ _buffers->at(i)->prepare_read(nframes);
return;
}
@@ -163,13 +163,13 @@ InputPort::pre_process(SampleCount nframes, FrameTime start, FrameTime end)
// If only one connection, buffer is (maybe) used directly (no copying)
if (_connections.size() == 1) {
// Buffer changed since connection
- if (!_buffers.at(0)->is_joined_to((*_connections.begin())->buffer(0))) {
+ if (!_buffers->at(0)->is_joined_to((*_connections.begin())->buffer(0))) {
if (_fixed_buffers) { // || (_is_tied && _tied_port->fixed_buffers())) {
// can't change buffer, must copy
do_mixdown = true;
} else {
// zero-copy
- _buffers.at(0)->join((*_connections.begin())->buffer(0));
+ _buffers->at(0)->join((*_connections.begin())->buffer(0));
do_mixdown = false;
}
connect_buffers();
@@ -181,20 +181,20 @@ InputPort::pre_process(SampleCount nframes, FrameTime start, FrameTime end)
//cerr << path() << " mixing: " << do_mixdown << endl;
for (uint32_t i=0; i < _poly; ++i)
- _buffers.at(i)->prepare_read(nframes);
+ _buffers->at(i)->prepare_read(nframes);
if (!do_mixdown) {
- assert(_buffers.at(0)->is_joined_to((*_connections.begin())->buffer(0)));
+ assert(_buffers->at(0)->is_joined_to((*_connections.begin())->buffer(0)));
return;
}
/*assert(!_is_tied || _tied_port != NULL);
- assert(!_is_tied || _buffers.at(0)->data() == _tied_port->buffer(0)->data());*/
+ assert(!_is_tied || _buffers->at(0)->data() == _tied_port->buffer(0)->data());*/
if (_type == DataType::FLOAT) {
for (uint32_t voice=0; voice < _poly; ++voice) {
// Copy first connection
- _buffers.at(voice)->copy(
+ _buffers->at(voice)->copy(
(*_connections.begin())->buffer(voice), 0, _buffer_size-1);
// Accumulate the rest
@@ -203,7 +203,7 @@ InputPort::pre_process(SampleCount nframes, FrameTime start, FrameTime end)
Connections::iterator c = _connections.begin();
for (++c; c != _connections.end(); ++c)
- ((AudioBuffer*)_buffers.at(voice))->accumulate(
+ ((AudioBuffer*)_buffers->at(voice))->accumulate(
((AudioBuffer*)(*c)->buffer(voice)), 0, _buffer_size-1);
}
}
@@ -215,7 +215,7 @@ InputPort::pre_process(SampleCount nframes, FrameTime start, FrameTime end)
// cerr << "WARNING: MIDI mixing not implemented, only first connection used." << endl;
// Copy first connection
- _buffers.at(0)->copy(
+ _buffers->at(0)->copy(
(*_connections.begin())->buffer(0), 0, _buffer_size-1);
}
}
@@ -237,7 +237,7 @@ InputPort::post_process(SampleCount nframes, FrameTime start, FrameTime end)
{
// Prepare for next cycle
for (uint32_t i=0; i < _poly; ++i)
- _buffers.at(i)->prepare_write(nframes);
+ _buffers->at(i)->prepare_write(nframes);
}