Gen 1: Add support for 1st Gen mixer controls
This commit is contained in:
@@ -69,14 +69,20 @@ GtkWidget *create_mixer_controls(struct alsa_card *card) {
|
|||||||
if (!elem->card)
|
if (!elem->card)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// looking for "Mix X Input Y Playback Volume" elements
|
// looking for "Mix X Input Y Playback Volume"
|
||||||
if (strncmp(elem->name, "Mix ", 4) != 0)
|
// or "Matrix Y Mix X Playback Volume" elements (Gen 1)
|
||||||
continue;
|
|
||||||
if (!strstr(elem->name, "Playback Volume"))
|
if (!strstr(elem->name, "Playback Volume"))
|
||||||
continue;
|
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
|
// 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;
|
int input_num = get_num_from_string(elem->name) - 1;
|
||||||
|
|
||||||
if (mix_num >= MAX_MIX_OUT) {
|
if (mix_num >= MAX_MIX_OUT) {
|
||||||
|
|||||||
Reference in New Issue
Block a user