summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/NodeModule.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-17 20:16:21 +0000
committerDavid Robillard <d@drobilla.net>2008-08-17 20:16:21 +0000
commit9dadfb83f9ce69a870362824bc6a3cad371385af (patch)
tree8018e5fdcd77dbb674191c3a3200c2680670876b /src/libs/gui/NodeModule.cpp
parentcd0bc4625bab110e8e4b780c5b80c87662d35bab (diff)
downloadingen-9dadfb83f9ce69a870362824bc6a3cad371385af.tar.gz
ingen-9dadfb83f9ce69a870362824bc6a3cad371385af.tar.bz2
ingen-9dadfb83f9ce69a870362824bc6a3cad371385af.zip
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
Diffstat (limited to 'src/libs/gui/NodeModule.cpp')
-rw-r--r--src/libs/gui/NodeModule.cpp20
1 files changed, 19 insertions, 1 deletions
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);
+ }
}