ucm: add If condition block

The syntax is simple:

If./any-if-identificator/ {
  Condition {
    Type /type_here/
    /optional defines/
  }
  True {
    /block used when condition is evaluated as true/
  }
  False {
    /block used when condition is evaluated as false/
  }
}

The Type "ControlExists" is implemented:

Condition {
  Type ControlExists
  Device "hw:${CardId}"
  Control "iface=CARD,name='Headphone Jack'"
}

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2019-11-05 13:02:41 +01:00
parent b9b2247943
commit 8a36e38dc4
8 changed files with 536 additions and 162 deletions

View file

@ -64,6 +64,16 @@ struct ctl_list *uc_mgr_get_one_ctl(snd_use_case_mgr_t *uc_mgr)
return ctl_list;
}
snd_ctl_t *uc_mgr_get_ctl(snd_use_case_mgr_t *uc_mgr)
{
struct ctl_list *ctl_list;
ctl_list = uc_mgr_get_one_ctl(uc_mgr);
if (ctl_list)
return ctl_list->ctl;
return NULL;
}
static void uc_mgr_free_ctl(struct ctl_list *ctl_list)
{
struct list_head *pos, *npos;