diff options
author | David Robillard <d@drobilla.net> | 2011-05-14 18:43:34 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-14 18:43:34 +0000 |
commit | 2b7f092b857df8cde0cd4680e9de55f4cb98596b (patch) | |
tree | 221203a26c8e6a5b902f55ba87c40f36f886003f /libs/ardour/ladspa_plugin.cc | |
parent | c78528dcea03a61685ad0586eaa6302847af6fe9 (diff) |
Generic scale points API.
Hide scale points implementation inside specific Plugin subclass.
Don't needlessley/slowly get scale points twice for each port while building UI.
Remove dependence on specific plugin types from GenericPluginUI.
git-svn-id: svn://localhost/ardour2/branches/3.0@9511 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ladspa_plugin.cc')
-rw-r--r-- | libs/ardour/ladspa_plugin.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index 1ea158d7cd..f5426500a4 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -605,6 +605,28 @@ LadspaPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const } } +boost::shared_ptr<Plugin::ScalePoints> +LadspaPlugin::get_scale_points(uint32_t port_index) const +{ + const uint32_t id = atol(unique_id().c_str()); + lrdf_defaults* points = lrdf_get_scale_values(id, port_index); + + boost::shared_ptr<Plugin::ScalePoints> ret; + if (!points) { + return ret; + } + + ret = boost::shared_ptr<Plugin::ScalePoints>(new ScalePoints()); + + for (uint32_t i = 0; i < points->count; ++i) { + ret->insert(make_pair(points->items[i].label, + points->items[i].value)); + } + + lrdf_free_setting_values(points); + return ret; +} + void LadspaPlugin::run_in_place (pframes_t nframes) { |