mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
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:
parent
b9b2247943
commit
8a36e38dc4
8 changed files with 536 additions and 162 deletions
|
|
@ -115,6 +115,7 @@ int snd_config_evaluate(snd_config_t *config, snd_config_t *root,
|
|||
snd_config_t *private_data, snd_config_t **result);
|
||||
|
||||
int snd_config_add(snd_config_t *config, snd_config_t *leaf);
|
||||
int snd_config_remove(snd_config_t *config);
|
||||
int snd_config_delete(snd_config_t *config);
|
||||
int snd_config_delete_compound_members(const snd_config_t *config);
|
||||
int snd_config_copy(snd_config_t **dst, snd_config_t *src);
|
||||
|
|
@ -179,6 +180,25 @@ snd_config_t *snd_config_iterator_entry(const snd_config_iterator_t iterator);
|
|||
#define snd_config_for_each(pos, next, node) \
|
||||
for (pos = snd_config_iterator_first(node), next = snd_config_iterator_next(pos); pos != snd_config_iterator_end(node); pos = next, next = snd_config_iterator_next(pos))
|
||||
|
||||
/**
|
||||
* \brief Helper macro to iterate over the children of a compound node.
|
||||
* \param[in,out] pos Iterator variable for the current node.
|
||||
* \param[in] node Handle to the compound configuration node to iterate over.
|
||||
*
|
||||
* Use this macro like a \c for statement, e.g.:
|
||||
* \code
|
||||
* snd_config_iterator_t pos;
|
||||
* snd_config_for_each(pos, node) {
|
||||
* snd_config_t *entry = snd_config_iterator_entry(pos);
|
||||
* ...
|
||||
* }
|
||||
* \endcode
|
||||
*
|
||||
* This macro does not allow deleting or removing the current node.
|
||||
*/
|
||||
#define snd_config_for_each_unsafe(pos, node) \
|
||||
for (pos = snd_config_iterator_first(node); pos != snd_config_iterator_end(node); pos = snd_config_iterator_next(pos))
|
||||
|
||||
/* Misc functions */
|
||||
|
||||
int snd_config_get_bool_ascii(const char *ascii);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue