From 77a9beca75debd2d87d735fc4fe847694eee6f13 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 25 Feb 2010 20:40:13 +0000 Subject: Work on contexts and polymorphic ports. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2492 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/InputPort.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/engine/InputPort.cpp') diff --git a/src/engine/InputPort.cpp b/src/engine/InputPort.cpp index f9ddbfe2..d5051865 100644 --- a/src/engine/InputPort.cpp +++ b/src/engine/InputPort.cpp @@ -93,7 +93,7 @@ InputPort::get_buffers(BufferFactory& bufs, Raul::Array* buf size_t num_connections = (ThreadManager::current_thread_id() == THREAD_PROCESS) ? _connections.size() : _num_connections; - if (_type == PortType::AUDIO && num_connections == 0) { + if (buffer_type() == PortType::AUDIO && num_connections == 0) { // Audio input with no connections, use shared zero buffer for (uint32_t v = 0; v < poly; ++v) buffers->at(v) = bufs.silent_buffer(); @@ -113,7 +113,7 @@ InputPort::get_buffers(BufferFactory& bufs, Raul::Array* buf // Use local buffers for (uint32_t v = 0; v < poly; ++v) { buffers->at(v) = NULL; // Release first (potential immediate recycling) - buffers->at(v) = _bufs.get(_type, _buffer_size); + buffers->at(v) = _bufs.get(buffer_type(), _buffer_size); buffers->at(v)->clear(); } } @@ -136,7 +136,7 @@ InputPort::add_connection(Connections::Node* const c) _connections.push_back(c); // Automatically broadcast connected control inputs - if (_type == PortType::CONTROL) + if (is_a(PortType::CONTROL)) _broadcast = true; } @@ -170,7 +170,7 @@ InputPort::remove_connection(ProcessContext& context, const OutputPort* src_port } // Turn off broadcasting if we're no longer connected - if (_type == PortType::CONTROL && _connections.size() == 0) + if (is_a(PortType::CONTROL) && _connections.size() == 0) _broadcast = false; return connection; -- cgit v1.2.1