From c11ecf0fd10641218326ae384e80413ba3cdf46c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 27 May 2009 17:42:51 +0000 Subject: Remove 'new_patch', 'new_node', and 'new_port' from interface in favour of generic 'put'. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2011 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/PatchPortModule.cpp | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'src/gui/PatchPortModule.cpp') diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index 0b88746c..09b7dd4a 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -48,7 +48,7 @@ PatchPortModule::PatchPortModule(boost::shared_ptr canvas, SharedPt set_stacked_border(model->polyphonic()); - model->signal_variable.connect(sigc::mem_fun(this, &PatchPortModule::set_variable)); + model->signal_variable.connect(sigc::mem_fun(this, &PatchPortModule::set_property)); model->signal_property.connect(sigc::mem_fun(this, &PatchPortModule::set_property)); } @@ -65,7 +65,7 @@ PatchPortModule::create(boost::shared_ptr canvas, SharedPtrvariables().begin(); m != model->variables().end(); ++m) - ret->set_variable(m->first, m->second); + ret->set_property(m->first, m->second); for (GraphObject::Properties::const_iterator m = model->properties().begin(); m != model->properties().end(); ++m) @@ -131,24 +131,6 @@ PatchPortModule::set_name(const std::string& n) } -void -PatchPortModule::set_variable(const URI& key, const Atom& value) -{ - if (value.type() == Atom::BOOL) { - if (key.str() == "ingen:polyphonic") { - set_stacked_border(value.get_bool()); - } else if (key.str() == "ingen:selected") { - 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_property(const URI& key, const Atom& value) { @@ -166,6 +148,18 @@ PatchPortModule::set_property(const URI& key, const Atom& value) } else if (key.str() == "lv2:symbol" && !_human_name_visible) { set_name(value.get_string()); } + case Atom::BOOL: + if (key.str() == "ingen:polyphonic") { + set_stacked_border(value.get_bool()); + } else if (key.str() == "ingen:selected") { + if (value.get_bool() != selected()) { + if (value.get_bool()) { + _canvas.lock()->select_item(shared_from_this()); + } else { + _canvas.lock()->unselect_item(shared_from_this()); + } + } + } default: break; } } -- cgit v1.2.1