summaryrefslogtreecommitdiffstats
path: root/src/server/InputPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-12 02:46:46 +0000
committerDavid Robillard <d@drobilla.net>2014-01-12 02:46:46 +0000
commit06c34ee30b63d0cfd8c7ae77adc637f9da9a84dd (patch)
tree99c85b5652b24a69613100c1ddb80e3df58cb8a5 /src/server/InputPort.cpp
parent6fdfb81645889c4a81a6fce224663393eeee3f5d (diff)
downloadingen-06c34ee30b63d0cfd8c7ae77adc637f9da9a84dd.tar.gz
ingen-06c34ee30b63d0cfd8c7ae77adc637f9da9a84dd.tar.bz2
ingen-06c34ee30b63d0cfd8c7ae77adc637f9da9a84dd.zip
Combine port buffers and set state into a single voice object.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5309 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/InputPort.cpp')
-rw-r--r--src/server/InputPort.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index 34c71116..f1be3b8f 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -68,26 +68,26 @@ InputPort::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly)
if (!ret)
poly = 1;
- assert(_buffers->size() >= poly);
+ assert(_voices->size() >= poly);
return true;
}
-/** Set @a buffers to the buffers to be used for this port.
+/** Set the buffers of @p voices to the buffers to be used for this port.
* @return true iff buffers are locally owned by the port
*/
bool
-InputPort::get_buffers(BufferFactory& bufs,
- Raul::Array<BufferRef>* buffers,
- uint32_t poly,
- bool real_time) const
+InputPort::get_buffers(BufferFactory& bufs,
+ Raul::Array<Voice>* voices,
+ uint32_t poly,
+ bool real_time) const
{
const size_t num_arcs = real_time ? _arcs.size() : _num_arcs;
if (is_a(PortType::AUDIO) && num_arcs == 0) {
// Audio input with no arcs, use shared zero buffer
for (uint32_t v = 0; v < poly; ++v) {
- buffers->at(v) = bufs.silent_buffer();
+ voices->at(v).buffer = bufs.silent_buffer();
}
return false;
@@ -96,7 +96,7 @@ InputPort::get_buffers(BufferFactory& bufs,
if (!_arcs.front().must_mix()) {
// Single non-mixing connection, use buffers directly
for (uint32_t v = 0; v < poly; ++v) {
- buffers->at(v) = _arcs.front().buffer(v);
+ voices->at(v).buffer = _arcs.front().buffer(v);
}
return false;
}
@@ -105,9 +105,9 @@ InputPort::get_buffers(BufferFactory& bufs,
// Otherwise, allocate local buffers
for (uint32_t v = 0; v < poly; ++v) {
- buffers->at(v).reset();
- buffers->at(v) = bufs.get_buffer(buffer_type(), _buffer_size, real_time);
- buffers->at(v)->clear();
+ voices->at(v).buffer.reset();
+ voices->at(v).buffer = bufs.get_buffer(buffer_type(), _buffer_size, real_time);
+ voices->at(v).buffer->clear();
}
return true;
}
@@ -194,7 +194,7 @@ InputPort::pre_process(Context& context)
}
} else if (direct_connect()) {
for (uint32_t v = 0; v < _poly; ++v) {
- _buffers->at(v) = _arcs.front().buffer(v);
+ _voices->at(v).buffer = _arcs.front().buffer(v);
}
} else {
const uint32_t src_poly = max_tail_poly(context);