From d76ab24976e452d02e114182b3a563eeb11e8785 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 1 May 2012 06:46:55 +0000 Subject: Implement menu selector for enumeration ports (sort of address #780). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4308 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/PluginModel.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/client') diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 9c5bd2bb..7d5aa993 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -185,6 +185,25 @@ PluginModel::port_human_name(uint32_t i) const return ""; } +PluginModel::ScalePoints +PluginModel::port_scale_points(uint32_t i) const +{ + // TODO: Non-float scale points + ScalePoints points; + if (_lilv_plugin) { + const LilvPort* port = lilv_plugin_get_port_by_index(_lilv_plugin, i); + LilvScalePoints* sp = lilv_port_get_scale_points(_lilv_plugin, port); + LILV_FOREACH(scale_points, i, sp) { + const LilvScalePoint* p = lilv_scale_points_get(sp, i); + points.push_back( + std::make_pair( + lilv_node_as_float(lilv_scale_point_get_value(p)), + lilv_node_as_string(lilv_scale_point_get_label(p)))); + } + } + return points; +} + bool PluginModel::has_ui() const { -- cgit v1.2.1