mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Control API - add TLV support
snd_ctl_elem_tlv_read snd_ctl_elem_tlv_write snd_ctl_elem_tlv_command snd_ctl_elem_info_is_tlv_readable snd_ctl_elem_info_is_tlv_writable snd_ctl_elem_info_is_tlv_commandable snd_hctl_elem_tlv_read snd_hctl_elem_tlv_write snd_hctl_elem_tlv_command
This commit is contained in:
parent
408697bfe2
commit
c7a0708a23
7 changed files with 248 additions and 4 deletions
|
|
@ -821,7 +821,9 @@ int snd_hctl_elem_read(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value)
|
|||
* \brief Set value for an HCTL element
|
||||
* \param elem HCTL element
|
||||
* \param value HCTL element value
|
||||
* \return 0 otherwise a negative error code on failure
|
||||
* \retval 0 on success
|
||||
* \ratval >1 on success when value was changed
|
||||
* \retval <0 a negative error code on failure
|
||||
*/
|
||||
int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value)
|
||||
{
|
||||
|
|
@ -832,6 +834,53 @@ int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value)
|
|||
return snd_ctl_elem_write(elem->hctl->ctl, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get TLV value for an HCTL element
|
||||
* \param elem HCTL element
|
||||
* \param tlv TLV array for value
|
||||
* \param tlv_size size of TLV array in bytes
|
||||
* \return 0 otherwise a negative error code on failure
|
||||
*/
|
||||
int snd_hctl_elem_tlv_read(snd_hctl_elem_t *elem, unsigned int *tlv, unsigned int tlv_size)
|
||||
{
|
||||
assert(elem);
|
||||
assert(tlv);
|
||||
assert(tlv_size >= 12);
|
||||
return snd_ctl_elem_tlv_read(elem->hctl->ctl, &elem->id, tlv, tlv_size);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set TLV value for an HCTL element
|
||||
* \param elem HCTL element
|
||||
* \param tlv TLV array for value
|
||||
* \retval 0 on success
|
||||
* \ratval >1 on success when value was changed
|
||||
* \retval <0 a negative error code on failure
|
||||
*/
|
||||
int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv)
|
||||
{
|
||||
assert(elem);
|
||||
assert(tlv);
|
||||
assert(tlv[1] >= 4);
|
||||
return snd_ctl_elem_tlv_write(elem->hctl->ctl, &elem->id, tlv);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set TLV value for an HCTL element
|
||||
* \param elem HCTL element
|
||||
* \param tlv TLV array for value
|
||||
* \retval 0 on success
|
||||
* \ratval >1 on success when value was changed
|
||||
* \retval <0 a negative error code on failure
|
||||
*/
|
||||
int snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv)
|
||||
{
|
||||
assert(elem);
|
||||
assert(tlv);
|
||||
assert(tlv[1] >= 4);
|
||||
return snd_ctl_elem_tlv_command(elem->hctl->ctl, &elem->id, tlv);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get HCTL handle for an HCTL element
|
||||
* \param elem HCTL element
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue