summaryrefslogtreecommitdiffstats
path: root/src/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-26 01:39:16 +0000
committerDavid Robillard <d@drobilla.net>2010-02-26 01:39:16 +0000
commit52e49500bb78974d43bdfd30b2ec9b2a4522dd25 (patch)
tree44a5a46e946c6b43b657ca5733a165943dd947ae /src/engine/events
parent3d6b047cd19baf9bf5a81b4fe16e1e9e53ed8fef (diff)
downloadingen-52e49500bb78974d43bdfd30b2ec9b2a4522dd25.tar.gz
ingen-52e49500bb78974d43bdfd30b2ec9b2a4522dd25.tar.bz2
ingen-52e49500bb78974d43bdfd30b2ec9b2a4522dd25.zip
Perform all mixing for an audio input in a single mix operation (instead of a two step polyphony mixdown (by connections) and connections mixdown (by ports)).
Speed up and inline AudioBuffer::accumulate, to speed up mix(). Remove local buffer from Connection (always mix into destination InputPort's buffers). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2494 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events')
-rw-r--r--src/engine/events/Connect.cpp12
-rw-r--r--src/engine/events/Disconnect.cpp4
2 files changed, 6 insertions, 10 deletions
diff --git a/src/engine/events/Connect.cpp b/src/engine/events/Connect.cpp
index 5b7726d9..5eefb181 100644
--- a/src/engine/events/Connect.cpp
+++ b/src/engine/events/Connect.cpp
@@ -135,15 +135,11 @@ Connect::pre_process()
_patch->add_connection(_connection);
_dst_input_port->increment_num_connections();
- switch (_dst_input_port->num_connections()) {
- case 1:
- _connection->allocate_buffer(*_engine.buffer_factory());
- break;
- case 2:
+ if ((_dst_input_port->num_connections() == 1 && _connection->must_mix())
+ || _dst_input_port->num_connections() == 2) {
_buffers = new Raul::Array<BufferFactory::Ref>(_dst_input_port->poly());
- _dst_input_port->get_buffers(*_engine.buffer_factory(), _buffers, _dst_input_port->poly());
- default:
- break;
+ _dst_input_port->get_buffers(*_engine.buffer_factory(),
+ _buffers, _dst_input_port->poly());
}
if (_patch->enabled())
diff --git a/src/engine/events/Disconnect.cpp b/src/engine/events/Disconnect.cpp
index f25c0f4a..443cc512 100644
--- a/src/engine/events/Disconnect.cpp
+++ b/src/engine/events/Disconnect.cpp
@@ -161,7 +161,8 @@ Disconnect::pre_process()
if (_dst_input_port->num_connections() == 0) {
_buffers = new Raul::Array<BufferFactory::Ref>(_dst_input_port->poly());
- _dst_input_port->get_buffers(*_engine.buffer_factory(), _buffers, _dst_input_port->poly());
+ _dst_input_port->get_buffers(*_engine.buffer_factory(),
+ _buffers, _dst_input_port->poly());
_clear_dst_port = true;
}
@@ -181,7 +182,6 @@ Disconnect::execute(ProcessContext& context)
if (_error == NO_ERROR) {
InputPort::Connections::Node* const port_connections_node
= _dst_input_port->remove_connection(context, _src_output_port);
- port_connections_node->elem()->recycle_buffer();
if (_reconnect_dst_port) {
if (_buffers)
_engine.maid()->push(_dst_input_port->set_buffers(_buffers));