mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
Added ctl_elem_lock and unlock code...
This commit is contained in:
parent
192d3c9226
commit
12a47782cb
4 changed files with 74 additions and 0 deletions
|
|
@ -207,6 +207,34 @@ static int snd_ctl_shm_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *control)
|
|||
return err;
|
||||
}
|
||||
|
||||
static int snd_ctl_shm_elem_lock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id)
|
||||
{
|
||||
snd_ctl_shm_t *shm = ctl->private_data;
|
||||
volatile snd_ctl_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
ctrl->u.element_lock = *id;
|
||||
ctrl->cmd = SNDRV_CTL_IOCTL_ELEM_LOCK;
|
||||
err = snd_ctl_shm_action(ctl);
|
||||
if (err < 0)
|
||||
return err;
|
||||
*id = ctrl->u.element_lock;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int snd_ctl_shm_elem_unlock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id)
|
||||
{
|
||||
snd_ctl_shm_t *shm = ctl->private_data;
|
||||
volatile snd_ctl_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
ctrl->u.element_unlock = *id;
|
||||
ctrl->cmd = SNDRV_CTL_IOCTL_ELEM_UNLOCK;
|
||||
err = snd_ctl_shm_action(ctl);
|
||||
if (err < 0)
|
||||
return err;
|
||||
*id = ctrl->u.element_unlock;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int snd_ctl_shm_hwdep_next_device(snd_ctl_t *ctl, int * device)
|
||||
{
|
||||
snd_ctl_shm_t *shm = ctl->private_data;
|
||||
|
|
@ -362,6 +390,8 @@ snd_ctl_ops_t snd_ctl_shm_ops = {
|
|||
element_info: snd_ctl_shm_elem_info,
|
||||
element_read: snd_ctl_shm_elem_read,
|
||||
element_write: snd_ctl_shm_elem_write,
|
||||
element_lock: snd_ctl_shm_elem_lock,
|
||||
element_unlock: snd_ctl_shm_elem_unlock,
|
||||
hwdep_next_device: snd_ctl_shm_hwdep_next_device,
|
||||
hwdep_info: snd_ctl_shm_hwdep_info,
|
||||
pcm_next_device: snd_ctl_shm_pcm_next_device,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue