ucm: configuration - allow to define the configuration variables

It may be useful for the library files to use the runtime configuration
variables.

Example:

 Define.Var1 "hw:${CardId},2"
 Value.PlaybackPCM "${var:Var1}"

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2020-05-20 19:04:36 +02:00
parent 6cc6024ac5
commit ed4567d1c9
5 changed files with 130 additions and 5 deletions

View file

@ -239,6 +239,9 @@ struct snd_use_case_mgr {
/* locking */
pthread_mutex_t mutex;
/* UCM internal variables defined in configuration files */
struct list_head variable_list;
/* list of opened control devices */
struct list_head ctl_list;
@ -289,6 +292,13 @@ void uc_mgr_free_ctl_list(snd_use_case_mgr_t *uc_mgr);
int uc_mgr_add_value(struct list_head *base, const char *key, char *val);
const char *uc_mgr_get_variable(snd_use_case_mgr_t *uc_mgr,
const char *name);
int uc_mgr_set_variable(snd_use_case_mgr_t *uc_mgr,
const char *name,
const char *val);
int uc_mgr_get_substituted_value(snd_use_case_mgr_t *uc_mgr,
char **_rvalue,
const char *value);