mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-03-20 05:33:44 -04:00
ucm: add Repeat block - repetitive pattern substitution (Syntax 9)
Implements Repeat blocks for generating repetitive configuration patterns
with variable substitution. This feature allows applying a configuration
block multiple times with different variable values, significantly reducing
duplication in UCM configuration files.
iterator abstraction allows easy extension for future pattern types.
Example:
Repeat.VolumeInit {
Pattern {
Variable 'ch'
Type Integer
First 0
Last 7
Step 1
}
Apply {
cset "name='PCM Channel ${var:ch} Volume' 100%"
}
}
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
2943b1e412
commit
27aa3e41ef
5 changed files with 540 additions and 3 deletions
|
|
@ -729,9 +729,9 @@ int uc_mgr_evaluate_inplace(snd_use_case_mgr_t *uc_mgr,
|
|||
snd_config_t *cfg)
|
||||
{
|
||||
long iterations = 10000;
|
||||
int err1 = 0, err2 = 0, err3 = 0, err4 = 0, err5 = 0;
|
||||
int err1 = 0, err2 = 0, err3 = 0, err4 = 0, err5 = 0, err6 = 0;
|
||||
|
||||
while (err1 == 0 || err2 == 0 || err3 == 0 || err4 == 0 || err5 == 0) {
|
||||
while (err1 == 0 || err2 == 0 || err3 == 0 || err4 == 0 || err5 == 0 || err6 == 0) {
|
||||
if (iterations == 0) {
|
||||
snd_error(UCM, "Maximal inplace evaluation iterations number reached (recursive references?)");
|
||||
return -EINVAL;
|
||||
|
|
@ -768,6 +768,9 @@ int uc_mgr_evaluate_inplace(snd_use_case_mgr_t *uc_mgr,
|
|||
err5 = evaluate_condition(uc_mgr, cfg);
|
||||
if (err5 < 0)
|
||||
return err5;
|
||||
err6 = uc_mgr_evaluate_repeat(uc_mgr, cfg);
|
||||
if (err6 < 0)
|
||||
return err6;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue