Loading...
Searching...
No Matches
control_external.h
Go to the documentation of this file.
/*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef __ALSA_CONTROL_EXTERNAL_H
#define __ALSA_CONTROL_EXTERNAL_H
#ifndef __ASOUNDLIB_LOCAL
#include <alsa/asoundlib.h>
#endif
#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
/* redefine typedef's for stupid doxygen */
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);
/*
* Protocol version
*/
#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 /* __ALSA_CONTROL_EXTERNAL_H */
snd_ctl_t
struct _snd_ctl snd_ctl_t
Definition control.h:369
snd_ctl_elem_id_t
struct _snd_ctl_elem_id snd_ctl_elem_id_t
Definition control.h:88
snd_ctl_ext_create
int snd_ctl_ext_create(snd_ctl_ext_t *ext, const char *name, int mode)
Create an external control plugin instance.
Definition control_ext.c:708
snd_ctl_ext_delete
int snd_ctl_ext_delete(snd_ctl_ext_t *ext)
Delete the external control plugin.
Definition control_ext.c:739
snd_ctl_ext_tlv_rw_t
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)
Definition control_external.h:72
snd_ctl_ext_t
snd_ctl_ext snd_ctl_ext_t
Definition control_external.h:68
snd_ctl_ext_callback_t
snd_ctl_ext_callback snd_ctl_ext_callback_t
Definition control_external.h:69
snd_ctl_ext_key_t
unsigned long snd_ctl_ext_key_t
Definition control_external.h:65
snd_ctl_ext_access_t
snd_ctl_ext_access_t
Definition control_external.h:262
snd_aes_iec958_t
Definition control.h:52
snd_ctl_ext_callback
Definition control_external.h:150
snd_ctl_ext_callback::poll_revents
int(* poll_revents)(snd_ctl_ext_t *ext, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
Definition control_external.h:256
snd_ctl_ext_callback::get_enumerated_name
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)
Definition control_external.h:193
snd_ctl_ext_callback::write_integer64
int(* write_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value)
Definition control_external.h:223
snd_ctl_ext_callback::get_integer_info
int(* get_integer_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *imin, long *imax, long *istep)
Definition control_external.h:179
snd_ctl_ext_callback::elem_list
int(* elem_list)(snd_ctl_ext_t *ext, unsigned int offset, snd_ctl_elem_id_t *id)
Definition control_external.h:162
snd_ctl_ext_callback::read_integer64
int(* read_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value)
Definition control_external.h:202
snd_ctl_ext_callback::read_enumerated
int(* read_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items)
Definition control_external.h:206
snd_ctl_ext_callback::read_integer
int(* read_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value)
Definition control_external.h:198
snd_ctl_ext_callback::write_integer
int(* write_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value)
Definition control_external.h:219
snd_ctl_ext_callback::subscribe_events
void(* subscribe_events)(snd_ctl_ext_t *ext, int subscribe)
Definition control_external.h:240
snd_ctl_ext_callback::free_key
void(* free_key)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key)
Definition control_external.h:170
snd_ctl_ext_callback::write_bytes
int(* write_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned char *data, size_t max_bytes)
Definition control_external.h:231
snd_ctl_ext_callback::poll_descriptors_count
int(* poll_descriptors_count)(snd_ctl_ext_t *ext)
Definition control_external.h:248
snd_ctl_ext_callback::find_elem
snd_ctl_ext_key_t(* find_elem)(snd_ctl_ext_t *ext, const snd_ctl_elem_id_t *id)
Definition control_external.h:166
snd_ctl_ext_callback::read_iec958
int(* read_iec958)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, snd_aes_iec958_t *iec958)
Definition control_external.h:215
snd_ctl_ext_callback::write_enumerated
int(* write_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items)
Definition control_external.h:227
snd_ctl_ext_callback::get_integer64_info
int(* get_integer64_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *imin, int64_t *imax, int64_t *istep)
Definition control_external.h:184
snd_ctl_ext_callback::elem_count
int(* elem_count)(snd_ctl_ext_t *ext)
Definition control_external.h:158
snd_ctl_ext_callback::read_event
int(* read_event)(snd_ctl_ext_t *ext, snd_ctl_elem_id_t *id, unsigned int *event_mask)
Definition control_external.h:244
snd_ctl_ext_callback::close
void(* close)(snd_ctl_ext_t *ext)
Definition control_external.h:154
snd_ctl_ext_callback::get_enumerated_info
int(* get_enumerated_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items)
Definition control_external.h:189
snd_ctl_ext_callback::get_attribute
int(* get_attribute)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int *type, unsigned int *acc, unsigned int *count)
Definition control_external.h:174
snd_ctl_ext_callback::poll_descriptors
int(* poll_descriptors)(snd_ctl_ext_t *ext, struct pollfd *pfds, unsigned int space)
Definition control_external.h:252
snd_ctl_ext_callback::read_bytes
int(* read_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned char *data, size_t max_bytes)
Definition control_external.h:210
snd_ctl_ext_callback::write_iec958
int(* write_iec958)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, snd_aes_iec958_t *iec958)
Definition control_external.h:236
snd_ctl_ext
Definition control_external.h:89
snd_ctl_ext::name
char name[32]
Definition control_external.h:110
snd_ctl_ext::poll_fd
int poll_fd
Definition control_external.h:122
snd_ctl_ext::callback
const snd_ctl_ext_callback_t * callback
Definition control_external.h:127
snd_ctl_ext::nonblock
int nonblock
Definition control_external.h:137
snd_ctl_ext::longname
char longname[80]
Definition control_external.h:114
snd_ctl_ext::subscribed
int subscribed
Definition control_external.h:138
snd_ctl_ext::mixername
char mixername[80]
Definition control_external.h:118
snd_ctl_ext::private_data
void * private_data
Definition control_external.h:131
snd_ctl_ext::card_idx
int card_idx
Definition control_external.h:98
snd_ctl_ext::driver
char driver[16]
Definition control_external.h:106
snd_ctl_ext::handle
snd_ctl_t * handle
Definition control_external.h:135
snd_ctl_ext::version
unsigned int version
Definition control_external.h:94
snd_ctl_ext::tlv
union snd_ctl_ext::@26 tlv
data
uint8_t data
Definition ump_msg.h:6
type
uint8_t type
Definition ump_msg.h:1