summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-17 23:35:43 +0000
committerDavid Robillard <d@drobilla.net>2008-08-17 23:35:43 +0000
commit77d608d6ca282795b348a615932b1abbd47b0472 (patch)
treebc714c316e0611ea5daa8c7f77a0cff2f57cab59 /src/libs/gui
parent14401d11e598651e7caf39cce884362e58ef5941 (diff)
downloadingen-77d608d6ca282795b348a615932b1abbd47b0472.tar.gz
ingen-77d608d6ca282795b348a615932b1abbd47b0472.tar.bz2
ingen-77d608d6ca282795b348a615932b1abbd47b0472.zip
Copy/paste of patch ports.
git-svn-id: http://svn.drobilla.net/lad/ingen@1427 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/PatchPortModule.cpp21
-rw-r--r--src/libs/gui/PatchPortModule.hpp1
2 files changed, 21 insertions, 1 deletions
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<PatchCanvas> canvas, SharedPtr<PortModel> 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);