13
0

Increase precision of numeric dB entry

This follows 5a41ca8fdf and df1e6fda2d.
Even though this kind of precision is rarely needed, rounding
to a single digit is inconsistent with various places that display
more than one digit, or allow more accurate control.
This commit is contained in:
Robin Gareus 2020-08-01 09:57:18 +02:00
parent c2ffa07e28
commit 8b5737b8d2
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ 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) {
snprintf(buf, sizeof(buf), "%.1f dB", accurate_coefficient_to_dB (v));
snprintf(buf, sizeof(buf), "%.2f dB", accurate_coefficient_to_dB (v));
} else if (desc.type == PanWidthAutomation) {
snprintf (buf, sizeof (buf), "%d%%", (int) floor (100.0 * v));
} else if (!desc.print_fmt.empty()) {

View File

@ -61,7 +61,7 @@ BarController::BarController (Gtk::Adjustment& adj,
spinner.signal_activate().connect (mem_fun (*this, &BarController::entry_activated));
spinner.signal_focus_out_event().connect (mem_fun (*this, &BarController::entry_focus_out));
if (mc && mc->is_gain_like ()) {
spinner.set_digits (1); // 0.1 dB
spinner.set_digits (2); // 0.01 dB
} else {
spinner.set_digits (4);
}