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
|
#ifndef __ALSA_TIMER_H
#define __ALSA_TIMER_H
#ifdef __cplusplus
extern "C" {
#endif
#define SND_TIMER_DLSYM_VERSION _dlsym_timer_001
#define SND_TIMER_QUERY_DLSYM_VERSION _dlsym_timer_query_001
typedef struct _snd_timer_id snd_timer_id_t;
typedef struct _snd_timer_ginfo snd_timer_ginfo_t;
typedef struct _snd_timer_gparams snd_timer_gparams_t;
typedef struct _snd_timer_gstatus snd_timer_gstatus_t;
typedef struct _snd_timer_info snd_timer_info_t;
typedef struct _snd_timer_params snd_timer_params_t;
typedef struct _snd_timer_status snd_timer_status_t;
typedef enum _snd_timer_class {
SND_TIMER_CLASS_NONE = -1,
SND_TIMER_CLASS_SLAVE = 0,
SND_TIMER_CLASS_GLOBAL,
SND_TIMER_CLASS_CARD,
SND_TIMER_CLASS_PCM,
SND_TIMER_CLASS_LAST = SND_TIMER_CLASS_PCM
} snd_timer_class_t;
typedef enum _snd_timer_slave_class {
SND_TIMER_SCLASS_NONE = 0,
SND_TIMER_SCLASS_APPLICATION,
SND_TIMER_SCLASS_SEQUENCER,
SND_TIMER_SCLASS_OSS_SEQUENCER,
SND_TIMER_SCLASS_LAST = SND_TIMER_SCLASS_OSS_SEQUENCER
} snd_timer_slave_class_t;
typedef enum _snd_timer_event {
SND_TIMER_EVENT_RESOLUTION = 0,
SND_TIMER_EVENT_TICK,
SND_TIMER_EVENT_START,
SND_TIMER_EVENT_STOP,
SND_TIMER_EVENT_CONTINUE,
SND_TIMER_EVENT_PAUSE,
SND_TIMER_EVENT_EARLY,
SND_TIMER_EVENT_SUSPEND,
SND_TIMER_EVENT_RESUME,
SND_TIMER_EVENT_MSTART = SND_TIMER_EVENT_START + 10,
SND_TIMER_EVENT_MSTOP = SND_TIMER_EVENT_STOP + 10,
SND_TIMER_EVENT_MCONTINUE = SND_TIMER_EVENT_CONTINUE + 10,
SND_TIMER_EVENT_MPAUSE = SND_TIMER_EVENT_PAUSE + 10,
SND_TIMER_EVENT_MSUSPEND = SND_TIMER_EVENT_SUSPEND + 10,
SND_TIMER_EVENT_MRESUME = SND_TIMER_EVENT_RESUME + 10
} snd_timer_event_t;
typedef struct _snd_timer_read {
unsigned int resolution;
unsigned int ticks;
} snd_timer_read_t;
typedef struct _snd_timer_tread {
snd_timer_event_t event;
snd_htimestamp_t tstamp;
unsigned int val;
} snd_timer_tread_t;
#define SND_TIMER_GLOBAL_SYSTEM 0
#define SND_TIMER_GLOBAL_RTC 1
#define SND_TIMER_GLOBAL_HPET 2
#define SND_TIMER_GLOBAL_HRTIMER 3
#define SND_TIMER_OPEN_NONBLOCK (1<<0)
#define SND_TIMER_OPEN_TREAD (1<<1)
typedef enum _snd_timer_type {
SND_TIMER_TYPE_HW = 0,
SND_TIMER_TYPE_SHM,
SND_TIMER_TYPE_INET
} snd_timer_type_t;
typedef struct _snd_timer_query snd_timer_query_t;
typedef struct _snd_timer snd_timer_t;
int snd_timer_query_open(snd_timer_query_t **handle, const char *name, int mode);
int snd_timer_query_open_lconf(snd_timer_query_t **handle, const char *name, int mode, snd_config_t *lconf);
int snd_timer_query_close(snd_timer_query_t *handle);
int snd_timer_query_next_device(snd_timer_query_t *handle, snd_timer_id_t *tid);
int snd_timer_query_info(snd_timer_query_t *handle, snd_timer_ginfo_t *info);
int snd_timer_query_params(snd_timer_query_t *handle, snd_timer_gparams_t *params);
int snd_timer_query_status(snd_timer_query_t *handle, snd_timer_gstatus_t *status);
int snd_timer_open(snd_timer_t **handle, const char *name, int mode);
int snd_timer_open_lconf(snd_timer_t **handle, const char *name, int mode, snd_config_t *lconf);
int snd_timer_close(snd_timer_t *handle);
int snd_async_add_timer_handler(snd_async_handler_t **handler, snd_timer_t *timer,
snd_async_callback_t callback, void *private_data);
snd_timer_t *snd_async_handler_get_timer(snd_async_handler_t *handler);
int snd_timer_poll_descriptors_count(snd_timer_t *handle);
int snd_timer_poll_descriptors(snd_timer_t *handle, struct pollfd *pfds, unsigned int space);
int snd_timer_poll_descriptors_revents(snd_timer_t *timer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
int snd_timer_info(snd_timer_t *handle, snd_timer_info_t *timer);
int snd_timer_params(snd_timer_t *handle, snd_timer_params_t *params);
int snd_timer_status(snd_timer_t *handle, snd_timer_status_t *status);
int snd_timer_start(snd_timer_t *handle);
int snd_timer_stop(snd_timer_t *handle);
int snd_timer_continue(snd_timer_t *handle);
ssize_t snd_timer_read(snd_timer_t *handle, void *buffer, size_t size);
size_t snd_timer_id_sizeof(void);
#define snd_timer_id_alloca(ptr) __snd_alloca(ptr, snd_timer_id)
int snd_timer_id_malloc(snd_timer_id_t **ptr);
void snd_timer_id_free(snd_timer_id_t *obj);
void snd_timer_id_copy(snd_timer_id_t *dst, const snd_timer_id_t *src);
void snd_timer_id_set_class(snd_timer_id_t *id, int dev_class);
int snd_timer_id_get_class(snd_timer_id_t *id);
void snd_timer_id_set_sclass(snd_timer_id_t *id, int dev_sclass);
int snd_timer_id_get_sclass(snd_timer_id_t *id);
void snd_timer_id_set_card(snd_timer_id_t *id, int card);
int snd_timer_id_get_card(snd_timer_id_t *id);
void snd_timer_id_set_device(snd_timer_id_t *id, int device);
int snd_timer_id_get_device(snd_timer_id_t *id);
void snd_timer_id_set_subdevice(snd_timer_id_t *id, int subdevice);
int snd_timer_id_get_subdevice(snd_timer_id_t *id);
size_t snd_timer_ginfo_sizeof(void);
#define snd_timer_ginfo_alloca(ptr) __snd_alloca(ptr, snd_timer_ginfo)
int snd_timer_ginfo_malloc(snd_timer_ginfo_t **ptr);
void snd_timer_ginfo_free(snd_timer_ginfo_t *obj);
void snd_timer_ginfo_copy(snd_timer_ginfo_t *dst, const snd_timer_ginfo_t *src);
int snd_timer_ginfo_set_tid(snd_timer_ginfo_t *obj, snd_timer_id_t *tid);
snd_timer_id_t *snd_timer_ginfo_get_tid(snd_timer_ginfo_t *obj);
unsigned int snd_timer_ginfo_get_flags(snd_timer_ginfo_t *obj);
int snd_timer_ginfo_get_card(snd_timer_ginfo_t *obj);
char *snd_timer_ginfo_get_id(snd_timer_ginfo_t *obj);
char *snd_timer_ginfo_get_name(snd_timer_ginfo_t *obj);
unsigned long snd_timer_ginfo_get_resolution(snd_timer_ginfo_t *obj);
unsigned long snd_timer_ginfo_get_resolution_min(snd_timer_ginfo_t *obj);
unsigned long snd_timer_ginfo_get_resolution_max(snd_timer_ginfo_t *obj);
unsigned int snd_timer_ginfo_get_clients(snd_timer_ginfo_t *obj);
size_t snd_timer_info_sizeof(void);
#define snd_timer_info_alloca(ptr) __snd_alloca(ptr, snd_timer_info)
int snd_timer_info_malloc(snd_timer_info_t **ptr);
void snd_timer_info_free(snd_timer_info_t *obj);
void snd_timer_info_copy(snd_timer_info_t *dst, const snd_timer_info_t *src);
int snd_timer_info_is_slave(snd_timer_info_t * info);
int snd_timer_info_get_card(snd_timer_info_t * info);
const char *snd_timer_info_get_id(snd_timer_info_t * info);
const char *snd_timer_info_get_name(snd_timer_info_t * info);
long snd_timer_info_get_resolution(snd_timer_info_t * info);
size_t snd_timer_params_sizeof(void);
#define snd_timer_params_alloca(ptr) __snd_alloca(ptr, snd_timer_params)
int snd_timer_params_malloc(snd_timer_params_t **ptr);
void snd_timer_params_free(snd_timer_params_t *obj);
void snd_timer_params_copy(snd_timer_params_t *dst, const snd_timer_params_t *src);
int snd_timer_params_set_auto_start(snd_timer_params_t * params, int auto_start);
int snd_timer_params_get_auto_start(snd_timer_params_t * params);
int snd_timer_params_set_exclusive(snd_timer_params_t * params, int exclusive);
int snd_timer_params_get_exclusive(snd_timer_params_t * params);
int snd_timer_params_set_early_event(snd_timer_params_t * params, int early_event);
int snd_timer_params_get_early_event(snd_timer_params_t * params);
void snd_timer_params_set_ticks(snd_timer_params_t * params, long ticks);
long snd_timer_params_get_ticks(snd_timer_params_t * params);
void snd_timer_params_set_queue_size(snd_timer_params_t * params, long queue_size);
long snd_timer_params_get_queue_size(snd_timer_params_t * params);
void snd_timer_params_set_filter(snd_timer_params_t * params, unsigned int filter);
unsigned int snd_timer_params_get_filter(snd_timer_params_t * params);
size_t snd_timer_status_sizeof(void);
#define snd_timer_status_alloca(ptr) __snd_alloca(ptr, snd_timer_status)
int snd_timer_status_malloc(snd_timer_status_t **ptr);
void snd_timer_status_free(snd_timer_status_t *obj);
void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src);
snd_htimestamp_t snd_timer_status_get_timestamp(snd_timer_status_t * status);
long snd_timer_status_get_resolution(snd_timer_status_t * status);
long snd_timer_status_get_lost(snd_timer_status_t * status);
long snd_timer_status_get_overrun(snd_timer_status_t * status);
long snd_timer_status_get_queue(snd_timer_status_t * status);
long snd_timer_info_get_ticks(snd_timer_info_t * info);
#ifdef __cplusplus
}
#endif
#endif
|