From 77d608d6ca282795b348a615932b1abbd47b0472 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Aug 2008 23:35:43 +0000 Subject: Copy/paste of patch ports. git-svn-id: http://svn.drobilla.net/lad/ingen@1427 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/PatchPortModule.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/libs/gui/PatchPortModule.cpp') diff --git a/src/libs/gui/PatchPortModule.cpp b/src/libs/gui/PatchPortModule.cpp index ec083c1b..b23ac5c7 100644 --- a/src/libs/gui/PatchPortModule.cpp +++ b/src/libs/gui/PatchPortModule.cpp @@ -129,10 +129,29 @@ PatchPortModule::set_variable(const string& key, const Atom& value) void PatchPortModule::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 +PatchPortModule::set_selected(bool b) +{ + if (b != selected()) { + Module::set_selected(b); + App::instance().engine()->set_property(_port->path(), "ingen:selected", b); + } } + } // namespace GUI } // namespace Ingen -- cgit v1.2.1