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-12 00:13:44 +10:30
parent 0fae084ccb
commit 607b002985

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);