mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
more simple mixer - basic abstraction - work
- midlayer cleanups and simplification - probably broke the "none" abstraction code somehow (not intensively tested midlayer changes) - trying to implement ac97 module - far from finished - common code should be moved to alsa-lib as core for other modules - perhaps simple_abst.c can be based on this common code, too
This commit is contained in:
parent
3656a66397
commit
ce67d5389b
8 changed files with 856 additions and 298 deletions
|
|
@ -99,7 +99,9 @@ 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);
|
||||
int snd_mixer_attach(snd_mixer_t *mixer, const char *name);
|
||||
int snd_mixer_attach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl);
|
||||
int snd_mixer_detach(snd_mixer_t *mixer, const char *name);
|
||||
int snd_mixer_detach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl);
|
||||
int snd_mixer_get_hctl(snd_mixer_t *mixer, const char *name, snd_hctl_t **hctl);
|
||||
int snd_mixer_poll_descriptors_count(snd_mixer_t *mixer);
|
||||
int snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int space);
|
||||
|
|
@ -266,18 +268,18 @@ 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_get_playback_dB_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,
|
||||
int snd_mixer_selem_get_playback_volume_range(snd_mixer_elem_t *elem,
|
||||
long *min, long *max);
|
||||
void snd_mixer_selem_get_capture_dB_range(snd_mixer_elem_t *elem,
|
||||
int snd_mixer_selem_get_playback_dB_range(snd_mixer_elem_t *elem,
|
||||
long *min, long *max);
|
||||
void snd_mixer_selem_set_capture_volume_range(snd_mixer_elem_t *elem,
|
||||
int snd_mixer_selem_set_playback_volume_range(snd_mixer_elem_t *elem,
|
||||
long min, long max);
|
||||
int snd_mixer_selem_get_capture_volume_range(snd_mixer_elem_t *elem,
|
||||
long *min, long *max);
|
||||
int snd_mixer_selem_get_capture_dB_range(snd_mixer_elem_t *elem,
|
||||
long *min, long *max);
|
||||
int snd_mixer_selem_set_capture_volume_range(snd_mixer_elem_t *elem,
|
||||
long min, long max);
|
||||
|
||||
int snd_mixer_selem_is_enumerated(snd_mixer_elem_t *elem);
|
||||
int snd_mixer_selem_get_enum_items(snd_mixer_elem_t *elem);
|
||||
|
|
|
|||
|
|
@ -69,6 +69,13 @@ typedef struct _sm_selem {
|
|||
unsigned int capture_group;
|
||||
} sm_selem_t;
|
||||
|
||||
typedef struct _sm_class_basic {
|
||||
char *device;
|
||||
snd_ctl_t *ctl;
|
||||
snd_hctl_t *hctl;
|
||||
snd_ctl_card_info_t *info;
|
||||
} sm_class_basic_t;
|
||||
|
||||
struct sm_elem_ops {
|
||||
int (*is)(snd_mixer_elem_t *elem, int dir, int cmd, int val);
|
||||
int (*get_range)(snd_mixer_elem_t *elem, int dir, long *min, long *max);
|
||||
|
|
@ -78,11 +85,8 @@ struct sm_elem_ops {
|
|||
int (*get_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long *value);
|
||||
int (*set_volume)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value);
|
||||
int (*set_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value, int xdir);
|
||||
int (*set_volume_all)(snd_mixer_elem_t *elem, int dir, long value);
|
||||
int (*set_dB_all)(snd_mixer_elem_t *elem, int dir, long value, int xdir);
|
||||
int (*get_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int *value);
|
||||
int (*set_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int value);
|
||||
int (*set_switch_all)(snd_mixer_elem_t *elem, int dir, int value);
|
||||
int (*enum_item_name)(snd_mixer_elem_t *elem, unsigned int item, size_t maxlen, char *buf);
|
||||
int (*get_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *itemp);
|
||||
int (*set_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int item);
|
||||
|
|
@ -90,6 +94,8 @@ struct sm_elem_ops {
|
|||
|
||||
int snd_mixer_selem_compare(const snd_mixer_elem_t *c1, const snd_mixer_elem_t *c2);
|
||||
|
||||
int snd_mixer_sbasic_info(const snd_mixer_class_t *class, sm_class_basic_t *info);
|
||||
|
||||
/** \} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue