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