Path: blob/master/thirdparty/linuxbsd_headers/alsa/mixer_abst.h
9898 views
/**1* \file include/mixer_abst.h2* \brief Mixer abstract implementation interface library for the ALSA library3* \author Jaroslav Kysela <[email protected]>4* \date 20055*6* Mixer abstact implementation interface library for the ALSA library7*/8/*9* This library is free software; you can redistribute it and/or modify10* it under the terms of the GNU Lesser General Public License as11* published by the Free Software Foundation; either version 2.1 of12* the License, or (at your option) any later version.13*14* This program is distributed in the hope that it will be useful,15* but WITHOUT ANY WARRANTY; without even the implied warranty of16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17* GNU Lesser General Public License for more details.18*19* You should have received a copy of the GNU Lesser General Public20* License along with this library; if not, write to the Free Software21* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA22*23*/2425#ifndef __ALSA_MIXER_ABST_H26#define __ALSA_MIXER_ABST_H2728#ifdef __cplusplus29extern "C" {30#endif3132/**33* \defgroup Mixer_Abstract Mixer Abstact Module Interface34* The mixer abstact module interface.35* \{36*/3738#define SM_PLAY 039#define SM_CAPT 14041#define SM_CAP_GVOLUME (1<<1)42#define SM_CAP_GSWITCH (1<<2)43#define SM_CAP_PVOLUME (1<<3)44#define SM_CAP_PVOLUME_JOIN (1<<4)45#define SM_CAP_PSWITCH (1<<5)46#define SM_CAP_PSWITCH_JOIN (1<<6)47#define SM_CAP_CVOLUME (1<<7)48#define SM_CAP_CVOLUME_JOIN (1<<8)49#define SM_CAP_CSWITCH (1<<9)50#define SM_CAP_CSWITCH_JOIN (1<<10)51#define SM_CAP_CSWITCH_EXCL (1<<11)52#define SM_CAP_PENUM (1<<12)53#define SM_CAP_CENUM (1<<13)54/* SM_CAP_* 24-31 => private for module use */5556#define SM_OPS_IS_ACTIVE 057#define SM_OPS_IS_MONO 158#define SM_OPS_IS_CHANNEL 259#define SM_OPS_IS_ENUMERATED 360#define SM_OPS_IS_ENUMCNT 46162#define sm_selem(x) ((sm_selem_t *)((x)->private_data))63#define sm_selem_ops(x) ((sm_selem_t *)((x)->private_data))->ops6465typedef struct _sm_selem {66snd_mixer_selem_id_t *id;67struct sm_elem_ops *ops;68unsigned int caps;69unsigned int capture_group;70} sm_selem_t;7172typedef struct _sm_class_basic {73char *device;74snd_ctl_t *ctl;75snd_hctl_t *hctl;76snd_ctl_card_info_t *info;77} sm_class_basic_t;7879struct sm_elem_ops {80int (*is)(snd_mixer_elem_t *elem, int dir, int cmd, int val);81int (*get_range)(snd_mixer_elem_t *elem, int dir, long *min, long *max);82int (*set_range)(snd_mixer_elem_t *elem, int dir, long min, long max);83int (*get_dB_range)(snd_mixer_elem_t *elem, int dir, long *min, long *max);84int (*ask_vol_dB)(snd_mixer_elem_t *elem, int dir, long value, long *dbValue);85int (*ask_dB_vol)(snd_mixer_elem_t *elem, int dir, long dbValue, long *value, int xdir);86int (*get_volume)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long *value);87int (*get_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long *value);88int (*set_volume)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value);89int (*set_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value, int xdir);90int (*get_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int *value);91int (*set_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int value);92int (*enum_item_name)(snd_mixer_elem_t *elem, unsigned int item, size_t maxlen, char *buf);93int (*get_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *itemp);94int (*set_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int item);95};9697int snd_mixer_selem_compare(const snd_mixer_elem_t *c1, const snd_mixer_elem_t *c2);9899int snd_mixer_sbasic_info(const snd_mixer_class_t *class, sm_class_basic_t *info);100void *snd_mixer_sbasic_get_private(const snd_mixer_class_t *class);101void snd_mixer_sbasic_set_private(const snd_mixer_class_t *class, void *private_data);102void snd_mixer_sbasic_set_private_free(const snd_mixer_class_t *class, void (*private_free)(snd_mixer_class_t *class));103104/** \} */105106#ifdef __cplusplus107}108#endif109110#endif /* __ALSA_MIXER_ABST_H */111112113114