diff options
author | David Robillard <d@drobilla.net> | 2011-04-20 03:30:03 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-20 03:30:03 +0000 |
commit | 1119a2c71a5f6b4e23ac0a19784705002ca9cefd (patch) | |
tree | 14f1a7f2b270185defc9e99ddf03e108b6767c8b /src/client/ClientStore.cpp | |
parent | 7042795c8138f03124539f0efc892fe45eb2979f (diff) | |
download | ingen-1119a2c71a5f6b4e23ac0a19784705002ca9cefd.tar.gz ingen-1119a2c71a5f6b4e23ac0a19784705002ca9cefd.tar.bz2 ingen-1119a2c71a5f6b4e23ac0a19784705002ca9cefd.zip |
Move disconnect_all to CommonInterface and implement in clients.
Factor out process thread implementation of Disconnect into Disconnect::Impl.
Implement DisconnectAll in terms of DisconnectImpl rather than abusing Disconnect.
Dramatically reduce notification communication overhead of DisconnectAll.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3179 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client/ClientStore.cpp')
-rw-r--r-- | src/client/ClientStore.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 690a2666..be7d4186 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -63,6 +63,7 @@ ClientStore::ClientStore(SharedPtr<Shared::LV2URIMap> uris, CONNECT(delta, delta); CONNECT(connection, connect); CONNECT(disconnection, disconnect); + CONNECT(disconnect_all, disconnect_all); CONNECT(property_change, set_property); CONNECT(activity, activity); } @@ -475,6 +476,29 @@ ClientStore::disconnect(const Path& src_path, patch->remove_connection(src_port.get(), dst_port.get()); } +void +ClientStore::disconnect_all(const Raul::Path& parent_patch_path, + const Raul::Path& path) +{ + SharedPtr<PatchModel> patch = PtrCast<PatchModel>(object(parent_patch_path)); + SharedPtr<ObjectModel> object = this->object(path); + + if (!patch || !object) + return; + + const PatchModel::Connections connections = patch->connections(); + for (PatchModel::Connections::const_iterator i = connections.begin(); + i != connections.end(); ++i) { + SharedPtr<ConnectionModel> c = PtrCast<ConnectionModel>(i->second); + if (c->src_port()->parent() == object + || c->dst_port()->parent() == object) { + c->src_port()->disconnected_from(c->dst_port()); + c->dst_port()->disconnected_from(c->src_port()); + patch->remove_connection(c->src_port().get(), c->dst_port().get()); + } + } +} + } // namespace Client } // namespace Ingen |