mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
topology: decode: Add enum control texts as separate element
Texts are separate sections that should referenced by enum control. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
11d4a5aa72
commit
f1435207a2
1 changed files with 11 additions and 3 deletions
|
|
@ -1088,11 +1088,19 @@ int tplg_add_enum(snd_tplg_t *tplg, struct snd_tplg_enum_template *enum_ctl,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enum_ctl->texts != NULL) {
|
if (enum_ctl->texts != NULL) {
|
||||||
|
struct tplg_elem *texts = tplg_elem_new_common(tplg, NULL,
|
||||||
|
enum_ctl->hdr.name, SND_TPLG_TYPE_TEXT);
|
||||||
|
|
||||||
|
texts->texts->num_items = num_items;
|
||||||
for (i = 0; i < num_items; i++) {
|
for (i = 0; i < num_items; i++) {
|
||||||
if (enum_ctl->texts[i] != NULL)
|
if (!enum_ctl->texts[i])
|
||||||
snd_strlcpy(ec->texts[i], enum_ctl->texts[i],
|
continue;
|
||||||
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
|
snd_strlcpy(ec->texts[i], enum_ctl->texts[i],
|
||||||
|
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
|
||||||
|
snd_strlcpy(texts->texts->items[i], enum_ctl->texts[i],
|
||||||
|
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
|
||||||
}
|
}
|
||||||
|
tplg_ref_add(elem, SND_TPLG_TYPE_TEXT, enum_ctl->hdr.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enum_ctl->values != NULL) {
|
if (enum_ctl->values != NULL) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue