From 62d76290ae0eb783db0e24338c17adb08d845a73 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 3 Jul 2006 22:13:38 +0000 Subject: Fixes for connecting directly from a patch input to a patch output git-svn-id: http://svn.drobilla.net/lad/ingen@81 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/ObjectSender.cpp | 15 ++++++++++----- src/libs/engine/Patch.cpp | 4 +++- src/libs/engine/events/ConnectionEvent.cpp | 14 +++++++++----- 3 files changed, 22 insertions(+), 11 deletions(-) (limited to 'src/libs/engine') diff --git a/src/libs/engine/ObjectSender.cpp b/src/libs/engine/ObjectSender.cpp index 872c8d92..8a5fc367 100644 --- a/src/libs/engine/ObjectSender.cpp +++ b/src/libs/engine/ObjectSender.cpp @@ -57,14 +57,11 @@ ObjectSender::send_patch(ClientInterface* client, const Patch* patch) send_node(client, node); } - for (List::const_iterator j = patch->connections().begin(); - j != patch->connections().end(); ++j) - client->connection((*j)->src_port()->path(), (*j)->dst_port()->path()); - // Send port information for (size_t i=0; i < patch->num_ports(); ++i) { Port* const port = patch->ports().at(i); - + send_port(client, port); +/* // Send metadata const map& data = port->metadata(); for (map::const_iterator i = data.begin(); i != data.end(); ++i) @@ -74,7 +71,15 @@ ObjectSender::send_patch(ClientInterface* client, const Patch* patch) if (port->type() == DataType::FLOAT && port->buffer_size() == 1) client->control_change(port->path(), dynamic_cast*>(port)->buffer(0)->value_at(0)); +*/ } + + + // Send connections + for (List::const_iterator j = patch->connections().begin(); + j != patch->connections().end(); ++j) + client->connection((*j)->src_port()->path(), (*j)->dst_port()->path()); + // Send metadata const map& data = patch->metadata(); diff --git a/src/libs/engine/Patch.cpp b/src/libs/engine/Patch.cpp index 5cfdd6e3..d96e63b5 100644 --- a/src/libs/engine/Patch.cpp +++ b/src/libs/engine/Patch.cpp @@ -348,9 +348,11 @@ Patch::remove_port(const Port* port) Array* Patch::build_process_order() const { + cerr << "*********** BUILDING PROCESS ORDER FOR " << path() << endl; + Array* const process_order = new Array(_nodes.size()); - // FIXME: tweak algorithm so it just ends up like this and save the iteration? + // FIXME: tweak algorithm so it just ends up like this and save the cost of iteration? for (List::const_iterator i = _nodes.begin(); i != _nodes.end(); ++i) (*i)->traversed(false); diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index aedfd881..652fe801 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -178,29 +178,33 @@ TypedConnectionEvent::pre_process() Node* const src_node = m_src_port->parent_node(); Node* const dst_node = m_dst_port->parent_node(); + // Connection to a patch port from inside the patch if (src_node->parent_patch() != dst_node->parent_patch()) { - // Connection to a patch port from inside the patch + assert(src_node->parent() == dst_node || dst_node->parent() == src_node); if (src_node->parent() == dst_node) m_patch = dynamic_cast(dst_node); else m_patch = dynamic_cast(src_node); + + // Connection from a patch input to a patch output (pass through) + } else if (src_node == dst_node && dynamic_cast(src_node)) { + m_patch = dynamic_cast(src_node); + + // Normal connection between nodes with the same parent } else { - // Normal connection between nodes with the same parent m_patch = src_node->parent_patch(); } assert(m_patch); if (src_node == NULL || dst_node == NULL) { - cerr << "ERR 1\n"; m_succeeded = false; QueuedEvent::pre_process(); return; } - if (src_node->parent() != m_patch && dst_node->parent() != m_patch) { - cerr << "ERR 2\n"; + if (m_patch != src_node && src_node->parent() != m_patch && dst_node->parent() != m_patch) { m_succeeded = false; QueuedEvent::pre_process(); return; -- cgit v1.2.1