From bb1f9e95381a75951f6f4948de986553c16dace4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 27 Jul 2007 05:43:45 +0000 Subject: Track control values for port 'sliders' (module sliders move in sync with node control window sliders or whatever else). git-svn-id: http://svn.drobilla.net/lad/ingen@646 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/PortPropertiesWindow.cpp | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) (limited to 'src/libs/gui/PortPropertiesWindow.cpp') diff --git a/src/libs/gui/PortPropertiesWindow.cpp b/src/libs/gui/PortPropertiesWindow.cpp index 3ca1b2c3..c975d289 100644 --- a/src/libs/gui/PortPropertiesWindow.cpp +++ b/src/libs/gui/PortPropertiesWindow.cpp @@ -60,37 +60,12 @@ PortPropertiesWindow::init(ControlGroup* control, SharedPtr pm) _port_model = pm; _control = control; - set_title(pm->path() + " Properties"); - // FIXME: code duplication w/ ControlGroups.cpp - float min = 0.0f; - float max = 1.0f; - - const Atom& min_atom = pm->get_metadata("ingen:minimum"); - const Atom& max_atom = pm->get_metadata("ingen:maximum"); - if (min_atom.type() == Atom::FLOAT && max_atom.type() == Atom::FLOAT) { - min = min_atom.get_float(); - max = max_atom.get_float(); - } - - const SharedPtr parent = PtrCast(pm->parent()); - -#ifdef HAVE_SLV2 - if (parent && parent->plugin() && parent->plugin()->type() == PluginModel::LV2) { - min = slv2_port_get_minimum_value( - parent->plugin()->slv2_plugin(), - slv2_plugin_get_port_by_symbol(parent->plugin()->slv2_plugin(), - pm->path().name().c_str())); - max = slv2_port_get_maximum_value( - parent->plugin()->slv2_plugin(), - slv2_plugin_get_port_by_symbol(parent->plugin()->slv2_plugin(), - pm->path().name().c_str())); - } -#endif - - if (max <= min) - max = min + 1.0f; + float min = 0.0f, max = 1.0f; + boost::shared_ptr parent = PtrCast(_port_model->parent()); + if (parent) + parent->port_value_range(_port_model->path().name(), min, max); _initial_min = min; _initial_max = max; -- cgit v1.2.1