From a48f0cfd63dc4aa348d288605b2076c6c15c04f4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 25 May 2017 13:48:55 +0200 Subject: [PATCH] Pretty print control-outputs in generic-UI --- gtk2_ardour/generic_pluginui.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index 066aa95fa8..54417d8ee5 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -879,7 +879,10 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param, control_ui->vbox = manage (new VBox); control_ui->vbox->set_spacing(3); - if (desc.integer_step || desc.enumeration) { + if (desc.unit == ParameterDescriptor::MIDI_NOTE) { + control_ui->vbox->pack_end (*control_ui->display, false, false); + control_ui->vbox->pack_end (control_ui->label, false, false); + } else if (desc.integer_step || desc.enumeration) { control_ui->vbox->pack_end (*control_ui->display, false, false); control_ui->vbox->pack_end (control_ui->label, false, false); } else { @@ -1086,7 +1089,10 @@ GenericPluginUI::output_update () for (vector::iterator i = output_controls.begin(); i != output_controls.end(); ++i) { float val = plugin->get_parameter ((*i)->parameter().id()); char buf[32]; - snprintf (buf, sizeof(buf), "%.2f", val); + boost::shared_ptr c = insert->control_output ((*i)->parameter().id()); + const std::string& str = ARDOUR::value_as_string(c->desc(), Variant(val)); + size_t len = str.copy(buf, 31); + buf[len] = '\0'; (*i)->display_label->set_text (buf); /* autoscaling for the meter */