|
Packit Service |
db8eaa |
/*
|
|
Packit Service |
db8eaa |
* Control Interface - local header file
|
|
Packit Service |
db8eaa |
* Copyright (c) 2000 by Jaroslav Kysela <perex@perex.cz>
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
* This library is free software; you can redistribute it and/or modify
|
|
Packit Service |
db8eaa |
* it under the terms of the GNU Lesser General Public License as
|
|
Packit Service |
db8eaa |
* published by the Free Software Foundation; either version 2.1 of
|
|
Packit Service |
db8eaa |
* the License, or (at your option) any later version.
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
db8eaa |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
db8eaa |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
db8eaa |
* GNU Lesser General Public License for more details.
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
db8eaa |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
db8eaa |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
*/
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#include "local.h"
|
|
Packit Service |
db8eaa |
#include <sound/tlv.h>
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
typedef struct _snd_ctl_ops {
|
|
Packit Service |
db8eaa |
int (*close)(snd_ctl_t *handle);
|
|
Packit Service |
db8eaa |
int (*nonblock)(snd_ctl_t *handle, int nonblock);
|
|
Packit Service |
db8eaa |
int (*async)(snd_ctl_t *handle, int sig, pid_t pid);
|
|
Packit Service |
db8eaa |
int (*subscribe_events)(snd_ctl_t *handle, int subscribe);
|
|
Packit Service |
db8eaa |
int (*card_info)(snd_ctl_t *handle, snd_ctl_card_info_t *info);
|
|
Packit Service |
db8eaa |
int (*element_list)(snd_ctl_t *handle, snd_ctl_elem_list_t *list);
|
|
Packit Service |
db8eaa |
int (*element_info)(snd_ctl_t *handle, snd_ctl_elem_info_t *info);
|
|
Packit Service |
db8eaa |
int (*element_add)(snd_ctl_t *handle, snd_ctl_elem_info_t *info);
|
|
Packit Service |
db8eaa |
int (*element_replace)(snd_ctl_t *handle, snd_ctl_elem_info_t *info);
|
|
Packit Service |
db8eaa |
int (*element_remove)(snd_ctl_t *handle, snd_ctl_elem_id_t *id);
|
|
Packit Service |
db8eaa |
int (*element_read)(snd_ctl_t *handle, snd_ctl_elem_value_t *control);
|
|
Packit Service |
db8eaa |
int (*element_write)(snd_ctl_t *handle, snd_ctl_elem_value_t *control);
|
|
Packit Service |
db8eaa |
int (*element_lock)(snd_ctl_t *handle, snd_ctl_elem_id_t *lock);
|
|
Packit Service |
db8eaa |
int (*element_unlock)(snd_ctl_t *handle, snd_ctl_elem_id_t *unlock);
|
|
Packit Service |
db8eaa |
int (*element_tlv)(snd_ctl_t *handle, int op_flag, unsigned int numid,
|
|
Packit Service |
db8eaa |
unsigned int *tlv, unsigned int tlv_size);
|
|
Packit Service |
db8eaa |
int (*hwdep_next_device)(snd_ctl_t *handle, int *device);
|
|
Packit Service |
db8eaa |
int (*hwdep_info)(snd_ctl_t *handle, snd_hwdep_info_t * info);
|
|
Packit Service |
db8eaa |
int (*pcm_next_device)(snd_ctl_t *handle, int *device);
|
|
Packit Service |
db8eaa |
int (*pcm_info)(snd_ctl_t *handle, snd_pcm_info_t * info);
|
|
Packit Service |
db8eaa |
int (*pcm_prefer_subdevice)(snd_ctl_t *handle, int subdev);
|
|
Packit Service |
db8eaa |
int (*rawmidi_next_device)(snd_ctl_t *handle, int *device);
|
|
Packit Service |
db8eaa |
int (*rawmidi_info)(snd_ctl_t *handle, snd_rawmidi_info_t * info);
|
|
Packit Service |
db8eaa |
int (*rawmidi_prefer_subdevice)(snd_ctl_t *handle, int subdev);
|
|
Packit Service |
db8eaa |
int (*set_power_state)(snd_ctl_t *handle, unsigned int state);
|
|
Packit Service |
db8eaa |
int (*get_power_state)(snd_ctl_t *handle, unsigned int *state);
|
|
Packit Service |
db8eaa |
int (*read)(snd_ctl_t *handle, snd_ctl_event_t *event);
|
|
Packit Service |
db8eaa |
int (*poll_descriptors_count)(snd_ctl_t *handle);
|
|
Packit Service |
db8eaa |
int (*poll_descriptors)(snd_ctl_t *handle, struct pollfd *pfds, unsigned int space);
|
|
Packit Service |
db8eaa |
int (*poll_revents)(snd_ctl_t *handle, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
|
|
Packit Service |
db8eaa |
} snd_ctl_ops_t;
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct _snd_ctl {
|
|
Packit Service |
db8eaa |
void *open_func;
|
|
Packit Service |
db8eaa |
char *name;
|
|
Packit Service |
db8eaa |
snd_ctl_type_t type;
|
|
Packit Service |
db8eaa |
const snd_ctl_ops_t *ops;
|
|
Packit Service |
db8eaa |
void *private_data;
|
|
Packit Service |
db8eaa |
int nonblock;
|
|
Packit Service |
db8eaa |
int poll_fd;
|
|
Packit Service |
db8eaa |
struct list_head async_handlers;
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct _snd_hctl_elem {
|
|
Packit Service |
db8eaa |
snd_ctl_elem_id_t id; /* must be always on top */
|
|
Packit Service |
db8eaa |
struct list_head list; /* links for list of all helems */
|
|
Packit Service |
db8eaa |
int compare_weight; /* compare weight (reversed) */
|
|
Packit Service |
db8eaa |
/* event callback */
|
|
Packit Service |
db8eaa |
snd_hctl_elem_callback_t callback;
|
|
Packit Service |
db8eaa |
void *callback_private;
|
|
Packit Service |
db8eaa |
/* links */
|
|
Packit Service |
db8eaa |
snd_hctl_t *hctl; /* associated handle */
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct _snd_hctl {
|
|
Packit Service |
db8eaa |
snd_ctl_t *ctl;
|
|
Packit Service |
db8eaa |
struct list_head elems; /* list of all controls */
|
|
Packit Service |
db8eaa |
unsigned int alloc;
|
|
Packit Service |
db8eaa |
unsigned int count;
|
|
Packit Service |
db8eaa |
snd_hctl_elem_t **pelems;
|
|
Packit Service |
db8eaa |
snd_hctl_compare_t compare;
|
|
Packit Service |
db8eaa |
snd_hctl_callback_t callback;
|
|
Packit Service |
db8eaa |
void *callback_private;
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* make local functions really local */
|
|
Packit Service |
db8eaa |
#define snd_ctl_new snd1_ctl_new
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
int snd_ctl_new(snd_ctl_t **ctlp, snd_ctl_type_t type, const char *name);
|
|
Packit Service |
db8eaa |
int _snd_ctl_poll_descriptor(snd_ctl_t *ctl);
|
|
Packit Service |
db8eaa |
#define _snd_ctl_async_descriptor _snd_ctl_poll_descriptor
|
|
Packit Service |
db8eaa |
int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode);
|
|
Packit Service |
db8eaa |
int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *sockname, const char *sname, int mode);
|
|
Packit Service |
db8eaa |
int snd_ctl_async(snd_ctl_t *ctl, int sig, pid_t pid);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define CTLINABORT(x) ((x)->nonblock == 2)
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#ifdef INTERNAL
|
|
Packit Service |
db8eaa |
int INTERNAL(snd_ctl_elem_info_get_dimensions)(const snd_ctl_elem_info_t *obj);
|
|
Packit Service |
db8eaa |
int INTERNAL(snd_ctl_elem_info_get_dimension)(const snd_ctl_elem_info_t *obj, unsigned int idx);
|
|
Packit Service |
db8eaa |
#endif /* INTERNAL */
|