ALSA project - the C library reference
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
control_external.h
Go to the documentation of this file.
1 
10 /*
11  * This library is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License as
13  * published by the Free Software Foundation; either version 2.1 of
14  * the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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 
43 #define SND_CTL_PLUGIN_ENTRY(name) _snd_ctl_##name##_open
44 
48 #define SND_CTL_PLUGIN_SYMBOL(name) SND_DLSYM_BUILD_VERSION(SND_CTL_PLUGIN_ENTRY(name), SND_CONTROL_DLSYM_VERSION);
49 
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 
58 typedef struct snd_ctl_ext snd_ctl_ext_t;
60 typedef struct snd_ctl_ext_callback snd_ctl_ext_callback_t;
62 typedef unsigned long snd_ctl_ext_key_t;
64 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,
65  unsigned int *tlv, unsigned int tlv_size);
66 
67 /*
68  * Protocol version
69  */
70 #define SND_CTL_EXT_VERSION_MAJOR 1
71 #define SND_CTL_EXT_VERSION_MINOR 0
72 #define SND_CTL_EXT_VERSION_TINY 1
76 #define SND_CTL_EXT_VERSION ((SND_CTL_EXT_VERSION_MAJOR<<16) |\
77  (SND_CTL_EXT_VERSION_MINOR<<8) |\
78  (SND_CTL_EXT_VERSION_TINY))
79 
81 struct snd_ctl_ext {
86  unsigned int version;
90  int card_idx;
94  char id[16];
98  char driver[16];
102  char name[32];
106  char longname[80];
110  char mixername[80];
114  int poll_fd;
115 
119  const snd_ctl_ext_callback_t *callback;
128 
129  int nonblock;
135  union {
137  const unsigned int *p;
138  } tlv;
139 };
140 
146  void (*close)(snd_ctl_ext_t *ext);
150  int (*elem_count)(snd_ctl_ext_t *ext);
154  int (*elem_list)(snd_ctl_ext_t *ext, unsigned int offset, snd_ctl_elem_id_t *id);
158  snd_ctl_ext_key_t (*find_elem)(snd_ctl_ext_t *ext, const snd_ctl_elem_id_t *id);
162  void (*free_key)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key);
166  int (*get_attribute)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
167  int *type, unsigned int *acc, unsigned int *count);
171  int (*get_integer_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
172  long *imin, long *imax, long *istep);
176  int (*get_integer64_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
177  int64_t *imin, int64_t *imax, int64_t *istep);
181  int (*get_enumerated_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items);
185  int (*get_enumerated_name)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int item,
186  char *name, size_t name_max_len);
190  int (*read_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value);
194  int (*read_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value);
198  int (*read_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items);
202  int (*read_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned char *data,
203  size_t max_bytes);
207  int (*read_iec958)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, snd_aes_iec958_t *iec958);
211  int (*write_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value);
215  int (*write_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value);
219  int (*write_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items);
223  int (*write_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned char *data,
224  size_t max_bytes);
228  int (*write_iec958)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, snd_aes_iec958_t *iec958);
232  void (*subscribe_events)(snd_ctl_ext_t *ext, int subscribe);
236  int (*read_event)(snd_ctl_ext_t *ext, snd_ctl_elem_id_t *id, unsigned int *event_mask);
240  int (*poll_descriptors_count)(snd_ctl_ext_t *ext);
244  int (*poll_descriptors)(snd_ctl_ext_t *ext, struct pollfd *pfds, unsigned int space);
248  int (*poll_revents)(snd_ctl_ext_t *ext, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
249 };
250 
254 typedef enum snd_ctl_ext_access {
255  SND_CTL_EXT_ACCESS_READ = (1<<0),
256  SND_CTL_EXT_ACCESS_WRITE = (1<<1),
257  SND_CTL_EXT_ACCESS_READWRITE = (3<<0),
258  SND_CTL_EXT_ACCESS_VOLATILE = (1<<2),
259  SND_CTL_EXT_ACCESS_TLV_READ = (1<<4),
260  SND_CTL_EXT_ACCESS_TLV_WRITE = (1<<5),
261  SND_CTL_EXT_ACCESS_TLV_READWRITE = (3<<4),
262  SND_CTL_EXT_ACCESS_TLV_COMMAND = (1<<6),
263  SND_CTL_EXT_ACCESS_INACTIVE = (1<<8),
264  SND_CTL_EXT_ACCESS_TLV_CALLBACK = (1<<28),
266 
270 #define SND_CTL_EXT_KEY_NOT_FOUND (snd_ctl_ext_key_t)(-1)
271 
272 int snd_ctl_ext_create(snd_ctl_ext_t *ext, const char *name, int mode);
273 int snd_ctl_ext_delete(snd_ctl_ext_t *ext);
274 
277 #ifdef __cplusplus
278 }
279 #endif
280 
281 #endif /* __ALSA_CONTROL_EXTERNAL_H */

Generated for ALSA project - the C library reference by doxygen 1.8.1.1