Fix formatting of `-inf' on some Windows systems

Among others, this fixes tooltip display on aux-send faders
This commit is contained in:
Robin Gareus 2021-04-14 17:57:18 +02:00
parent f410dc433c
commit 63ef60ea93
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 8 additions and 0 deletions

View File

@ -54,7 +54,15 @@ value_as_string(const ARDOUR::ParameterDescriptor& desc,
if (desc.unit == ARDOUR::ParameterDescriptor::MIDI_NOTE) {
snprintf(buf, sizeof(buf), "%s", ParameterDescriptor::midi_note_name (rint(v)).c_str());
} else if (desc.type == GainAutomation || desc.type == BusSendLevel || desc.type == TrimAutomation || desc.type == EnvelopeAutomation || desc.type == MainOutVolume) {
#ifdef PLATFORM_WINDOWS
if (v < GAIN_COEFF_SMALL) {
snprintf(buf, sizeof(buf), "-inf dB");
} else {
snprintf(buf, sizeof(buf), "%.2f dB", accurate_coefficient_to_dB (v));
}
#else
snprintf(buf, sizeof(buf), "%.2f dB", accurate_coefficient_to_dB (v));
#endif
} else if (desc.type == PanWidthAutomation) {
snprintf (buf, sizeof (buf), "%d%%", (int) floor (100.0 * v));
} else if (!desc.print_fmt.empty()) {