From 9d9efa215c52a6b75eef7e9a8b088b11dfd76a07 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 8 Oct 2007 01:38:38 +0000 Subject: Shared abstract Connection interface. Only Patch to go, now.... git-svn-id: http://svn.drobilla.net/lad/ingen@843 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/ClearPatchEvent.cpp | 4 ++-- src/libs/engine/events/ConnectionEvent.cpp | 8 ++++---- src/libs/engine/events/ConnectionEvent.hpp | 9 ++++----- src/libs/engine/events/DisconnectNodeEvent.cpp | 6 +++--- src/libs/engine/events/DisconnectPortEvent.cpp | 6 +++--- src/libs/engine/events/DisconnectionEvent.cpp | 8 ++++---- src/libs/engine/events/DisconnectionEvent.hpp | 3 +-- src/libs/engine/events/SetPolyphonicEvent.cpp | 2 +- src/libs/engine/events/SetPolyphonyEvent.cpp | 2 +- 9 files changed, 23 insertions(+), 25 deletions(-) (limited to 'src/libs/engine/events') diff --git a/src/libs/engine/events/ClearPatchEvent.cpp b/src/libs/engine/events/ClearPatchEvent.cpp index 1e6c0748..ad35d162 100644 --- a/src/libs/engine/events/ClearPatchEvent.cpp +++ b/src/libs/engine/events/ClearPatchEvent.cpp @@ -25,7 +25,7 @@ #include "ObjectStore.hpp" #include "PortImpl.hpp" #include "NodeImpl.hpp" -#include "Connection.hpp" +#include "ConnectionImpl.hpp" #include "QueuedEventSource.hpp" namespace Ingen { @@ -92,7 +92,7 @@ ClearPatchEvent::post_process() _patch->nodes().clear(); // Delete all connections - for (Raul::List::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) + for (Raul::List::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) delete *i; _patch->connections().clear(); diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index 7f8fa18e..733a46d4 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -22,7 +22,7 @@ #include "Responder.hpp" #include "types.hpp" #include "Engine.hpp" -#include "Connection.hpp" +#include "ConnectionImpl.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" #include "Patch.hpp" @@ -126,9 +126,9 @@ ConnectionEvent::pre_process() return; } - _connection = new Connection(_src_port, _dst_port); - _port_listnode = new Raul::ListNode(_connection); - _patch_listnode = new Raul::ListNode(_connection); + _connection = new ConnectionImpl(_src_port, _dst_port); + _port_listnode = new Raul::ListNode(_connection); + _patch_listnode = new Raul::ListNode(_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 8fa8c489..d7465566 100644 --- a/src/libs/engine/events/ConnectionEvent.hpp +++ b/src/libs/engine/events/ConnectionEvent.hpp @@ -33,10 +33,9 @@ namespace Ingen { class Patch; class NodeImpl; -class Connection; +class ConnectionImpl; class MidiMessage; class PortImpl; -class Connection; class InputPort; class OutputPort; class CompiledPatch; @@ -78,9 +77,9 @@ private: CompiledPatch* _compiled_patch; ///< New process order for Patch - Connection* _connection; - Raul::ListNode* _patch_listnode; - Raul::ListNode* _port_listnode; + ConnectionImpl* _connection; + Raul::ListNode* _patch_listnode; + Raul::ListNode* _port_listnode; ErrorType _error; }; diff --git a/src/libs/engine/events/DisconnectNodeEvent.cpp b/src/libs/engine/events/DisconnectNodeEvent.cpp index 8612d012..e0507b3a 100644 --- a/src/libs/engine/events/DisconnectNodeEvent.cpp +++ b/src/libs/engine/events/DisconnectNodeEvent.cpp @@ -20,7 +20,7 @@ #include #include #include "ClientBroadcaster.hpp" -#include "Connection.hpp" +#include "ConnectionImpl.hpp" #include "DisconnectNodeEvent.hpp" #include "DisconnectionEvent.hpp" #include "Engine.hpp" @@ -70,7 +70,7 @@ DisconnectNodeEvent::~DisconnectNodeEvent() void DisconnectNodeEvent::pre_process() { - typedef Raul::List::const_iterator ConnectionListIterator; + typedef Raul::List::const_iterator ConnectionListIterator; if (_lookup) { _patch = _engine.object_store()->find_patch(_node_path.parent()); @@ -90,7 +90,7 @@ DisconnectNodeEvent::pre_process() } } - Connection* c = NULL; + ConnectionImpl* c = NULL; for (ConnectionListIterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { c = (*i); if ((c->src_port()->parent_node() == _node || c->dst_port()->parent_node() == _node) && !c->pending_disconnection()) { diff --git a/src/libs/engine/events/DisconnectPortEvent.cpp b/src/libs/engine/events/DisconnectPortEvent.cpp index f7ad9925..76a4cbc4 100644 --- a/src/libs/engine/events/DisconnectPortEvent.cpp +++ b/src/libs/engine/events/DisconnectPortEvent.cpp @@ -23,7 +23,7 @@ #include "Responder.hpp" #include "Engine.hpp" #include "NodeImpl.hpp" -#include "Connection.hpp" +#include "ConnectionImpl.hpp" #include "DisconnectionEvent.hpp" #include "PortImpl.hpp" #include "InputPort.hpp" @@ -103,8 +103,8 @@ DisconnectPortEvent::pre_process() return; } - Connection* c = NULL; - for (Raul::List::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { + ConnectionImpl* c = NULL; + for (Raul::List::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { c = (*i); if ((c->src_port() == _port || c->dst_port() == _port) && !c->pending_disconnection()) { DisconnectionEvent* ev = new DisconnectionEvent(_engine, SharedPtr(new Responder()), _time, diff --git a/src/libs/engine/events/DisconnectionEvent.cpp b/src/libs/engine/events/DisconnectionEvent.cpp index 215e0202..68068821 100644 --- a/src/libs/engine/events/DisconnectionEvent.cpp +++ b/src/libs/engine/events/DisconnectionEvent.cpp @@ -21,7 +21,7 @@ #include #include "Responder.hpp" #include "Engine.hpp" -#include "Connection.hpp" +#include "ConnectionImpl.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" #include "Patch.hpp" @@ -157,15 +157,15 @@ DisconnectionEvent::execute(ProcessContext& context) QueuedEvent::execute(context); if (_error == NO_ERROR) { - Raul::ListNode* const port_connection + Raul::ListNode* const port_connection = _dst_input_port->remove_connection(_src_output_port); if (port_connection != NULL) { - Raul::ListNode* const patch_connection + Raul::ListNode* const patch_connection = _patch->remove_connection(_src_port, _dst_port); assert(patch_connection); - assert((Connection*)port_connection->elem() == patch_connection->elem()); + assert((ConnectionImpl*)port_connection->elem() == patch_connection->elem()); // Clean up both the list node and the connection itself... _engine.maid()->push(port_connection); diff --git a/src/libs/engine/events/DisconnectionEvent.hpp b/src/libs/engine/events/DisconnectionEvent.hpp index aacb5082..603eaf47 100644 --- a/src/libs/engine/events/DisconnectionEvent.hpp +++ b/src/libs/engine/events/DisconnectionEvent.hpp @@ -33,10 +33,9 @@ namespace Ingen { class Patch; class NodeImpl; -class Connection; +class ConnectionImpl; class MidiMessage; class PortImpl; -class Connection; class InputPort; class OutputPort; class CompiledPatch; diff --git a/src/libs/engine/events/SetPolyphonicEvent.cpp b/src/libs/engine/events/SetPolyphonicEvent.cpp index 8cca2373..51ab2dc8 100644 --- a/src/libs/engine/events/SetPolyphonicEvent.cpp +++ b/src/libs/engine/events/SetPolyphonicEvent.cpp @@ -25,7 +25,7 @@ #include "ObjectStore.hpp" #include "PortImpl.hpp" #include "NodeImpl.hpp" -#include "Connection.hpp" +#include "ConnectionImpl.hpp" #include "QueuedEventSource.hpp" namespace Ingen { diff --git a/src/libs/engine/events/SetPolyphonyEvent.cpp b/src/libs/engine/events/SetPolyphonyEvent.cpp index 8e0d12cd..56e95486 100644 --- a/src/libs/engine/events/SetPolyphonyEvent.cpp +++ b/src/libs/engine/events/SetPolyphonyEvent.cpp @@ -25,7 +25,7 @@ #include "ObjectStore.hpp" #include "PortImpl.hpp" #include "NodeImpl.hpp" -#include "Connection.hpp" +#include "ConnectionImpl.hpp" #include "QueuedEventSource.hpp" namespace Ingen { -- cgit v1.2.1