1998-08-13 15:42:56 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* mixer.h *
|
|
|
|
* Mixer Interface *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
|
2000-11-20 20:10:46 +00:00
|
|
|
typedef struct _snd_mixer snd_mixer_t;
|
2001-02-11 15:45:35 +00:00
|
|
|
typedef struct _snd_mixer_class snd_mixer_class_t;
|
2001-02-09 11:20:31 +00:00
|
|
|
typedef struct _snd_mixer_info snd_mixer_info_t;
|
|
|
|
typedef struct _snd_mixer_elem snd_mixer_elem_t;
|
|
|
|
typedef int (*snd_mixer_callback_t)(snd_mixer_t *ctl,
|
2001-02-13 21:29:30 +00:00
|
|
|
unsigned int mask,
|
2001-02-09 11:20:31 +00:00
|
|
|
snd_mixer_elem_t *elem);
|
|
|
|
typedef int (*snd_mixer_elem_callback_t)(snd_mixer_elem_t *elem,
|
2001-02-13 21:29:30 +00:00
|
|
|
unsigned int mask);
|
2001-02-11 15:45:35 +00:00
|
|
|
typedef int (*snd_mixer_compare_t)(const snd_mixer_elem_t *e1,
|
|
|
|
const snd_mixer_elem_t *e2);
|
2001-02-09 11:20:31 +00:00
|
|
|
|
|
|
|
enum _snd_mixer_elem_type {
|
|
|
|
SND_MIXER_ELEM_SIMPLE,
|
|
|
|
SND_MIXER_ELEM_LAST = SND_MIXER_ELEM_SIMPLE,
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef SND_ENUM_TYPECHECK
|
|
|
|
typedef struct __snd_mixer_elem_type *snd_mixer_elem_type_t;
|
|
|
|
#else
|
|
|
|
typedef enum _snd_mixer_elem_type snd_mixer_elem_type_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define SND_MIXER_ELEM_SIMPLE ((snd_mixer_elem_type_t) SND_MIXER_ELEM_SIMPLE)
|
|
|
|
#define SND_MIXER_ELEM_LAST ((snd_mixer_elem_type_t) SND_MIXER_ELEM_LAST)
|
|
|
|
|
2000-01-18 08:45:02 +00:00
|
|
|
|
1998-08-13 15:42:56 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2001-03-26 12:45:48 +00:00
|
|
|
int snd_mixer_open(snd_mixer_t **mixer, int mode);
|
2001-02-09 11:20:31 +00:00
|
|
|
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);
|
2001-02-11 15:45:35 +00:00
|
|
|
int snd_mixer_handle_events(snd_mixer_t *mixer);
|
|
|
|
int snd_mixer_attach(snd_mixer_t *mixer, const char *name);
|
|
|
|
int snd_mixer_detach(snd_mixer_t *mixer, const char *name);
|
2001-02-18 18:32:30 +00:00
|
|
|
int snd_mixer_poll_descriptors_count(snd_mixer_t *mixer);
|
2001-02-12 23:51:49 +00:00
|
|
|
int snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int space);
|
2001-02-11 15:45:35 +00:00
|
|
|
int snd_mixer_load(snd_mixer_t *mixer);
|
2001-02-12 23:51:49 +00:00
|
|
|
int snd_mixer_wait(snd_mixer_t *mixer, int timeout);
|
2001-02-12 13:29:33 +00:00
|
|
|
int snd_mixer_set_compare(snd_mixer_t *mixer, snd_mixer_compare_t msort);
|
2001-02-11 15:45:35 +00:00
|
|
|
|
2001-02-09 11:20:31 +00:00
|
|
|
snd_mixer_elem_t *snd_mixer_elem_next(snd_mixer_elem_t *elem);
|
2001-02-13 14:07:28 +00:00
|
|
|
snd_mixer_elem_t *snd_mixer_elem_prev(snd_mixer_elem_t *elem);
|
2001-02-11 15:45:35 +00:00
|
|
|
|
|
|
|
int snd_mixer_class_unregister(snd_mixer_class_t *clss);
|
2000-07-15 10:20:32 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Simple (legacy) mixer API
|
|
|
|
*/
|
|
|
|
|
2001-02-11 15:45:35 +00:00
|
|
|
enum _snd_mixer_selem_channel_id {
|
|
|
|
SND_MIXER_SCHN_UNKNOWN = -1,
|
|
|
|
SND_MIXER_SCHN_FRONT_LEFT = 0,
|
|
|
|
SND_MIXER_SCHN_FRONT_RIGHT,
|
|
|
|
SND_MIXER_SCHN_FRONT_CENTER,
|
|
|
|
SND_MIXER_SCHN_REAR_LEFT,
|
|
|
|
SND_MIXER_SCHN_REAR_RIGHT,
|
|
|
|
SND_MIXER_SCHN_WOOFER,
|
|
|
|
SND_MIXER_SCHN_LAST = 31,
|
|
|
|
SND_MIXER_SCHN_MONO = SND_MIXER_SCHN_FRONT_LEFT
|
2001-02-05 15:44:42 +00:00
|
|
|
};
|
|
|
|
|
2001-02-09 11:20:31 +00:00
|
|
|
/* Simple mixer */
|
|
|
|
|
|
|
|
typedef struct _snd_mixer_selem_id snd_mixer_selem_id_t;
|
|
|
|
|
2001-02-05 15:44:42 +00:00
|
|
|
#ifdef SND_ENUM_TYPECHECK
|
2001-02-11 15:45:35 +00:00
|
|
|
typedef struct __snd_mixer_selem_channel_id *snd_mixer_selem_channel_id_t;
|
2001-02-05 15:44:42 +00:00
|
|
|
#else
|
2001-02-11 15:45:35 +00:00
|
|
|
typedef enum _snd_mixer_selem_channel_id snd_mixer_selem_channel_id_t;
|
2001-02-05 15:44:42 +00:00
|
|
|
#endif
|
|
|
|
|
2001-02-11 15:45:35 +00:00
|
|
|
#define SND_MIXER_SCHN_UNKNOWN ((snd_mixer_selem_channel_id_t) SND_MIXER_SCHN_UNKNOWN)
|
|
|
|
#define SND_MIXER_SCHN_FRONT_LEFT ((snd_mixer_selem_channel_id_t) SND_MIXER_SCHN_FRONT_LEFT)
|
|
|
|
#define SND_MIXER_SCHN_FRONT_RIGHT ((snd_mixer_selem_channel_id_t) SND_MIXER_SCHN_FRONT_RIGHT)
|
|
|
|
#define SND_MIXER_SCHN_FRONT_CENTER ((snd_mixer_selem_channel_id_t) SND_MIXER_SCHN_FRONT_CENTER)
|
|
|
|
#define SND_MIXER_SCHN_REAR_LEFT ((snd_mixer_selem_channel_id_t) SND_MIXER_SCHN_REAR_LEFT)
|
|
|
|
#define SND_MIXER_SCHN_REAR_RIGHT ((snd_mixer_selem_channel_id_t) SND_MIXER_SCHN_REAR_RIGHT)
|
|
|
|
#define SND_MIXER_SCHN_WOOFER ((snd_mixer_selem_channel_id_t) SND_MIXER_SCHN_WOOFER)
|
|
|
|
#define SND_MIXER_SCHN_LAST ((snd_mixer_selem_channel_id_t) SND_MIXER_SCHN_LAST)
|
|
|
|
#define SND_MIXER_SCHN_MONO ((snd_mixer_selem_channel_id_t) SND_MIXER_SCHN_MONO)
|
2001-02-05 15:44:42 +00:00
|
|
|
|
2000-07-15 10:20:32 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2001-02-11 15:45:35 +00:00
|
|
|
const char *snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel);
|
|
|
|
|
2001-02-15 23:05:41 +00:00
|
|
|
int snd_mixer_selem_register(snd_mixer_t *mixer, void *arg,
|
|
|
|
snd_mixer_class_t **classp);
|
2001-02-09 11:20:31 +00:00
|
|
|
void snd_mixer_selem_get_id(snd_mixer_elem_t *element,
|
|
|
|
snd_mixer_selem_id_t *id);
|
2001-02-18 17:56:37 +00:00
|
|
|
const char *snd_mixer_selem_get_name(snd_mixer_elem_t *elem);
|
|
|
|
unsigned int snd_mixer_selem_get_index(snd_mixer_elem_t *elem);
|
2001-02-11 15:45:35 +00:00
|
|
|
snd_mixer_elem_t *snd_mixer_find_selem(snd_mixer_t *mixer,
|
|
|
|
const snd_mixer_selem_id_t *id);
|
2001-02-15 23:05:41 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
int snd_mixer_selem_has_playback_volume_joined(snd_mixer_elem_t *elem);
|
|
|
|
int snd_mixer_selem_has_capture_volume(snd_mixer_elem_t *elem);
|
|
|
|
int snd_mixer_selem_has_capture_volume_joined(snd_mixer_elem_t *elem);
|
|
|
|
int snd_mixer_selem_has_common_switch(snd_mixer_elem_t *elem);
|
|
|
|
int snd_mixer_selem_has_playback_switch(snd_mixer_elem_t *elem);
|
|
|
|
int snd_mixer_selem_has_playback_switch_joined(snd_mixer_elem_t *elem);
|
|
|
|
int snd_mixer_selem_has_capture_switch(snd_mixer_elem_t *elem);
|
|
|
|
int snd_mixer_selem_has_capture_switch_joined(snd_mixer_elem_t *elem);
|
|
|
|
int snd_mixer_selem_has_capture_switch_exclusive(snd_mixer_elem_t *elem);
|
|
|
|
|
|
|
|
int snd_mixer_selem_get_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
|
|
|
|
int snd_mixer_selem_get_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
|
|
|
|
int snd_mixer_selem_get_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value);
|
|
|
|
int snd_mixer_selem_get_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value);
|
|
|
|
int snd_mixer_selem_set_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value);
|
|
|
|
int snd_mixer_selem_set_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value);
|
|
|
|
int snd_mixer_selem_set_playback_volume_all(snd_mixer_elem_t *elem, long value);
|
|
|
|
int snd_mixer_selem_set_capture_volume_all(snd_mixer_elem_t *elem, long value);
|
|
|
|
int snd_mixer_selem_set_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value);
|
|
|
|
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);
|
2001-02-18 17:56:37 +00:00
|
|
|
void snd_mixer_selem_set_playback_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);
|
1998-08-13 15:42:56 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|