diff options
author | Jaroslav Kysela <perex@perex.cz> | 2010-11-23 15:58:14 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2010-11-23 15:58:14 +0100 |
commit | aaf55f16414eb81e8e805f669182f280496b41dd (patch) | |
tree | 300e0e793fcf3a604c879109ec791b31669f262a | |
parent | cdc9dd50bf37cc01782c9eb50dc7d217c4b79d7f (diff) | |
download | alsa-lib-aaf55f16414eb81e8e805f669182f280496b41dd.tar.gz |
ucm: add cdev
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | src/ucm/main.c | 3 | ||||
-rw-r--r-- | src/ucm/parser.c | 11 | ||||
-rw-r--r-- | src/ucm/ucm_local.h | 8 |
3 files changed, 19 insertions, 3 deletions
diff --git a/src/ucm/main.c b/src/ucm/main.c index a73595d8..9f950e42 100644 --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -133,6 +133,9 @@ static int execute_sequence(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, list_for_each(pos, seq) { s = list_entry(pos, struct sequence_element, list); switch (s->type) { + case SEQUENCE_ELEMENT_TYPE_CDEV: + uc_error("cdev not yet implemented: '%s'", s->data.cdev); + break; case SEQUENCE_ELEMENT_TYPE_CSET: uc_error("cset not yet implemented: '%s'", s->data.cset); break; diff --git a/src/ucm/parser.c b/src/ucm/parser.c index 69a84545..2407d399 100644 --- a/src/ucm/parser.c +++ b/src/ucm/parser.c @@ -188,6 +188,7 @@ static int parse_supported_device(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, * * Sequence controls elements are in the following form:- * + * cdev "hw:0,0" * cset "element_id_syntax value_syntax" * usleep time * exec "any unix command with arguments" @@ -233,6 +234,16 @@ static int parse_sequence(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, return -ENOMEM; list_add_tail(&curr->list, base); + if (strcmp(cmd, "cdev") == 0) { + curr->type = SEQUENCE_ELEMENT_TYPE_CDEV; + err = parse_string(n, &curr->data.cdev); + if (err < 0) { + uc_error("error: cdev requires a string!"); + return err; + } + continue; + } + if (strcmp(cmd, "cset") == 0) { curr->type = SEQUENCE_ELEMENT_TYPE_CSET; err = parse_string(n, &curr->data.cset); diff --git a/src/ucm/ucm_local.h b/src/ucm/ucm_local.h index 0515de17..479cc976 100644 --- a/src/ucm/ucm_local.h +++ b/src/ucm/ucm_local.h @@ -42,9 +42,10 @@ #define MAX_FILE 256 #define ALSA_USE_CASE_DIR ALSA_CONFIG_DIR "/ucm" -#define SEQUENCE_ELEMENT_TYPE_CSET 1 -#define SEQUENCE_ELEMENT_TYPE_SLEEP 2 -#define SEQUENCE_ELEMENT_TYPE_EXEC 3 +#define SEQUENCE_ELEMENT_TYPE_CDEV 1 +#define SEQUENCE_ELEMENT_TYPE_CSET 2 +#define SEQUENCE_ELEMENT_TYPE_SLEEP 3 +#define SEQUENCE_ELEMENT_TYPE_EXEC 4 struct ucm_value { struct list_head list; @@ -57,6 +58,7 @@ struct sequence_element { unsigned int type; union { long sleep; /* Sleep time in msecs if sleep element, else 0 */ + char *cdev; char *cset; char *exec; } data; |