| 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 |
#ifndef __ALSA_TIMER_H |
| 29 |
#define __ALSA_TIMER_H |
| 30 |
|
| 31 |
#ifdef __cplusplus |
| 32 |
extern "C" { |
| 33 |
#endif |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
#define SND_TIMER_DLSYM_VERSION _dlsym_timer_001 |
| 43 |
|
| 44 |
#define SND_TIMER_QUERY_DLSYM_VERSION _dlsym_timer_query_001 |
| 45 |
|
| 46 |
|
| 47 |
typedef struct _snd_timer_id snd_timer_id_t; |
| 48 |
|
| 49 |
typedef struct _snd_timer_ginfo snd_timer_ginfo_t; |
| 50 |
|
| 51 |
typedef struct _snd_timer_gparams snd_timer_gparams_t; |
| 52 |
|
| 53 |
typedef struct _snd_timer_gstatus snd_timer_gstatus_t; |
| 54 |
|
| 55 |
typedef struct _snd_timer_info snd_timer_info_t; |
| 56 |
|
| 57 |
typedef struct _snd_timer_params snd_timer_params_t; |
| 58 |
|
| 59 |
typedef struct _snd_timer_status snd_timer_status_t; |
| 60 |
|
| 61 |
typedef enum _snd_timer_class { |
| 62 |
SND_TIMER_CLASS_NONE = -1, |
| 63 |
SND_TIMER_CLASS_SLAVE = 0, |
| 64 |
SND_TIMER_CLASS_GLOBAL, |
| 65 |
SND_TIMER_CLASS_CARD, |
| 66 |
SND_TIMER_CLASS_PCM, |
| 67 |
SND_TIMER_CLASS_LAST = SND_TIMER_CLASS_PCM |
| 68 |
} snd_timer_class_t; |
| 69 |
|
| 70 |
|
| 71 |
typedef enum _snd_timer_slave_class { |
| 72 |
SND_TIMER_SCLASS_NONE = 0, |
| 73 |
SND_TIMER_SCLASS_APPLICATION, |
| 74 |
SND_TIMER_SCLASS_SEQUENCER, |
| 75 |
SND_TIMER_SCLASS_OSS_SEQUENCER, |
| 76 |
SND_TIMER_SCLASS_LAST = SND_TIMER_SCLASS_OSS_SEQUENCER |
| 77 |
} snd_timer_slave_class_t; |
| 78 |
|
| 79 |
|
| 80 |
typedef enum _snd_timer_event { |
| 81 |
SND_TIMER_EVENT_RESOLUTION = 0, |
| 82 |
SND_TIMER_EVENT_TICK, |
| 83 |
SND_TIMER_EVENT_START, |
| 84 |
SND_TIMER_EVENT_STOP, |
| 85 |
SND_TIMER_EVENT_CONTINUE, |
| 86 |
SND_TIMER_EVENT_PAUSE, |
| 87 |
SND_TIMER_EVENT_EARLY, |
| 88 |
SND_TIMER_EVENT_SUSPEND, |
| 89 |
SND_TIMER_EVENT_RESUME, |
| 90 |
|
| 91 |
SND_TIMER_EVENT_MSTART = SND_TIMER_EVENT_START + 10, |
| 92 |
SND_TIMER_EVENT_MSTOP = SND_TIMER_EVENT_STOP + 10, |
| 93 |
SND_TIMER_EVENT_MCONTINUE = SND_TIMER_EVENT_CONTINUE + 10, |
| 94 |
SND_TIMER_EVENT_MPAUSE = SND_TIMER_EVENT_PAUSE + 10, |
| 95 |
SND_TIMER_EVENT_MSUSPEND = SND_TIMER_EVENT_SUSPEND + 10, |
| 96 |
SND_TIMER_EVENT_MRESUME = SND_TIMER_EVENT_RESUME + 10 |
| 97 |
} snd_timer_event_t; |
| 98 |
|
| 99 |
|
| 100 |
typedef struct _snd_timer_read { |
| 101 |
unsigned int resolution; |
| 102 |
unsigned int ticks; |
| 103 |
} snd_timer_read_t; |
| 104 |
|
| 105 |
|
| 106 |
typedef struct _snd_timer_tread { |
| 107 |
snd_timer_event_t event; |
| 108 |
snd_htimestamp_t tstamp; |
| 109 |
unsigned int val; |
| 110 |
} snd_timer_tread_t; |
| 111 |
|
| 112 |
|
| 113 |
#define SND_TIMER_GLOBAL_SYSTEM 0 |
| 114 |
|
| 115 |
#define SND_TIMER_GLOBAL_RTC 1 |
| 116 |
|
| 117 |
#define SND_TIMER_GLOBAL_HPET 2 |
| 118 |
|
| 119 |
#define SND_TIMER_GLOBAL_HRTIMER 3 |
| 120 |
|
| 121 |
|
| 122 |
#define SND_TIMER_OPEN_NONBLOCK (1<<0) |
| 123 |
|
| 124 |
#define SND_TIMER_OPEN_TREAD (1<<1) |
| 125 |
|
| 126 |
|
| 127 |
typedef enum _snd_timer_type { |
| 128 |
|
| 129 |
SND_TIMER_TYPE_HW = 0, |
| 130 |
|
| 131 |
SND_TIMER_TYPE_SHM, |
| 132 |
|
| 133 |
SND_TIMER_TYPE_INET |
| 134 |
} snd_timer_type_t; |
| 135 |
|
| 136 |
|
| 137 |
typedef struct _snd_timer_query snd_timer_query_t; |
| 138 |
|
| 139 |
typedef struct _snd_timer snd_timer_t; |
| 140 |
|
| 141 |
|
| 142 |
int snd_timer_query_open(snd_timer_query_t **handle, const char *name, int mode); |
| 143 |
int snd_timer_query_open_lconf(snd_timer_query_t **handle, const char *name, int mode, snd_config_t *lconf); |
| 144 |
int snd_timer_query_close(snd_timer_query_t *handle); |
| 145 |
int snd_timer_query_next_device(snd_timer_query_t *handle, snd_timer_id_t *tid); |
| 146 |
int snd_timer_query_info(snd_timer_query_t *handle, snd_timer_ginfo_t *info); |
| 147 |
int snd_timer_query_params(snd_timer_query_t *handle, snd_timer_gparams_t *params); |
| 148 |
int snd_timer_query_status(snd_timer_query_t *handle, snd_timer_gstatus_t *status); |
| 149 |
|
| 150 |
int snd_timer_open(snd_timer_t **handle, const char *name, int mode); |
| 151 |
int snd_timer_open_lconf(snd_timer_t **handle, const char *name, int mode, snd_config_t *lconf); |
| 152 |
int snd_timer_close(snd_timer_t *handle); |
| 153 |
int snd_async_add_timer_handler(snd_async_handler_t **handler, snd_timer_t *timer, |
| 154 |
snd_async_callback_t callback, void *private_data); |
| 155 |
snd_timer_t *snd_async_handler_get_timer(snd_async_handler_t *handler); |
| 156 |
int snd_timer_poll_descriptors_count(snd_timer_t *handle); |
| 157 |
int snd_timer_poll_descriptors(snd_timer_t *handle, struct pollfd *pfds, unsigned int space); |
| 158 |
int snd_timer_poll_descriptors_revents(snd_timer_t *timer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); |
| 159 |
int snd_timer_info(snd_timer_t *handle, snd_timer_info_t *timer); |
| 160 |
int snd_timer_params(snd_timer_t *handle, snd_timer_params_t *params); |
| 161 |
int snd_timer_status(snd_timer_t *handle, snd_timer_status_t *status); |
| 162 |
int snd_timer_start(snd_timer_t *handle); |
| 163 |
int snd_timer_stop(snd_timer_t *handle); |
| 164 |
int snd_timer_continue(snd_timer_t *handle); |
| 165 |
ssize_t snd_timer_read(snd_timer_t *handle, void *buffer, size_t size); |
| 166 |
|
| 167 |
size_t snd_timer_id_sizeof(void); |
| 168 |
|
| 169 |
#define snd_timer_id_alloca(ptr) __snd_alloca(ptr, snd_timer_id) |
| 170 |
int snd_timer_id_malloc(snd_timer_id_t **ptr); |
| 171 |
void snd_timer_id_free(snd_timer_id_t *obj); |
| 172 |
void snd_timer_id_copy(snd_timer_id_t *dst, const snd_timer_id_t *src); |
| 173 |
|
| 174 |
void snd_timer_id_set_class(snd_timer_id_t *id, int dev_class); |
| 175 |
int snd_timer_id_get_class(snd_timer_id_t *id); |
| 176 |
void snd_timer_id_set_sclass(snd_timer_id_t *id, int dev_sclass); |
| 177 |
int snd_timer_id_get_sclass(snd_timer_id_t *id); |
| 178 |
void snd_timer_id_set_card(snd_timer_id_t *id, int card); |
| 179 |
int snd_timer_id_get_card(snd_timer_id_t *id); |
| 180 |
void snd_timer_id_set_device(snd_timer_id_t *id, int device); |
| 181 |
int snd_timer_id_get_device(snd_timer_id_t *id); |
| 182 |
void snd_timer_id_set_subdevice(snd_timer_id_t *id, int subdevice); |
| 183 |
int snd_timer_id_get_subdevice(snd_timer_id_t *id); |
| 184 |
|
| 185 |
size_t snd_timer_ginfo_sizeof(void); |
| 186 |
|
| 187 |
#define snd_timer_ginfo_alloca(ptr) __snd_alloca(ptr, snd_timer_ginfo) |
| 188 |
int snd_timer_ginfo_malloc(snd_timer_ginfo_t **ptr); |
| 189 |
void snd_timer_ginfo_free(snd_timer_ginfo_t *obj); |
| 190 |
void snd_timer_ginfo_copy(snd_timer_ginfo_t *dst, const snd_timer_ginfo_t *src); |
| 191 |
|
| 192 |
int snd_timer_ginfo_set_tid(snd_timer_ginfo_t *obj, snd_timer_id_t *tid); |
| 193 |
snd_timer_id_t *snd_timer_ginfo_get_tid(snd_timer_ginfo_t *obj); |
| 194 |
unsigned int snd_timer_ginfo_get_flags(snd_timer_ginfo_t *obj); |
| 195 |
int snd_timer_ginfo_get_card(snd_timer_ginfo_t *obj); |
| 196 |
char *snd_timer_ginfo_get_id(snd_timer_ginfo_t *obj); |
| 197 |
char *snd_timer_ginfo_get_name(snd_timer_ginfo_t *obj); |
| 198 |
unsigned long snd_timer_ginfo_get_resolution(snd_timer_ginfo_t *obj); |
| 199 |
unsigned long snd_timer_ginfo_get_resolution_min(snd_timer_ginfo_t *obj); |
| 200 |
unsigned long snd_timer_ginfo_get_resolution_max(snd_timer_ginfo_t *obj); |
| 201 |
unsigned int snd_timer_ginfo_get_clients(snd_timer_ginfo_t *obj); |
| 202 |
|
| 203 |
size_t snd_timer_info_sizeof(void); |
| 204 |
|
| 205 |
#define snd_timer_info_alloca(ptr) __snd_alloca(ptr, snd_timer_info) |
| 206 |
int snd_timer_info_malloc(snd_timer_info_t **ptr); |
| 207 |
void snd_timer_info_free(snd_timer_info_t *obj); |
| 208 |
void snd_timer_info_copy(snd_timer_info_t *dst, const snd_timer_info_t *src); |
| 209 |
|
| 210 |
int snd_timer_info_is_slave(snd_timer_info_t * info); |
| 211 |
int snd_timer_info_get_card(snd_timer_info_t * info); |
| 212 |
const char *snd_timer_info_get_id(snd_timer_info_t * info); |
| 213 |
const char *snd_timer_info_get_name(snd_timer_info_t * info); |
| 214 |
long snd_timer_info_get_resolution(snd_timer_info_t * info); |
| 215 |
|
| 216 |
size_t snd_timer_params_sizeof(void); |
| 217 |
|
| 218 |
#define snd_timer_params_alloca(ptr) __snd_alloca(ptr, snd_timer_params) |
| 219 |
int snd_timer_params_malloc(snd_timer_params_t **ptr); |
| 220 |
void snd_timer_params_free(snd_timer_params_t *obj); |
| 221 |
void snd_timer_params_copy(snd_timer_params_t *dst, const snd_timer_params_t *src); |
| 222 |
|
| 223 |
int snd_timer_params_set_auto_start(snd_timer_params_t * params, int auto_start); |
| 224 |
int snd_timer_params_get_auto_start(snd_timer_params_t * params); |
| 225 |
int snd_timer_params_set_exclusive(snd_timer_params_t * params, int exclusive); |
| 226 |
int snd_timer_params_get_exclusive(snd_timer_params_t * params); |
| 227 |
int snd_timer_params_set_early_event(snd_timer_params_t * params, int early_event); |
| 228 |
int snd_timer_params_get_early_event(snd_timer_params_t * params); |
| 229 |
void snd_timer_params_set_ticks(snd_timer_params_t * params, long ticks); |
| 230 |
long snd_timer_params_get_ticks(snd_timer_params_t * params); |
| 231 |
void snd_timer_params_set_queue_size(snd_timer_params_t * params, long queue_size); |
| 232 |
long snd_timer_params_get_queue_size(snd_timer_params_t * params); |
| 233 |
void snd_timer_params_set_filter(snd_timer_params_t * params, unsigned int filter); |
| 234 |
unsigned int snd_timer_params_get_filter(snd_timer_params_t * params); |
| 235 |
|
| 236 |
size_t snd_timer_status_sizeof(void); |
| 237 |
|
| 238 |
#define snd_timer_status_alloca(ptr) __snd_alloca(ptr, snd_timer_status) |
| 239 |
int snd_timer_status_malloc(snd_timer_status_t **ptr); |
| 240 |
void snd_timer_status_free(snd_timer_status_t *obj); |
| 241 |
void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src); |
| 242 |
|
| 243 |
snd_htimestamp_t snd_timer_status_get_timestamp(snd_timer_status_t * status); |
| 244 |
long snd_timer_status_get_resolution(snd_timer_status_t * status); |
| 245 |
long snd_timer_status_get_lost(snd_timer_status_t * status); |
| 246 |
long snd_timer_status_get_overrun(snd_timer_status_t * status); |
| 247 |
long snd_timer_status_get_queue(snd_timer_status_t * status); |
| 248 |
|
| 249 |
|
| 250 |
long snd_timer_info_get_ticks(snd_timer_info_t * info); |
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
#ifdef __cplusplus |
| 255 |
} |
| 256 |
#endif |
| 257 |
|
| 258 |
#endif |
| 259 |
|