jpayne@69
|
1 /**
|
jpayne@69
|
2 * \file include/mixer_abst.h
|
jpayne@69
|
3 * \brief Mixer abstract implementation interface library for the ALSA library
|
jpayne@69
|
4 * \author Jaroslav Kysela <perex@perex.cz>
|
jpayne@69
|
5 * \date 2005
|
jpayne@69
|
6 *
|
jpayne@69
|
7 * Mixer abstact implementation interface library for the ALSA library
|
jpayne@69
|
8 */
|
jpayne@69
|
9 /*
|
jpayne@69
|
10 * This library is free software; you can redistribute it and/or modify
|
jpayne@69
|
11 * it under the terms of the GNU Lesser General Public License as
|
jpayne@69
|
12 * published by the Free Software Foundation; either version 2.1 of
|
jpayne@69
|
13 * the License, or (at your option) any later version.
|
jpayne@69
|
14 *
|
jpayne@69
|
15 * This program is distributed in the hope that it will be useful,
|
jpayne@69
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
jpayne@69
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
jpayne@69
|
18 * GNU Lesser General Public License for more details.
|
jpayne@69
|
19 *
|
jpayne@69
|
20 * You should have received a copy of the GNU Lesser General Public
|
jpayne@69
|
21 * License along with this library; if not, write to the Free Software
|
jpayne@69
|
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
jpayne@69
|
23 *
|
jpayne@69
|
24 */
|
jpayne@69
|
25
|
jpayne@69
|
26 #ifndef __ALSA_MIXER_ABST_H
|
jpayne@69
|
27 #define __ALSA_MIXER_ABST_H
|
jpayne@69
|
28
|
jpayne@69
|
29 #ifdef __cplusplus
|
jpayne@69
|
30 extern "C" {
|
jpayne@69
|
31 #endif
|
jpayne@69
|
32
|
jpayne@69
|
33 /**
|
jpayne@69
|
34 * \defgroup Mixer_Abstract Mixer Abstact Module Interface
|
jpayne@69
|
35 * The mixer abstact module interface.
|
jpayne@69
|
36 * \{
|
jpayne@69
|
37 */
|
jpayne@69
|
38
|
jpayne@69
|
39 #define SM_PLAY 0
|
jpayne@69
|
40 #define SM_CAPT 1
|
jpayne@69
|
41
|
jpayne@69
|
42 #define SM_CAP_GVOLUME (1<<1)
|
jpayne@69
|
43 #define SM_CAP_GSWITCH (1<<2)
|
jpayne@69
|
44 #define SM_CAP_PVOLUME (1<<3)
|
jpayne@69
|
45 #define SM_CAP_PVOLUME_JOIN (1<<4)
|
jpayne@69
|
46 #define SM_CAP_PSWITCH (1<<5)
|
jpayne@69
|
47 #define SM_CAP_PSWITCH_JOIN (1<<6)
|
jpayne@69
|
48 #define SM_CAP_CVOLUME (1<<7)
|
jpayne@69
|
49 #define SM_CAP_CVOLUME_JOIN (1<<8)
|
jpayne@69
|
50 #define SM_CAP_CSWITCH (1<<9)
|
jpayne@69
|
51 #define SM_CAP_CSWITCH_JOIN (1<<10)
|
jpayne@69
|
52 #define SM_CAP_CSWITCH_EXCL (1<<11)
|
jpayne@69
|
53 #define SM_CAP_PENUM (1<<12)
|
jpayne@69
|
54 #define SM_CAP_CENUM (1<<13)
|
jpayne@69
|
55 /* SM_CAP_* 24-31 => private for module use */
|
jpayne@69
|
56
|
jpayne@69
|
57 #define SM_OPS_IS_ACTIVE 0
|
jpayne@69
|
58 #define SM_OPS_IS_MONO 1
|
jpayne@69
|
59 #define SM_OPS_IS_CHANNEL 2
|
jpayne@69
|
60 #define SM_OPS_IS_ENUMERATED 3
|
jpayne@69
|
61 #define SM_OPS_IS_ENUMCNT 4
|
jpayne@69
|
62
|
jpayne@69
|
63 #define sm_selem(x) ((sm_selem_t *)((x)->private_data))
|
jpayne@69
|
64 #define sm_selem_ops(x) ((sm_selem_t *)((x)->private_data))->ops
|
jpayne@69
|
65
|
jpayne@69
|
66 typedef struct _sm_selem {
|
jpayne@69
|
67 snd_mixer_selem_id_t *id;
|
jpayne@69
|
68 struct sm_elem_ops *ops;
|
jpayne@69
|
69 unsigned int caps;
|
jpayne@69
|
70 unsigned int capture_group;
|
jpayne@69
|
71 } sm_selem_t;
|
jpayne@69
|
72
|
jpayne@69
|
73 typedef struct _sm_class_basic {
|
jpayne@69
|
74 char *device;
|
jpayne@69
|
75 snd_ctl_t *ctl;
|
jpayne@69
|
76 snd_hctl_t *hctl;
|
jpayne@69
|
77 snd_ctl_card_info_t *info;
|
jpayne@69
|
78 } sm_class_basic_t;
|
jpayne@69
|
79
|
jpayne@69
|
80 struct sm_elem_ops {
|
jpayne@69
|
81 int (*is)(snd_mixer_elem_t *elem, int dir, int cmd, int val);
|
jpayne@69
|
82 int (*get_range)(snd_mixer_elem_t *elem, int dir, long *min, long *max);
|
jpayne@69
|
83 int (*set_range)(snd_mixer_elem_t *elem, int dir, long min, long max);
|
jpayne@69
|
84 int (*get_dB_range)(snd_mixer_elem_t *elem, int dir, long *min, long *max);
|
jpayne@69
|
85 int (*ask_vol_dB)(snd_mixer_elem_t *elem, int dir, long value, long *dbValue);
|
jpayne@69
|
86 int (*ask_dB_vol)(snd_mixer_elem_t *elem, int dir, long dbValue, long *value, int xdir);
|
jpayne@69
|
87 int (*get_volume)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long *value);
|
jpayne@69
|
88 int (*get_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long *value);
|
jpayne@69
|
89 int (*set_volume)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value);
|
jpayne@69
|
90 int (*set_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value, int xdir);
|
jpayne@69
|
91 int (*get_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int *value);
|
jpayne@69
|
92 int (*set_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int value);
|
jpayne@69
|
93 int (*enum_item_name)(snd_mixer_elem_t *elem, unsigned int item, size_t maxlen, char *buf);
|
jpayne@69
|
94 int (*get_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *itemp);
|
jpayne@69
|
95 int (*set_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int item);
|
jpayne@69
|
96 };
|
jpayne@69
|
97
|
jpayne@69
|
98 int snd_mixer_selem_compare(const snd_mixer_elem_t *c1, const snd_mixer_elem_t *c2);
|
jpayne@69
|
99
|
jpayne@69
|
100 int snd_mixer_sbasic_info(const snd_mixer_class_t *class, sm_class_basic_t *info);
|
jpayne@69
|
101 void *snd_mixer_sbasic_get_private(const snd_mixer_class_t *class);
|
jpayne@69
|
102 void snd_mixer_sbasic_set_private(const snd_mixer_class_t *class, void *private_data);
|
jpayne@69
|
103 void snd_mixer_sbasic_set_private_free(const snd_mixer_class_t *class, void (*private_free)(snd_mixer_class_t *class));
|
jpayne@69
|
104
|
jpayne@69
|
105 /** \} */
|
jpayne@69
|
106
|
jpayne@69
|
107 #ifdef __cplusplus
|
jpayne@69
|
108 }
|
jpayne@69
|
109 #endif
|
jpayne@69
|
110
|
jpayne@69
|
111 #endif /* __ALSA_MIXER_ABST_H */
|
jpayne@69
|
112
|