mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
Format boolean parameter values
This commit is contained in:
parent
86dea93299
commit
9f37396315
1 changed files with 6 additions and 0 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue