Gen 1: Add support for 1st Gen mixer controls

This commit is contained in:
Geoffrey D. Bennett
2025-02-20 23:02:39 +10:30
parent 45287711a4
commit 845dd5c98b

View File

@@ -69,14 +69,20 @@ GtkWidget *create_mixer_controls(struct alsa_card *card) {
if (!elem->card)
continue;
// looking for "Mix X Input Y Playback Volume" elements
if (strncmp(elem->name, "Mix ", 4) != 0)
continue;
// looking for "Mix X Input Y Playback Volume"
// or "Matrix Y Mix X Playback Volume" elements (Gen 1)
if (!strstr(elem->name, "Playback Volume"))
continue;
if (strncmp(elem->name, "Mix ", 4) &&
strncmp(elem->name, "Matrix ", 7))
continue;
char *mix_str = strstr(elem->name, "Mix ");
if (!mix_str)
continue;
// extract the mix number and input number from the element name
int mix_num = elem->name[4] - 'A';
int mix_num = mix_str[4] - 'A';
int input_num = get_num_from_string(elem->name) - 1;
if (mix_num >= MAX_MIX_OUT) {