diff options
author | Robin Gareus <robin@gareus.org> | 2017-06-21 14:41:40 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-06-21 18:13:26 +0200 |
commit | 7ab15def2be8bbf156442918e4b8e5f21c8962ba (patch) | |
tree | 2462b5fa834df167566f32a9029fd46690cf091c /libs/ardour/lv2_plugin.cc | |
parent | df6655ac682ef99f4d637520d8d1bf8aa5b3beea (diff) |
Consolidate ParameterDescriptor settings+ranges
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 1c761166e0..543feb5930 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -2125,31 +2125,11 @@ LV2Plugin::get_parameter_descriptor(uint32_t which, ParameterDescriptor& desc) c desc.enumeration = lilv_port_has_property(_impl->plugin, port, _world.lv2_enumeration); desc.scale_points = get_scale_points(which); - desc.update_steps(); - if (steps) { - //override auto-calculated steps in update_steps() - float s = lilv_node_as_float (steps); - const float delta = desc.upper - desc.lower; - - desc.step = desc.smallstep = (delta / s); - desc.largestep = std::min ((delta / 5.0f), 10.f * desc.smallstep); - - if (desc.logarithmic) { - // TODO marry AutomationControl::internal_to_interface () with - // http://lv2plug.in/ns/ext/port-props/#rangeSteps - desc.smallstep = desc.smallstep / logf(s); - desc.step = desc.step / logf(s); - desc.largestep = desc.largestep / logf(s); - } else if (desc.integer_step) { - desc.smallstep = 1.0; - desc.step = std::max(1.f, rintf (desc.step)); - desc.largestep = std::max(1.f, rintf (desc.largestep)); - } - DEBUG_TRACE(DEBUG::LV2, string_compose("parameter %1 small: %2, step: %3 largestep: %4\n", - which, desc.smallstep, desc.step, desc.largestep)); + desc.rangesteps = lilv_node_as_float (steps); } + desc.update_steps(); lilv_node_free(def); lilv_node_free(min); |