diff options
author | Robin Gareus <robin@gareus.org> | 2016-07-12 23:00:15 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-07-12 23:02:46 +0200 |
commit | 6b5be3d89257fb91a1c8c1b2d166106deb5a6874 (patch) | |
tree | 3b9fadd8e0abe2ec080acf8dbf8f932dd0f54af9 /libs/ardour/ardour/value_as_string.h | |
parent | cd5e86c24a39a7343bfa2089ceaf995ed69342ce (diff) |
Add a new API to format midi-note-names with translation: Do Re Mi...
This deprecates Evoral::midi_note_name(). we don't maintain i18n
for libevoral.
Diffstat (limited to 'libs/ardour/ardour/value_as_string.h')
-rw-r--r-- | libs/ardour/ardour/value_as_string.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/libs/ardour/ardour/value_as_string.h b/libs/ardour/ardour/value_as_string.h index c2f40fc8c4..9e042b78fa 100644 --- a/libs/ardour/ardour/value_as_string.h +++ b/libs/ardour/ardour/value_as_string.h @@ -46,16 +46,7 @@ value_as_string(const ARDOUR::ParameterDescriptor& desc, // Value is not a scale point, print it normally if (desc.unit == ARDOUR::ParameterDescriptor::MIDI_NOTE) { - if (v >= 0 && v <= 127) { - const int num = rint(v); - static const char names[12][3] = { - "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" - }; - snprintf(buf, sizeof(buf), "%s %d", names[num % 12], (num / 12) - 2); - } else { - // Odd, invalid range, just print the number - snprintf(buf, sizeof(buf), "%.0f", v); - } + snprintf(buf, sizeof(buf), "%s", ParameterDescriptor::midi_note_name (rint(v)).c_str()); } else if (!desc.print_fmt.empty()) { snprintf(buf, sizeof(buf), desc.print_fmt.c_str(), v); } else if (desc.integer_step) { |