From 9dadfb83f9ce69a870362824bc6a3cad371385af Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Aug 2008 20:16:21 +0000 Subject: Set/send/etc properties through the engine. Add 'ingen:selected' property so selection is persistent and shared among clients. git-svn-id: http://svn.drobilla.net/lad/ingen@1424 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/NodeModule.cpp | 20 +++++++++++++++++++- src/libs/gui/NodeModule.hpp | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'src/libs/gui') diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index 7ac86e40..c38a898b 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -315,8 +315,26 @@ NodeModule::set_variable(const string& key, const Atom& value) void NodeModule::set_property(const string& key, const Atom& value) { - if (key == "ingen:polyphonic" && value.type() == Atom::BOOL) + if (key == "ingen:polyphonic" && value.type() == Atom::BOOL) { set_stacked_border(value.get_bool()); + } else if (key == "ingen:selected" && value.type() == Atom::BOOL) { + if (value.get_bool() != selected()) { + if (value.get_bool()) + _canvas.lock()->select_item(shared_from_this()); + else + _canvas.lock()->unselect_item(shared_from_this()); + } + } +} + + +void +NodeModule::set_selected(bool b) +{ + if (b != selected()) { + Module::set_selected(b); + App::instance().engine()->set_property(_node->path(), "ingen:selected", b); + } } diff --git a/src/libs/gui/NodeModule.hpp b/src/libs/gui/NodeModule.hpp index 3bf2d3eb..2b592446 100644 --- a/src/libs/gui/NodeModule.hpp +++ b/src/libs/gui/NodeModule.hpp @@ -70,6 +70,7 @@ protected: void embed_gui(bool embed); bool popup_gui(); void on_gui_window_close(); + void set_selected(bool b); void rename(); void set_variable(const std::string& key, const Atom& value); -- cgit v1.2.1