mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
ctl: support extra information to user-defined element set
In ALSA control feature, information of an element includes extra fields to type-specific parameters; i.e. dimension. The fields can be extended in future. Meanwhile, current APIs to add user-defined element set can not support such an extended fields. This may cause inconveniences in future. This commit supports the fields, by changing APIs for element set. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
7117d22cf2
commit
f9e6011255
3 changed files with 92 additions and 113 deletions
|
|
@ -663,18 +663,18 @@ static int add_tlv_info(snd_pcm_softvol_t *svol, snd_ctl_elem_info_t *cinfo)
|
|||
return snd_ctl_elem_tlv_write(svol->ctl, &cinfo->id, tlv);
|
||||
}
|
||||
|
||||
static int add_user_ctl(snd_pcm_softvol_t *svol, snd_ctl_elem_info_t *cinfo, int count)
|
||||
static int add_user_ctl(snd_pcm_softvol_t *svol, snd_ctl_elem_info_t *cinfo,
|
||||
int count)
|
||||
{
|
||||
int err;
|
||||
int i;
|
||||
unsigned int def_val;
|
||||
|
||||
if (svol->max_val == 1)
|
||||
err = snd_ctl_elem_add_boolean_set(svol->ctl, &cinfo->id, 1,
|
||||
count);
|
||||
err = snd_ctl_elem_add_boolean_set(svol->ctl, cinfo, 1, count);
|
||||
else
|
||||
err = snd_ctl_elem_add_integer_set(svol->ctl, &cinfo->id, 1,
|
||||
count, 0, svol->max_val, 0);
|
||||
err = snd_ctl_elem_add_integer_set(svol->ctl, cinfo, 1, count,
|
||||
0, svol->max_val, 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (svol->max_val == 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue