Blame include/mixer_abst.h

Packit 4a16fb
/**
Packit 4a16fb
 * \file include/mixer_abst.h
Packit 4a16fb
 * \brief Mixer abstract implementation interface library for the ALSA library
Packit 4a16fb
 * \author Jaroslav Kysela <perex@perex.cz>
Packit 4a16fb
 * \date 2005
Packit 4a16fb
 *
Packit 4a16fb
 * Mixer abstact implementation interface library for the ALSA library
Packit 4a16fb
 */
Packit 4a16fb
/*
Packit 4a16fb
 *   This library is free software; you can redistribute it and/or modify
Packit 4a16fb
 *   it under the terms of the GNU Lesser General Public License as
Packit 4a16fb
 *   published by the Free Software Foundation; either version 2.1 of
Packit 4a16fb
 *   the License, or (at your option) any later version.
Packit 4a16fb
 *
Packit 4a16fb
 *   This program is distributed in the hope that it will be useful,
Packit 4a16fb
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 4a16fb
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 4a16fb
 *   GNU Lesser General Public License for more details.
Packit 4a16fb
 *
Packit 4a16fb
 *   You should have received a copy of the GNU Lesser General Public
Packit 4a16fb
 *   License along with this library; if not, write to the Free Software
Packit 4a16fb
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit 4a16fb
 *
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
#ifndef __ALSA_MIXER_ABST_H
Packit 4a16fb
#define __ALSA_MIXER_ABST_H
Packit 4a16fb
Packit 4a16fb
#ifdef __cplusplus
Packit 4a16fb
extern "C" {
Packit 4a16fb
#endif
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 *  \defgroup Mixer_Abstract Mixer Abstact Module Interface
Packit 4a16fb
 *  The mixer abstact module interface.
Packit 4a16fb
 *  \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
#define	SM_PLAY			0
Packit 4a16fb
#define SM_CAPT			1
Packit 4a16fb
Packit 4a16fb
#define SM_CAP_GVOLUME		(1<<1)
Packit 4a16fb
#define SM_CAP_GSWITCH		(1<<2)
Packit 4a16fb
#define SM_CAP_PVOLUME		(1<<3)
Packit 4a16fb
#define SM_CAP_PVOLUME_JOIN	(1<<4)
Packit 4a16fb
#define SM_CAP_PSWITCH		(1<<5) 
Packit 4a16fb
#define SM_CAP_PSWITCH_JOIN	(1<<6) 
Packit 4a16fb
#define SM_CAP_CVOLUME		(1<<7) 
Packit 4a16fb
#define SM_CAP_CVOLUME_JOIN	(1<<8) 
Packit 4a16fb
#define SM_CAP_CSWITCH		(1<<9) 
Packit 4a16fb
#define SM_CAP_CSWITCH_JOIN	(1<<10)
Packit 4a16fb
#define SM_CAP_CSWITCH_EXCL	(1<<11)
Packit 4a16fb
#define SM_CAP_PENUM		(1<<12)
Packit 4a16fb
#define SM_CAP_CENUM		(1<<13)
Packit 4a16fb
/* SM_CAP_* 24-31 => private for module use */
Packit 4a16fb
Packit 4a16fb
#define SM_OPS_IS_ACTIVE	0
Packit 4a16fb
#define SM_OPS_IS_MONO		1
Packit 4a16fb
#define SM_OPS_IS_CHANNEL	2
Packit 4a16fb
#define SM_OPS_IS_ENUMERATED	3
Packit 4a16fb
#define SM_OPS_IS_ENUMCNT	4
Packit 4a16fb
Packit 4a16fb
#define sm_selem(x)		((sm_selem_t *)((x)->private_data))
Packit 4a16fb
#define sm_selem_ops(x)		((sm_selem_t *)((x)->private_data))->ops
Packit 4a16fb
Packit 4a16fb
typedef struct _sm_selem {
Packit 4a16fb
	snd_mixer_selem_id_t *id;
Packit 4a16fb
	struct sm_elem_ops *ops;
Packit 4a16fb
	unsigned int caps;
Packit 4a16fb
	unsigned int capture_group;
Packit 4a16fb
} sm_selem_t;
Packit 4a16fb
Packit 4a16fb
typedef struct _sm_class_basic {
Packit 4a16fb
	char *device;
Packit 4a16fb
	snd_ctl_t *ctl;
Packit 4a16fb
	snd_hctl_t *hctl;
Packit 4a16fb
	snd_ctl_card_info_t *info;
Packit 4a16fb
} sm_class_basic_t;
Packit 4a16fb
Packit 4a16fb
struct sm_elem_ops {	
Packit 4a16fb
	int (*is)(snd_mixer_elem_t *elem, int dir, int cmd, int val);
Packit 4a16fb
	int (*get_range)(snd_mixer_elem_t *elem, int dir, long *min, long *max);
Packit 4a16fb
	int (*set_range)(snd_mixer_elem_t *elem, int dir, long min, long max);
Packit 4a16fb
	int (*get_dB_range)(snd_mixer_elem_t *elem, int dir, long *min, long *max);
Packit 4a16fb
	int (*ask_vol_dB)(snd_mixer_elem_t *elem, int dir, long value, long *dbValue);
Packit 4a16fb
	int (*ask_dB_vol)(snd_mixer_elem_t *elem, int dir, long dbValue, long *value, int xdir);
Packit 4a16fb
	int (*get_volume)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long *value);
Packit 4a16fb
	int (*get_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long *value);
Packit 4a16fb
	int (*set_volume)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value);
Packit 4a16fb
	int (*set_dB)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, long value, int xdir);
Packit 4a16fb
	int (*get_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int *value);
Packit 4a16fb
	int (*set_switch)(snd_mixer_elem_t *elem, int dir, snd_mixer_selem_channel_id_t channel, int value);
Packit 4a16fb
	int (*enum_item_name)(snd_mixer_elem_t *elem, unsigned int item, size_t maxlen, char *buf);
Packit 4a16fb
	int (*get_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *itemp);
Packit 4a16fb
	int (*set_enum_item)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int item);
Packit 4a16fb
};
Packit 4a16fb
Packit 4a16fb
int snd_mixer_selem_compare(const snd_mixer_elem_t *c1, const snd_mixer_elem_t *c2);
Packit 4a16fb
Packit 4a16fb
int snd_mixer_sbasic_info(const snd_mixer_class_t *class, sm_class_basic_t *info);
Packit 4a16fb
void *snd_mixer_sbasic_get_private(const snd_mixer_class_t *class);
Packit 4a16fb
void snd_mixer_sbasic_set_private(const snd_mixer_class_t *class, void *private_data);
Packit 4a16fb
void snd_mixer_sbasic_set_private_free(const snd_mixer_class_t *class, void (*private_free)(snd_mixer_class_t *class));
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
#ifdef __cplusplus
Packit 4a16fb
}
Packit 4a16fb
#endif
Packit 4a16fb
Packit 4a16fb
#endif /* __ALSA_MIXER_ABST_H */
Packit 4a16fb