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

@ -1,6 +1,6 @@
EXTRA_LTLIBRARIES = libucm.la
libucm_la_SOURCES = utils.c parser.c main.c
libucm_la_SOURCES = utils.c parser.c ucm_cond.c ucm_subs.c main.c
noinst_HEADERS = ucm_local.h