From 699d3265031702602bdf4d6748b43ff14f2af72f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 12 Jun 2006 01:13:38 +0000 Subject: Connections working through Store model/signal interface git-svn-id: http://svn.drobilla.net/lad/grauph@30 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/Store.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/libs/client/Store.cpp') diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index 65b3080e..cd52af70 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -33,6 +33,7 @@ Store::Store(SigClientInterface& emitter) emitter.new_patch_sig.connect(sigc::mem_fun(this, &Store::new_patch_event)); emitter.new_node_sig.connect(sigc::mem_fun(this, &Store::new_node_event)); emitter.new_port_sig.connect(sigc::mem_fun(this, &Store::new_port_event)); + emitter.connection_sig.connect(sigc::mem_fun(this, &Store::connection_event)); emitter.metadata_update_sig.connect(sigc::mem_fun(this, &Store::metadata_update_event)); } @@ -271,5 +272,22 @@ Store::metadata_update_event(const string& subject_path, const string& predicate } +void +Store::connection_event(const string& src_port_path, const string& dst_port_path) +{ + const Path& src = src_port_path; + const Path& dst = dst_port_path; + + assert(src.parent().parent() == dst.parent().parent()); + const Path& patch_path = src.parent().parent(); + + CountedPtr patch = this->patch(patch_path); + if (patch) + patch->add_connection(new ConnectionModel(src, dst)); + else + cerr << "ERROR: connection in nonexistant patch" << endl; +} + + } // namespace LibOmClient -- cgit v1.2.1