Add support for piecewise linear interpolation taper to GtkDial

This commit adds support for piecewise linear interpolation tapers to
GtkDial and the gain widget so that the 4th Gen 4i4 volume knob taper
can be modelled correctly.
This commit is contained in:
Geoffrey D. Bennett
2024-01-17 17:54:11 +10:30
parent 492c348897
commit df5d0960dd
5 changed files with 93 additions and 4 deletions

View File

@@ -503,7 +503,11 @@ static void create_output_controls(
GtkWidget *l = gtk_label_new(gen4 ? "Line 12" : "HW");
gtk_grid_attach(GTK_GRID(output_grid), l, 0, 0, 1, 1);
w = make_gain_alsa_elem(elem, 1, WIDGET_GAIN_TAPER_LOG);
if (gen4) {
w = make_gain_alsa_elem(elem, 1, WIDGET_GAIN_TAPER_GEN4_VOLUME);
} else {
w = make_gain_alsa_elem(elem, 1, WIDGET_GAIN_TAPER_LOG);
}
gtk_widget_set_tooltip_text(
w,
gen4
@@ -522,7 +526,7 @@ static void create_output_controls(
"This control shows the setting of the headphone volume knob."
);
gtk_grid_attach(GTK_GRID(output_grid), l, 1, 0, 1, 1);
w = make_gain_alsa_elem(elem, 1, WIDGET_GAIN_TAPER_LOG);
w = make_gain_alsa_elem(elem, 1, WIDGET_GAIN_TAPER_GEN4_VOLUME);
gtk_grid_attach(GTK_GRID(output_grid), w, 1, 1, 1, 1);
} else if (strcmp(elem->name, "Mute Playback Switch") == 0) {
w = make_boolean_alsa_elem(