summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/PatchPortModule.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-17 04:05:30 +0000
committerDavid Robillard <d@drobilla.net>2008-08-17 04:05:30 +0000
commitfa067527fe00b66b85d71955e152e9ef9215c9cd (patch)
tree382a8e9e58259929415e7188992252ac1ca2ea9b /src/libs/gui/PatchPortModule.cpp
parent3019b09099371b3fe568b7dcc3bb92203d800b1f (diff)
downloadingen-fa067527fe00b66b85d71955e152e9ef9215c9cd.tar.gz
ingen-fa067527fe00b66b85d71955e152e9ef9215c9cd.tar.bz2
ingen-fa067527fe00b66b85d71955e152e9ef9215c9cd.zip
Replace imperative polyphony/polyphonic stuff with properties (kill more API).
git-svn-id: http://svn.drobilla.net/lad/ingen@1412 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/PatchPortModule.cpp')
-rw-r--r--src/libs/gui/PatchPortModule.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/libs/gui/PatchPortModule.cpp b/src/libs/gui/PatchPortModule.cpp
index a6192210..75504a91 100644
--- a/src/libs/gui/PatchPortModule.cpp
+++ b/src/libs/gui/PatchPortModule.cpp
@@ -58,8 +58,8 @@ PatchPortModule::PatchPortModule(boost::shared_ptr<PatchCanvas> canvas, SharedPt
set_stacked_border(port->polyphonic());
- port->signal_variable.connect(sigc::mem_fun(this, &PatchPortModule::variable_change));
- port->signal_polyphonic.connect(sigc::mem_fun(this, &PatchPortModule::set_stacked_border));
+ port->signal_variable.connect(sigc::mem_fun(this, &PatchPortModule::set_variable));
+ port->signal_property.connect(sigc::mem_fun(this, &PatchPortModule::set_property));
}
@@ -77,7 +77,10 @@ PatchPortModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortMod
ret->set_menu(ret->_patch_port->menu());
for (GraphObject::Variables::const_iterator m = port->variables().begin(); m != port->variables().end(); ++m)
- ret->variable_change(m->first, m->second);
+ ret->set_variable(m->first, m->second);
+
+ for (GraphObject::Variables::const_iterator m = port->properties().begin(); m != port->properties().end(); ++m)
+ ret->set_property(m->first, m->second);
ret->resize();
@@ -114,7 +117,7 @@ PatchPortModule::store_location()
void
-PatchPortModule::variable_change(const string& key, const Atom& value)
+PatchPortModule::set_variable(const string& key, const Atom& value)
{
if (key == "ingenuity:canvas-x" && value.type() == Atom::FLOAT)
move_to(value.get_float(), property_y());
@@ -123,5 +126,13 @@ PatchPortModule::variable_change(const string& key, const Atom& value)
}
+void
+PatchPortModule::set_property(const string& key, const Atom& value)
+{
+ if (key == "ingen:polyphonic" && value.type() == Atom::BOOL)
+ set_stacked_border(value.get_bool());
+}
+
+
} // namespace GUI
} // namespace Ingen