ucm: implement CardIdByName substitution

The syntax is ${CardIdByName:CARDNAME[#INDEX]}.

The CARDNAME is the ALSA's soundcard name (short form).
The INDEX is the instance (0 = first, 1 = second etc.).

Example: ${CardIdByName:HDA Intel PCH}
(which is identical to ${CardIdByName:HDA Intel PCH#0})

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2020-06-03 17:12:19 +02:00
parent f60e0d5fdc
commit eee879d381
6 changed files with 135 additions and 56 deletions

View file

@ -228,7 +228,7 @@ static int if_eval_control_exists(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval
err = uc_mgr_get_substituted_value(uc_mgr, &s, device);
if (err < 0)
return err;
err = uc_mgr_open_ctl(uc_mgr, &ctl, s);
err = uc_mgr_open_ctl(uc_mgr, &ctl, s, 1);
free(s);
if (err < 0)
return err;