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 ++++++++++++++++++++- src/libs/gui/PatchPortModule.hpp | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src/libs/gui') 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 diff --git a/src/libs/gui/PatchPortModule.hpp b/src/libs/gui/PatchPortModule.hpp index bdf9c6d5..d6715834 100644 --- a/src/libs/gui/PatchPortModule.hpp +++ b/src/libs/gui/PatchPortModule.hpp @@ -62,6 +62,7 @@ protected: PatchPortModule(boost::shared_ptr canvas, SharedPtr port); void create_menu(); + void set_selected(bool b); void set_variable(const std::string& predicate, const Raul::Atom& value); void set_property(const std::string& predicate, const Raul::Atom& value); -- cgit v1.2.1