*/
int const steps = desc.integer_step ? (desc.upper - desc.lower + 1) / desc.step : 0;
- if (control_ui->scale_points && steps && control_ui->scale_points->size() == steps) {
- /* There is a label for each possible value of this input, so build a combo box */
+ if (control_ui->scale_points && ((steps && control_ui->scale_points->size() == steps) || desc.enumeration)) {
+
+ /* Either:
+ * a) There is a label for each possible value of this input, or
+ * b) This port is marked as being an enumeration.
+ */
std::vector<std::string> labels;
for (
struct ParameterDescriptor {
+ /* XXX: it would probably be nice if this initialised everything */
+ ParameterDescriptor ()
+ : enumeration (false)
+ {}
+
/* essentially a union of LADSPA and VST info */
bool integer_step;
float largestep;
bool min_unbound;
bool max_unbound;
+ bool enumeration;
};
XMLNode& get_state ();
LilvNode* lv2_integer;
LilvNode* lv2_sampleRate;
LilvNode* lv2_toggled;
+ LilvNode* lv2_enumeration;
LilvNode* midi_MidiEvent;
LilvNode* ui_GtkUI;
LilvNode* ui_external;
desc.largestep = delta / 10.0f;
}
+ desc.enumeration = lilv_port_has_property(_impl->plugin, port, _world.lv2_enumeration);
+
lilv_node_free(def);
lilv_node_free(min);
lilv_node_free(max);
lv2_integer = lilv_new_uri(world, LILV_NS_LV2 "integer");
lv2_sampleRate = lilv_new_uri(world, LILV_NS_LV2 "sampleRate");
lv2_toggled = lilv_new_uri(world, LILV_NS_LV2 "toggled");
+ lv2_enumeration = lilv_new_uri(world, LILV_NS_LV2 "enumeration");
midi_MidiEvent = lilv_new_uri(world, LILV_URI_MIDI_EVENT);
ui_GtkUI = lilv_new_uri(world, NS_UI "GtkUI");
ui_external = lilv_new_uri(world, NS_UI "external");