From 260a406b12997fdab7446a9980e921d8cfc46915 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 8 Oct 2007 04:51:33 +0000 Subject: SharedPtr-ize engine-side Connections (towards merge for patch->connections()). git-svn-id: http://svn.drobilla.net/lad/ingen@846 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/ClearPatchEvent.cpp | 2 +- src/libs/engine/events/ConnectionEvent.cpp | 2 +- src/libs/engine/events/ConnectionEvent.hpp | 7 ++++--- src/libs/engine/events/DisconnectNodeEvent.cpp | 2 +- src/libs/engine/events/DisconnectPortEvent.cpp | 2 +- src/libs/engine/events/DisconnectionEvent.cpp | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/libs/engine/events') diff --git a/src/libs/engine/events/ClearPatchEvent.cpp b/src/libs/engine/events/ClearPatchEvent.cpp index 84731d0a..0d76724a 100644 --- a/src/libs/engine/events/ClearPatchEvent.cpp +++ b/src/libs/engine/events/ClearPatchEvent.cpp @@ -92,7 +92,7 @@ ClearPatchEvent::post_process() _patch->nodes().clear(); // Delete all connections - for (List< SharedPtr >::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) + for (Patch::Connections::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) (*i).reset(); _patch->connections().clear(); diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index ce84c4bc..3a954781 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -126,8 +126,8 @@ ConnectionEvent::pre_process() } _connection = SharedPtr(new ConnectionImpl(_src_port, _dst_port)); - _port_listnode = new Patch::Connections::Node(_connection); _patch_listnode = new Patch::Connections::Node(_connection); + _port_listnode = new InputPort::Connections::Node(_connection); // Need to be careful about patch port connections here and adding a node's // parent as a dependant/provider, or adding a patch as it's own provider... diff --git a/src/libs/engine/events/ConnectionEvent.hpp b/src/libs/engine/events/ConnectionEvent.hpp index 3c2f1f68..1d46be6f 100644 --- a/src/libs/engine/events/ConnectionEvent.hpp +++ b/src/libs/engine/events/ConnectionEvent.hpp @@ -22,6 +22,7 @@ #include #include "QueuedEvent.hpp" #include "Patch.hpp" +#include "InputPort.hpp" #include "types.hpp" using std::string; @@ -78,9 +79,9 @@ private: CompiledPatch* _compiled_patch; ///< New process order for Patch - SharedPtr _connection; - Patch::Connections::Node* _patch_listnode; - Patch::Connections::Node* _port_listnode; + SharedPtr _connection; + Patch::Connections::Node* _patch_listnode; + InputPort::Connections::Node* _port_listnode; ErrorType _error; }; diff --git a/src/libs/engine/events/DisconnectNodeEvent.cpp b/src/libs/engine/events/DisconnectNodeEvent.cpp index 723bd864..f085e974 100644 --- a/src/libs/engine/events/DisconnectNodeEvent.cpp +++ b/src/libs/engine/events/DisconnectNodeEvent.cpp @@ -89,7 +89,7 @@ DisconnectNodeEvent::pre_process() } for (Patch::Connections::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { - const SharedPtr c(*i); + ConnectionImpl* c = (ConnectionImpl*)i->get(); if ((c->src_port()->parent_node() == _node || c->dst_port()->parent_node() == _node) && !c->pending_disconnection()) { DisconnectionEvent* ev = new DisconnectionEvent(_engine, SharedPtr(new Responder()), _time, c->src_port(), c->dst_port()); diff --git a/src/libs/engine/events/DisconnectPortEvent.cpp b/src/libs/engine/events/DisconnectPortEvent.cpp index 5fa82b15..9aaf5c45 100644 --- a/src/libs/engine/events/DisconnectPortEvent.cpp +++ b/src/libs/engine/events/DisconnectPortEvent.cpp @@ -105,7 +105,7 @@ DisconnectPortEvent::pre_process() for (Patch::Connections::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { - const SharedPtr c(*i); + ConnectionImpl* c = (ConnectionImpl*)i->get(); if ((c->src_port() == _port || c->dst_port() == _port) && !c->pending_disconnection()) { DisconnectionEvent* ev = new DisconnectionEvent(_engine, SharedPtr(new Responder()), _time, c->src_port(), c->dst_port()); diff --git a/src/libs/engine/events/DisconnectionEvent.cpp b/src/libs/engine/events/DisconnectionEvent.cpp index aa686b0c..6e69c3ba 100644 --- a/src/libs/engine/events/DisconnectionEvent.cpp +++ b/src/libs/engine/events/DisconnectionEvent.cpp @@ -157,7 +157,7 @@ DisconnectionEvent::execute(ProcessContext& context) QueuedEvent::execute(context); if (_error == NO_ERROR) { - Patch::Connections::Node* const port_connection + InputPort::Connections::Node* const port_connection = _dst_input_port->remove_connection(_src_output_port); if (port_connection != NULL) { -- cgit v1.2.1