summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
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
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')
-rw-r--r--src/libs/gui/NodeModule.cpp20
-rw-r--r--src/libs/gui/NodeModule.hpp1
2 files changed, 20 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);
+ }
}
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);