Format boolean parameter values

This commit is contained in:
Robin Gareus 2017-06-21 17:09:31 +02:00
parent 86dea93299
commit 9f37396315

View file

@ -26,6 +26,8 @@
#include "ardour/dB.h"
#include "ardour/parameter_descriptor.h"
#include "pbd/i18n.h"
namespace ARDOUR {
inline std::string
@ -45,6 +47,10 @@ value_as_string(const ARDOUR::ParameterDescriptor& desc,
}
}
if (desc.toggled) {
return v >= 0 ? _("on") : _("off");
}
// Value is not a scale point, print it normally
if (desc.unit == ARDOUR::ParameterDescriptor::MIDI_NOTE) {
snprintf(buf, sizeof(buf), "%s", ParameterDescriptor::midi_note_name (rint(v)).c_str());