From bd6ba1717ef43bd4399b96a03bbb576eab55b9a2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 31 Oct 2014 22:20:24 -0400 Subject: Decouple ControlUI from port index. --- libs/ardour/ardour/plugin.h | 5 +++-- libs/ardour/ladspa_plugin.cc | 2 ++ libs/ardour/lv2_plugin.cc | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h index 08f242c7b4..f1a54b073a 100644 --- a/libs/ardour/ardour/plugin.h +++ b/libs/ardour/ardour/plugin.h @@ -95,6 +95,8 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent Plugin (const Plugin&); virtual ~Plugin (); + typedef std::map ScalePoints; + struct ParameterDescriptor { ParameterDescriptor () @@ -131,6 +133,7 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent bool midinote; ///< only used if integer_step is also true uint32_t key; ///< for properties Variant::Type datatype; ///< for properties + boost::shared_ptr scale_points; }; XMLNode& get_state (); @@ -170,8 +173,6 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent virtual bool parameter_is_input(uint32_t) const = 0; virtual bool parameter_is_output(uint32_t) const = 0; - typedef std::map ScalePoints; - virtual boost::shared_ptr get_scale_points(uint32_t /*port_index*/) const { return boost::shared_ptr(); } diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index 8b089929b5..a33e7e0911 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -522,6 +522,8 @@ LadspaPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& des desc.label = port_names()[which]; + desc.scale_points = get_scale_points(which); + return 0; } diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 4d5e063c71..ac4e213851 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -1562,6 +1562,7 @@ 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); lilv_node_free(def); lilv_node_free(min); -- cgit v1.2.3