diff options
author | David Robillard <d@drobilla.net> | 2006-07-03 17:46:19 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-07-03 17:46:19 +0000 |
commit | 0aaae8b002fcff9fdd81a6155c609a546f68b938 (patch) | |
tree | 452897c7b6507d15e85382845bda71e66a3803d8 /src/libs | |
parent | 03aa3b084fe3d97f62b67867085c04a23402397e (diff) | |
download | ingen-0aaae8b002fcff9fdd81a6155c609a546f68b938.tar.gz ingen-0aaae8b002fcff9fdd81a6155c609a546f68b938.tar.bz2 ingen-0aaae8b002fcff9fdd81a6155c609a546f68b938.zip |
Enabled checkbox on patch windows working
git-svn-id: http://svn.drobilla.net/lad/ingen@79 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/client/PatchModel.cpp | 20 | ||||
-rw-r--r-- | src/libs/client/PatchModel.h | 7 | ||||
-rw-r--r-- | src/libs/client/Store.cpp | 20 | ||||
-rw-r--r-- | src/libs/client/Store.h | 2 | ||||
-rw-r--r-- | src/libs/engine/ObjectSender.cpp | 4 |
5 files changed, 50 insertions, 3 deletions
diff --git a/src/libs/client/PatchModel.cpp b/src/libs/client/PatchModel.cpp index d61258f3..659fca23 100644 --- a/src/libs/client/PatchModel.cpp +++ b/src/libs/client/PatchModel.cpp @@ -223,6 +223,26 @@ PatchModel::remove_connection(const string& src_port_path, const string& dst_por } +void +PatchModel::enable() +{ + if (!m_enabled) { + m_enabled = true; + enabled_sig.emit(); + } +} + + +void +PatchModel::disable() +{ + if (m_enabled) { + m_enabled = false; + disabled_sig.emit(); + } +} + + bool PatchModel::polyphonic() const { diff --git a/src/libs/client/PatchModel.h b/src/libs/client/PatchModel.h index f9b5b2e7..a6f786d3 100644 --- a/src/libs/client/PatchModel.h +++ b/src/libs/client/PatchModel.h @@ -67,14 +67,17 @@ public: const string& filename() const { return m_filename; } void filename(const string& f) { m_filename = f; } bool enabled() const { return m_enabled; } - void enabled(bool b) { m_enabled = b; } + void enable(); + void disable(); bool polyphonic() const; // Signals sigc::signal<void, CountedPtr<NodeModel> > new_node_sig; sigc::signal<void, const string& > removed_node_sig; sigc::signal<void, CountedPtr<ConnectionModel> > new_connection_sig; - sigc::signal<void, const string&, const string& > removed_connection_sig; + sigc::signal<void, const string&, const string& > removed_connection_sig; + sigc::signal<void> enabled_sig; + sigc::signal<void> disabled_sig; private: // Prevent copies (undefined) diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index 6a91feeb..5bf8175d 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -33,6 +33,8 @@ 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.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.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)); @@ -301,6 +303,24 @@ Store::new_port_event(const string& path, const string& type, bool is_output) void +Store::patch_enabled_event(const string& path) +{ + CountedPtr<PatchModel> patch = object(path); + if (patch) + patch->enable(); +} + + +void +Store::patch_disabled_event(const string& path) +{ + CountedPtr<PatchModel> patch = object(path); + if (patch) + patch->disable(); +} + + +void Store::metadata_update_event(const string& subject_path, const string& predicate, const string& value) { CountedPtr<ObjectModel> subject = object(subject_path); diff --git a/src/libs/client/Store.h b/src/libs/client/Store.h index bed36cd9..7ee1388d 100644 --- a/src/libs/client/Store.h +++ b/src/libs/client/Store.h @@ -72,6 +72,8 @@ private: void new_patch_event(const string& path, uint32_t poly); void new_node_event(const string& plugin_type, const string& plugin_uri, const string& node_path, bool is_polyphonic, uint32_t num_ports); void new_port_event(const string& path, const string& data_type, bool is_output); + void patch_enabled_event(const string& path); + void patch_disabled_event(const string& path); void metadata_update_event(const string& subject_path, const string& predicate, const string& value); void control_change_event(const string& port_path, float value); void connection_event(const Path& src_port_path, const Path& dst_port_path); diff --git a/src/libs/engine/ObjectSender.cpp b/src/libs/engine/ObjectSender.cpp index b79a5df0..872c8d92 100644 --- a/src/libs/engine/ObjectSender.cpp +++ b/src/libs/engine/ObjectSender.cpp @@ -80,7 +80,9 @@ ObjectSender::send_patch(ClientInterface* client, const Patch* patch) const map<string, string>& data = patch->metadata(); for (map<string, string>::const_iterator j = data.begin(); j != data.end(); ++j) client->metadata_update(patch->path(), (*j).first, (*j).second); - + + if (patch->process()) + client->patch_enabled(patch->path()); } |