diff options
author | David Robillard <d@drobilla.net> | 2007-10-08 04:51:33 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-08 04:51:33 +0000 |
commit | 260a406b12997fdab7446a9980e921d8cfc46915 (patch) | |
tree | d900ce2737a2b027a632c6ecb80cf889cb6ebc6d /src/libs/engine/Patch.cpp | |
parent | fae7e7519afae5f42836eaaf5e317151ea9c4378 (diff) | |
download | ingen-260a406b12997fdab7446a9980e921d8cfc46915.tar.gz ingen-260a406b12997fdab7446a9980e921d8cfc46915.tar.bz2 ingen-260a406b12997fdab7446a9980e921d8cfc46915.zip |
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
Diffstat (limited to 'src/libs/engine/Patch.cpp')
-rw-r--r-- | src/libs/engine/Patch.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libs/engine/Patch.cpp b/src/libs/engine/Patch.cpp index 39348ce9..8256f0c5 100644 --- a/src/libs/engine/Patch.cpp +++ b/src/libs/engine/Patch.cpp @@ -54,7 +54,7 @@ Patch::~Patch() { assert(!_activated); - for (List< SharedPtr<ConnectionImpl> >::iterator i = _connections.begin(); i != _connections.end(); ++i) { + for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) { (*i).reset(); delete _connections.erase(i); } @@ -116,8 +116,8 @@ Patch::prepare_internal_poly(uint32_t poly) for (List<NodeImpl*>::iterator i = _nodes.begin(); i != _nodes.end(); ++i) (*i)->prepare_poly(poly); - for (List< SharedPtr<ConnectionImpl> >::iterator i = _connections.begin(); i != _connections.end(); ++i) - (*i)->prepare_poly(poly); + for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) + ((ConnectionImpl*)i->get())->prepare_poly(poly); /* FIXME: Deal with failure */ @@ -133,8 +133,8 @@ Patch::apply_internal_poly(Raul::Maid& maid, uint32_t poly) for (List<NodeImpl*>::iterator i = _nodes.begin(); i != _nodes.end(); ++i) (*i)->apply_poly(maid, poly); - for (List< SharedPtr<ConnectionImpl> >::iterator i = _connections.begin(); i != _connections.end(); ++i) - (*i)->apply_poly(maid, poly); + for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) + PtrCast<ConnectionImpl>(*i)->apply_poly(maid, poly); _internal_poly = poly; @@ -290,9 +290,11 @@ Patch::remove_connection(const PortImpl* src_port, const PortImpl* dst_port) bool found = false; Connections::Node* connection = NULL; for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) { - if ((*i)->src_port() == src_port && (*i)->dst_port() == dst_port) { + ConnectionImpl* const c = (ConnectionImpl*)i->get(); + if (c->src_port() == src_port && c->dst_port() == dst_port) { connection = _connections.erase(i); found = true; + break; } } |