Update gain widget to show no decimal places for scale > 0.5

The 4th Gen input gain control scale is 69/70 which is close enough to
1 that we don't need to display any decimal places.
This commit is contained in:
Geoffrey D. Bennett
2024-03-24 17:06:17 +10:30
parent 84ad8057ed
commit 4c02c8d29b
+2 -2
View File
@@ -70,12 +70,12 @@ static void gain_updated(
p += sprintf(p, "−");
else if (value > 0)
p += sprintf(p, "+");
if (data->scale < 1)
if (data->scale <= 0.5)
p += sprintf(p, "%.1f", fabs(value));
else
p += sprintf(p, "%.0f", fabs(value));
}
if (data->scale >= 1)
if (data->scale > 0.5)
p += sprintf(p, "dB");
gtk_label_set_text(GTK_LABEL(data->label), s);