|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
Get the number of elements in the mixer and their element IDs
#include <sys/asoundlib.h> int snd_mixer_elements( snd_mixer_t *handle, snd_mixer_elements_t *elements );
- The handle for the mixer device. This must have been created by snd_mixer_open().
- A pointer to a snd_mixer_elements_t structure in which snd_mixer_elements() stores the information about the elements.
The snd_mixer_elements() function fills the given snd_mixer_elements_t structure with the number of elements in the mixer that the handle was opened on. It also fills in the array of element IDs pointed to by pelements to a limit of elements_size.
|We recommend that you work with mixer groups instead of manipulating the elements directly.|
Before calling snd_mixer_elements(), set the snd_mixer_elements_t structure as follows:
- This pointer be NULL, or point to a valid storage location for the elements (i.e. an array of snd_mixer_eid_t structures).
- This must reflect the size of the pelements storage location, in sizeof( snd_mixer_eid_t ) units (i.e. elements_size must be the number of entries in the pelements array).
On a successful return, snd_mixer_elements() sets these members:
- The total number of elements in the mixer.
- If non-NULL, the mixer element IDs are filled in.
- The number of elements that couldn't be copied to the storage location.
Zero on success, or a negative value on error.
- Invalid handle.