Format boolean parameter values
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user