1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
#ifndef __ALSA_CONTROL_EXTERNAL_H
#define __ALSA_CONTROL_EXTERNAL_H
#include "control.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SND_CTL_PLUGIN_ENTRY(name) _snd_ctl_##name##_open
#define SND_CTL_PLUGIN_SYMBOL(name) SND_DLSYM_BUILD_VERSION(SND_CTL_PLUGIN_ENTRY(name), SND_CONTROL_DLSYM_VERSION);
#define SND_CTL_PLUGIN_DEFINE_FUNC(plugin) \
int SND_CTL_PLUGIN_ENTRY(plugin) (snd_ctl_t **handlep, const char *name,\
snd_config_t *root, snd_config_t *conf, int mode)
typedef struct snd_ctl_ext snd_ctl_ext_t;
typedef struct snd_ctl_ext_callback snd_ctl_ext_callback_t;
typedef unsigned long snd_ctl_ext_key_t;
#ifdef DOC_HIDDEN
typedef snd_ctl_ext snd_ctl_ext_t;
typedef snd_ctl_ext_callback snd_ctl_ext_callback_t;
#endif
typedef int (snd_ctl_ext_tlv_rw_t)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int op_flag, unsigned int numid,
unsigned int *tlv, unsigned int tlv_size);
#define SND_CTL_EXT_VERSION_MAJOR 1
#define SND_CTL_EXT_VERSION_MINOR 0
#define SND_CTL_EXT_VERSION_TINY 1
#define SND_CTL_EXT_VERSION ((SND_CTL_EXT_VERSION_MAJOR<<16) |\
(SND_CTL_EXT_VERSION_MINOR<<8) |\
(SND_CTL_EXT_VERSION_TINY))
struct snd_ctl_ext {
unsigned int version;
int card_idx;
char id[16];
char driver[16];
char name[32];
char longname[80];
char mixername[80];
int poll_fd;
const snd_ctl_ext_callback_t *callback;
void *private_data;
snd_ctl_t *handle;
int nonblock;
int subscribed;
union {
snd_ctl_ext_tlv_rw_t *c;
const unsigned int *p;
} tlv;
};
struct snd_ctl_ext_callback {
void (*close)(snd_ctl_ext_t *ext);
int (*elem_count)(snd_ctl_ext_t *ext);
int (*elem_list)(snd_ctl_ext_t *ext, unsigned int offset, snd_ctl_elem_id_t *id);
snd_ctl_ext_key_t (*find_elem)(snd_ctl_ext_t *ext, const snd_ctl_elem_id_t *id);
void (*free_key)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key);
int (*get_attribute)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
int *type, unsigned int *acc, unsigned int *count);
int (*get_integer_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
long *imin, long *imax, long *istep);
int (*get_integer64_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
int64_t *imin, int64_t *imax, int64_t *istep);
int (*get_enumerated_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items);
int (*get_enumerated_name)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int item,
char *name, size_t name_max_len);
int (*read_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value);
int (*read_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value);
int (*read_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items);
int (*read_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned char *data,
size_t max_bytes);
int (*read_iec958)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, snd_aes_iec958_t *iec958);
int (*write_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value);
int (*write_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value);
int (*write_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items);
int (*write_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned char *data,
size_t max_bytes);
int (*write_iec958)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, snd_aes_iec958_t *iec958);
void (*subscribe_events)(snd_ctl_ext_t *ext, int subscribe);
int (*read_event)(snd_ctl_ext_t *ext, snd_ctl_elem_id_t *id, unsigned int *event_mask);
int (*poll_descriptors_count)(snd_ctl_ext_t *ext);
int (*poll_descriptors)(snd_ctl_ext_t *ext, struct pollfd *pfds, unsigned int space);
int (*poll_revents)(snd_ctl_ext_t *ext, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
};
typedef enum snd_ctl_ext_access {
SND_CTL_EXT_ACCESS_READ = (1<<0),
SND_CTL_EXT_ACCESS_WRITE = (1<<1),
SND_CTL_EXT_ACCESS_READWRITE = (3<<0),
SND_CTL_EXT_ACCESS_VOLATILE = (1<<2),
SND_CTL_EXT_ACCESS_TLV_READ = (1<<4),
SND_CTL_EXT_ACCESS_TLV_WRITE = (1<<5),
SND_CTL_EXT_ACCESS_TLV_READWRITE = (3<<4),
SND_CTL_EXT_ACCESS_TLV_COMMAND = (1<<6),
SND_CTL_EXT_ACCESS_INACTIVE = (1<<8),
SND_CTL_EXT_ACCESS_TLV_CALLBACK = (1<<28),
} snd_ctl_ext_access_t;
#define SND_CTL_EXT_KEY_NOT_FOUND (snd_ctl_ext_key_t)(-1)
int snd_ctl_ext_create(snd_ctl_ext_t *ext, const char *name, int mode);
int snd_ctl_ext_delete(snd_ctl_ext_t *ext);
#ifdef __cplusplus
}
#endif
#endif
|