From d520692eb49ff9e5aded38061a204713571b095b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Sep 2006 01:48:27 +0000 Subject: Patch clearing. git-svn-id: http://svn.drobilla.net/lad/ingen@141 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/SigClientInterface.h | 5 ++++- src/libs/client/Store.cpp | 18 ++++++++++++++++-- src/libs/client/Store.h | 1 + 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src/libs/client') diff --git a/src/libs/client/SigClientInterface.h b/src/libs/client/SigClientInterface.h index a28b1a1d..cab1fd78 100644 --- a/src/libs/client/SigClientInterface.h +++ b/src/libs/client/SigClientInterface.h @@ -32,12 +32,15 @@ namespace Client { * This simply emits an sigc signal for every event (eg OSC message) coming from * the engine. Use Store (which extends this) if you want a nice client-side * model of the engine. + * + * The signals here match the calls to ClientInterface exactly. See the + * documentation for ClientInterface for meanings of signal parameters. */ class SigClientInterface : virtual public Ingen::Shared::ClientInterface, public sigc::trackable { public: - // See the corresponding emitting functions below for parameter meanings + // Signal parameters math up directly with ClientInterface calls sigc::signal response_sig; sigc::signal bundle_begin_sig; diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index 64824b39..f30240fb 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -38,6 +38,7 @@ Store::Store(CountedPtr emitter) emitter->new_port_sig.connect(sigc::mem_fun(this, &Store::new_port_event)); emitter->patch_enabled_sig.connect(sigc::mem_fun(this, &Store::patch_enabled_event)); emitter->patch_disabled_sig.connect(sigc::mem_fun(this, &Store::patch_disabled_event)); + emitter->patch_cleared_sig.connect(sigc::mem_fun(this, &Store::patch_cleared_event)); emitter->connection_sig.connect(sigc::mem_fun(this, &Store::connection_event)); emitter->disconnection_sig.connect(sigc::mem_fun(this, &Store::disconnection_event)); emitter->metadata_update_sig.connect(sigc::mem_fun(this, &Store::metadata_update_event)); @@ -264,8 +265,8 @@ Store::destruction_event(const Path& path) removed.reset(); - cerr << "Store removed object " << path - << ", count: " << removed.use_count(); + //cerr << "Store removed object " << path + // << ", count: " << removed.use_count(); } void @@ -338,6 +339,19 @@ Store::patch_disabled_event(const Path& path) } +void +Store::patch_cleared_event(const Path& path) +{ + CountedPtr patch = PtrCast(object(path)); + if (patch) { + NodeModelMap children = patch->nodes(); // take a copy + for (NodeModelMap::iterator i = children.begin(); i != children.end(); ++i) { + destruction_event(i->second->path()); + } + } +} + + void Store::metadata_update_event(const Path& subject_path, const string& predicate, const Atom& value) { diff --git a/src/libs/client/Store.h b/src/libs/client/Store.h index cd27e5d6..ff617d37 100644 --- a/src/libs/client/Store.h +++ b/src/libs/client/Store.h @@ -83,6 +83,7 @@ private: void new_port_event(const Path& path, const string& data_type, bool is_output); void patch_enabled_event(const Path& path); void patch_disabled_event(const Path& path); + void patch_cleared_event(const Path& path); void metadata_update_event(const Path& subject_path, const string& predicate, const Atom& value); void control_change_event(const Path& port_path, float value); void connection_event(const Path& src_port_path, const Path& dst_port_path); -- cgit v1.2.1