ucm: add cfg-save command

Allow to save whole (or partial) local UCM alsa library configuration
to a file.

Syntax (saves key1.key2 sub-tree):

	Sequence [
		cfg-save "/tmp/my-file.conf:key1.key2"
	]

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-05-14 12:20:18 +02:00
parent f821f09727
commit 5e7c507152
4 changed files with 56 additions and 0 deletions

View file

@ -924,6 +924,16 @@ exec:
goto exec;
}
if (strcmp(cmd, "cfg-save") == 0) {
curr->type = SEQUENCE_ELEMENT_TYPE_CFGSAVE;
err = parse_string_substitute3(uc_mgr, n, &curr->data.cfgsave);
if (err < 0) {
uc_error("error: sysw requires a string!");
return err;
}
continue;
}
if (strcmp(cmd, "comment") == 0)
goto skip;