mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
More documentation. Tiny change for simple mixer element API (get_range)
This commit is contained in:
parent
5b50ec848a
commit
b4ac62f3dd
12 changed files with 1526 additions and 1092 deletions
|
|
@ -5,19 +5,45 @@
|
|||
* *
|
||||
****************************************************************************/
|
||||
|
||||
/** Mixer handle */
|
||||
typedef struct _snd_mixer snd_mixer_t;
|
||||
/** Mixer elements class handle */
|
||||
typedef struct _snd_mixer_class snd_mixer_class_t;
|
||||
typedef struct _snd_mixer_info snd_mixer_info_t;
|
||||
/** Mixer element handle */
|
||||
typedef struct _snd_mixer_elem snd_mixer_elem_t;
|
||||
|
||||
/**
|
||||
* \brief Mixer callback function
|
||||
* \param mixer Mixer handle
|
||||
* \param mask event mask
|
||||
* \param elem related mixer element (if any)
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
typedef int (*snd_mixer_callback_t)(snd_mixer_t *ctl,
|
||||
unsigned int mask,
|
||||
snd_mixer_elem_t *elem);
|
||||
|
||||
/**
|
||||
* \brief Mixer element callback function
|
||||
* \param elem Mixer element
|
||||
* \param mask event mask
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
typedef int (*snd_mixer_elem_callback_t)(snd_mixer_elem_t *elem,
|
||||
unsigned int mask);
|
||||
|
||||
/**
|
||||
* \brief Compare function for sorting mixer elements
|
||||
* \param e1 First element
|
||||
* \param e2 Second element
|
||||
* \return -1 if e1 < e2, 0 if e1 == e2, 1 if e1 > e2
|
||||
*/
|
||||
typedef int (*snd_mixer_compare_t)(const snd_mixer_elem_t *e1,
|
||||
const snd_mixer_elem_t *e2);
|
||||
|
||||
/** Mixer element type */
|
||||
typedef enum _snd_mixer_elem_type {
|
||||
/* Simple (legacy) mixer elements */
|
||||
SND_MIXER_ELEM_SIMPLE,
|
||||
SND_MIXER_ELEM_LAST = SND_MIXER_ELEM_SIMPLE,
|
||||
} snd_mixer_elem_type_t;
|
||||
|
|
@ -28,7 +54,6 @@ extern "C" {
|
|||
|
||||
int snd_mixer_open(snd_mixer_t **mixer, int mode);
|
||||
int snd_mixer_close(snd_mixer_t *mixer);
|
||||
int snd_mixer_info(snd_mixer_t *mixer, snd_mixer_info_t *info);
|
||||
snd_mixer_elem_t *snd_mixer_first_elem(snd_mixer_t *mixer);
|
||||
snd_mixer_elem_t *snd_mixer_last_elem(snd_mixer_t *mixer);
|
||||
int snd_mixer_handle_events(snd_mixer_t *mixer);
|
||||
|
|
@ -50,24 +75,30 @@ int snd_mixer_class_unregister(snd_mixer_class_t *clss);
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simple (legacy) mixer API
|
||||
*/
|
||||
/* Simple (legacy) mixer elements API */
|
||||
|
||||
/** Mixer simple element channel identificator */
|
||||
typedef enum _snd_mixer_selem_channel_id {
|
||||
/** Unknown */
|
||||
SND_MIXER_SCHN_UNKNOWN = -1,
|
||||
/** Front left */
|
||||
SND_MIXER_SCHN_FRONT_LEFT = 0,
|
||||
/** Front right */
|
||||
SND_MIXER_SCHN_FRONT_RIGHT,
|
||||
/** Front center */
|
||||
SND_MIXER_SCHN_FRONT_CENTER,
|
||||
/** Rear left */
|
||||
SND_MIXER_SCHN_REAR_LEFT,
|
||||
/** Rear right */
|
||||
SND_MIXER_SCHN_REAR_RIGHT,
|
||||
/** Woofer */
|
||||
SND_MIXER_SCHN_WOOFER,
|
||||
SND_MIXER_SCHN_LAST = 31,
|
||||
/** Mono (Front left alias) */
|
||||
SND_MIXER_SCHN_MONO = SND_MIXER_SCHN_FRONT_LEFT
|
||||
} snd_mixer_selem_channel_id_t;
|
||||
|
||||
/* Simple mixer */
|
||||
|
||||
/** Mixer simple element identificator */
|
||||
typedef struct _snd_mixer_selem_id snd_mixer_selem_id_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
@ -87,12 +118,8 @@ snd_mixer_elem_t *snd_mixer_find_selem(snd_mixer_t *mixer,
|
|||
|
||||
int snd_mixer_selem_is_playback_mono(snd_mixer_elem_t *elem);
|
||||
int snd_mixer_selem_has_playback_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel);
|
||||
int snd_mixer_selem_get_playback_min(snd_mixer_elem_t *elem);
|
||||
int snd_mixer_selem_get_playback_max(snd_mixer_elem_t *elem);
|
||||
int snd_mixer_selem_is_capture_mono(snd_mixer_elem_t *elem);
|
||||
int snd_mixer_selem_has_capture_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel);
|
||||
int snd_mixer_selem_get_capture_min(snd_mixer_elem_t *elem);
|
||||
int snd_mixer_selem_get_capture_max(snd_mixer_elem_t *elem);
|
||||
int snd_mixer_selem_get_capture_group(snd_mixer_elem_t *elem);
|
||||
int snd_mixer_selem_has_common_volume(snd_mixer_elem_t *elem);
|
||||
int snd_mixer_selem_has_playback_volume(snd_mixer_elem_t *elem);
|
||||
|
|
@ -118,10 +145,50 @@ int snd_mixer_selem_set_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_
|
|||
int snd_mixer_selem_set_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value);
|
||||
int snd_mixer_selem_set_playback_switch_all(snd_mixer_elem_t *elem, int value);
|
||||
int snd_mixer_selem_set_capture_switch_all(snd_mixer_elem_t *elem, int value);
|
||||
void snd_mixer_selem_get_playback_volume_range(snd_mixer_elem_t *elem,
|
||||
long *min, long *max);
|
||||
void snd_mixer_selem_set_playback_volume_range(snd_mixer_elem_t *elem,
|
||||
long min, long max);
|
||||
void snd_mixer_selem_get_capture_volume_range(snd_mixer_elem_t *elem,
|
||||
long *min, long *max);
|
||||
void snd_mixer_selem_set_capture_volume_range(snd_mixer_elem_t *elem,
|
||||
long min, long max);
|
||||
|
||||
size_t snd_mixer_selem_id_sizeof(void);
|
||||
/** \hideinitializer
|
||||
* \brief allocate an invalid #snd_mixer_selem_id_t using standard alloca
|
||||
* \param ptr returned pointer
|
||||
*/
|
||||
#define snd_mixer_selem_id_alloca(ptr) do { assert(ptr); *ptr = (snd_mixer_selem_id_t *) alloca(snd_mixer_selem_id_sizeof()); memset(*ptr, 0, snd_mixer_selem_id_sizeof()); } while (0)
|
||||
int snd_mixer_selem_id_malloc(snd_mixer_selem_id_t **ptr);
|
||||
void snd_mixer_selem_id_free(snd_mixer_selem_id_t *obj);
|
||||
void snd_mixer_selem_id_copy(snd_mixer_selem_id_t *dst, const snd_mixer_selem_id_t *src);
|
||||
|
||||
const char *snd_mixer_selem_id_get_name(const snd_mixer_selem_id_t *obj);
|
||||
|
||||
unsigned int snd_mixer_selem_id_get_index(const snd_mixer_selem_id_t *obj);
|
||||
|
||||
void snd_mixer_selem_id_set_name(snd_mixer_selem_id_t *obj, const char *val);
|
||||
|
||||
void snd_mixer_selem_id_set_index(snd_mixer_selem_id_t *obj, unsigned int val);
|
||||
|
||||
void snd_mixer_set_callback(snd_mixer_t *obj, snd_mixer_callback_t val);
|
||||
|
||||
void * snd_mixer_get_callback_private(const snd_mixer_t *obj);
|
||||
|
||||
void snd_mixer_set_callback_private(snd_mixer_t *obj, void * val);
|
||||
|
||||
unsigned int snd_mixer_get_count(const snd_mixer_t *obj);
|
||||
|
||||
void snd_mixer_elem_set_callback(snd_mixer_elem_t *obj, snd_mixer_elem_callback_t val);
|
||||
|
||||
void * snd_mixer_elem_get_callback_private(const snd_mixer_elem_t *obj);
|
||||
|
||||
void snd_mixer_elem_set_callback_private(snd_mixer_elem_t *obj, void * val);
|
||||
|
||||
snd_mixer_elem_type_t snd_mixer_elem_get_type(const snd_mixer_elem_t *obj);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue