summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-01 06:46:55 +0000
committerDavid Robillard <d@drobilla.net>2012-05-01 06:46:55 +0000
commitd76ab24976e452d02e114182b3a563eeb11e8785 (patch)
tree801e459ac10f176bcce8221d2cba17bf71a14f6c /src/client
parent7477318adc8de5244fc314939c296ae74605eaa5 (diff)
downloadingen-d76ab24976e452d02e114182b3a563eeb11e8785.tar.gz
ingen-d76ab24976e452d02e114182b3a563eeb11e8785.tar.bz2
ingen-d76ab24976e452d02e114182b3a563eeb11e8785.zip
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
Diffstat (limited to 'src/client')
-rw-r--r--src/client/PluginModel.cpp19
1 files changed, 19 insertions, 0 deletions
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
{