envy24control: port to GTK 3

Signed-off-by: Andreas Persson <andreasp56@outlook.com>
This commit is contained in:
Andreas Persson 2025-04-09 12:25:09 +02:00
parent 32495631b1
commit 16bb554fce
12 changed files with 541 additions and 534 deletions

View file

@ -39,7 +39,7 @@ extern int input_channels, output_channels, pcm_output_channels, spdif_channels,
static int is_active(GtkWidget *widget)
{
return GTK_TOGGLE_BUTTON(widget)->active ? 1 : 0;
return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) ? 1 : 0;
}
void mixer_update_stream(int stream, int vol_flag, int sw_flag)
@ -181,10 +181,10 @@ void mixer_adjust(GtkAdjustment *adj, gpointer data)
int stereo = is_active(mixer_stereo_toggle[stream-1]) ? 1 : 0;
int vol[2] = { -1, -1 };
vol[button] = 96 - adj->value;
vol[button] = 96 - gtk_adjustment_get_value(adj);
if (stereo) {
gtk_adjustment_set_value(GTK_ADJUSTMENT(mixer_adj[stream-1][button ^ 1]), adj->value);
vol[button ^ 1] = 96 - adj->value;
gtk_adjustment_set_value(GTK_ADJUSTMENT(mixer_adj[stream-1][button ^ 1]), gtk_adjustment_get_value(adj));
vol[button ^ 1] = 96 - gtk_adjustment_get_value(adj);
}
set_volume1(stream, vol[0], vol[1]);
}