1d5ac70f0Sopenharmony_ci/**
2d5ac70f0Sopenharmony_ci * \file include/mixer.h
3d5ac70f0Sopenharmony_ci * \brief Application interface library for the ALSA driver
4d5ac70f0Sopenharmony_ci * \author Jaroslav Kysela <perex@perex.cz>
5d5ac70f0Sopenharmony_ci * \author Abramo Bagnara <abramo@alsa-project.org>
6d5ac70f0Sopenharmony_ci * \author Takashi Iwai <tiwai@suse.de>
7d5ac70f0Sopenharmony_ci * \date 1998-2001
8d5ac70f0Sopenharmony_ci *
9d5ac70f0Sopenharmony_ci * Application interface library for the ALSA driver
10d5ac70f0Sopenharmony_ci */
11d5ac70f0Sopenharmony_ci/*
12d5ac70f0Sopenharmony_ci *   This library is free software; you can redistribute it and/or modify
13d5ac70f0Sopenharmony_ci *   it under the terms of the GNU Lesser General Public License as
14d5ac70f0Sopenharmony_ci *   published by the Free Software Foundation; either version 2.1 of
15d5ac70f0Sopenharmony_ci *   the License, or (at your option) any later version.
16d5ac70f0Sopenharmony_ci *
17d5ac70f0Sopenharmony_ci *   This program is distributed in the hope that it will be useful,
18d5ac70f0Sopenharmony_ci *   but WITHOUT ANY WARRANTY; without even the implied warranty of
19d5ac70f0Sopenharmony_ci *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20d5ac70f0Sopenharmony_ci *   GNU Lesser General Public License for more details.
21d5ac70f0Sopenharmony_ci *
22d5ac70f0Sopenharmony_ci *   You should have received a copy of the GNU Lesser General Public
23d5ac70f0Sopenharmony_ci *   License along with this library; if not, write to the Free Software
24d5ac70f0Sopenharmony_ci *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
25d5ac70f0Sopenharmony_ci *
26d5ac70f0Sopenharmony_ci */
27d5ac70f0Sopenharmony_ci
28d5ac70f0Sopenharmony_ci#ifndef __ALSA_MIXER_H
29d5ac70f0Sopenharmony_ci#define __ALSA_MIXER_H
30d5ac70f0Sopenharmony_ci
31d5ac70f0Sopenharmony_ci#ifdef __cplusplus
32d5ac70f0Sopenharmony_ciextern "C" {
33d5ac70f0Sopenharmony_ci#endif
34d5ac70f0Sopenharmony_ci
35d5ac70f0Sopenharmony_ci/**
36d5ac70f0Sopenharmony_ci *  \defgroup Mixer Mixer Interface
37d5ac70f0Sopenharmony_ci *  The mixer interface.
38d5ac70f0Sopenharmony_ci *  \{
39d5ac70f0Sopenharmony_ci */
40d5ac70f0Sopenharmony_ci
41d5ac70f0Sopenharmony_ci/** Mixer handle */
42d5ac70f0Sopenharmony_citypedef struct _snd_mixer snd_mixer_t;
43d5ac70f0Sopenharmony_ci/** Mixer elements class handle */
44d5ac70f0Sopenharmony_citypedef struct _snd_mixer_class snd_mixer_class_t;
45d5ac70f0Sopenharmony_ci/** Mixer element handle */
46d5ac70f0Sopenharmony_citypedef struct _snd_mixer_elem snd_mixer_elem_t;
47d5ac70f0Sopenharmony_ci
48d5ac70f0Sopenharmony_ci/**
49d5ac70f0Sopenharmony_ci * \brief Mixer callback function
50d5ac70f0Sopenharmony_ci * \param ctl Mixer handle
51d5ac70f0Sopenharmony_ci * \param mask event mask
52d5ac70f0Sopenharmony_ci * \param elem related mixer element (if any)
53d5ac70f0Sopenharmony_ci * \return 0 on success otherwise a negative error code
54d5ac70f0Sopenharmony_ci */
55d5ac70f0Sopenharmony_citypedef int (*snd_mixer_callback_t)(snd_mixer_t *ctl,
56d5ac70f0Sopenharmony_ci				    unsigned int mask,
57d5ac70f0Sopenharmony_ci				    snd_mixer_elem_t *elem);
58d5ac70f0Sopenharmony_ci
59d5ac70f0Sopenharmony_ci/**
60d5ac70f0Sopenharmony_ci * \brief Mixer element callback function
61d5ac70f0Sopenharmony_ci * \param elem Mixer element
62d5ac70f0Sopenharmony_ci * \param mask event mask
63d5ac70f0Sopenharmony_ci * \return 0 on success otherwise a negative error code
64d5ac70f0Sopenharmony_ci */
65d5ac70f0Sopenharmony_citypedef int (*snd_mixer_elem_callback_t)(snd_mixer_elem_t *elem,
66d5ac70f0Sopenharmony_ci					 unsigned int mask);
67d5ac70f0Sopenharmony_ci
68d5ac70f0Sopenharmony_ci/**
69d5ac70f0Sopenharmony_ci * \brief Compare function for sorting mixer elements
70d5ac70f0Sopenharmony_ci * \param e1 First element
71d5ac70f0Sopenharmony_ci * \param e2 Second element
72d5ac70f0Sopenharmony_ci * \return -1 if e1 < e2, 0 if e1 == e2, 1 if e1 > e2
73d5ac70f0Sopenharmony_ci */
74d5ac70f0Sopenharmony_citypedef int (*snd_mixer_compare_t)(const snd_mixer_elem_t *e1,
75d5ac70f0Sopenharmony_ci				   const snd_mixer_elem_t *e2);
76d5ac70f0Sopenharmony_ci
77d5ac70f0Sopenharmony_ci/**
78d5ac70f0Sopenharmony_ci * \brief Event callback for the mixer class
79d5ac70f0Sopenharmony_ci * \param class_ Mixer class
80d5ac70f0Sopenharmony_ci * \param mask Event mask (SND_CTL_EVENT_*)
81d5ac70f0Sopenharmony_ci * \param helem HCTL element which invoked the event
82d5ac70f0Sopenharmony_ci * \param melem Mixer element associated to HCTL element
83d5ac70f0Sopenharmony_ci * \return zero if success, otherwise a negative error value
84d5ac70f0Sopenharmony_ci */
85d5ac70f0Sopenharmony_citypedef int (*snd_mixer_event_t)(snd_mixer_class_t *class_, unsigned int mask,
86d5ac70f0Sopenharmony_ci				 snd_hctl_elem_t *helem, snd_mixer_elem_t *melem);
87d5ac70f0Sopenharmony_ci
88d5ac70f0Sopenharmony_ci
89d5ac70f0Sopenharmony_ci/** Mixer element type */
90d5ac70f0Sopenharmony_citypedef enum _snd_mixer_elem_type {
91d5ac70f0Sopenharmony_ci	/* Simple mixer elements */
92d5ac70f0Sopenharmony_ci	SND_MIXER_ELEM_SIMPLE,
93d5ac70f0Sopenharmony_ci	SND_MIXER_ELEM_LAST = SND_MIXER_ELEM_SIMPLE
94d5ac70f0Sopenharmony_ci} snd_mixer_elem_type_t;
95d5ac70f0Sopenharmony_ci
96d5ac70f0Sopenharmony_ciint snd_mixer_open(snd_mixer_t **mixer, int mode);
97d5ac70f0Sopenharmony_ciint snd_mixer_close(snd_mixer_t *mixer);
98d5ac70f0Sopenharmony_cisnd_mixer_elem_t *snd_mixer_first_elem(snd_mixer_t *mixer);
99d5ac70f0Sopenharmony_cisnd_mixer_elem_t *snd_mixer_last_elem(snd_mixer_t *mixer);
100d5ac70f0Sopenharmony_ciint snd_mixer_handle_events(snd_mixer_t *mixer);
101d5ac70f0Sopenharmony_ciint snd_mixer_attach(snd_mixer_t *mixer, const char *name);
102d5ac70f0Sopenharmony_ciint snd_mixer_attach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl);
103d5ac70f0Sopenharmony_ciint snd_mixer_detach(snd_mixer_t *mixer, const char *name);
104d5ac70f0Sopenharmony_ciint snd_mixer_detach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl);
105d5ac70f0Sopenharmony_ciint snd_mixer_get_hctl(snd_mixer_t *mixer, const char *name, snd_hctl_t **hctl);
106d5ac70f0Sopenharmony_ciint snd_mixer_poll_descriptors_count(snd_mixer_t *mixer);
107d5ac70f0Sopenharmony_ciint snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int space);
108d5ac70f0Sopenharmony_ciint snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
109d5ac70f0Sopenharmony_ciint snd_mixer_load(snd_mixer_t *mixer);
110d5ac70f0Sopenharmony_civoid snd_mixer_free(snd_mixer_t *mixer);
111d5ac70f0Sopenharmony_ciint snd_mixer_wait(snd_mixer_t *mixer, int timeout);
112d5ac70f0Sopenharmony_ciint snd_mixer_set_compare(snd_mixer_t *mixer, snd_mixer_compare_t msort);
113d5ac70f0Sopenharmony_civoid snd_mixer_set_callback(snd_mixer_t *obj, snd_mixer_callback_t val);
114d5ac70f0Sopenharmony_civoid * snd_mixer_get_callback_private(const snd_mixer_t *obj);
115d5ac70f0Sopenharmony_civoid snd_mixer_set_callback_private(snd_mixer_t *obj, void * val);
116d5ac70f0Sopenharmony_ciunsigned int snd_mixer_get_count(const snd_mixer_t *obj);
117d5ac70f0Sopenharmony_ciint snd_mixer_class_unregister(snd_mixer_class_t *clss);
118d5ac70f0Sopenharmony_ci
119d5ac70f0Sopenharmony_cisnd_mixer_elem_t *snd_mixer_elem_next(snd_mixer_elem_t *elem);
120d5ac70f0Sopenharmony_cisnd_mixer_elem_t *snd_mixer_elem_prev(snd_mixer_elem_t *elem);
121d5ac70f0Sopenharmony_civoid snd_mixer_elem_set_callback(snd_mixer_elem_t *obj, snd_mixer_elem_callback_t val);
122d5ac70f0Sopenharmony_civoid * snd_mixer_elem_get_callback_private(const snd_mixer_elem_t *obj);
123d5ac70f0Sopenharmony_civoid snd_mixer_elem_set_callback_private(snd_mixer_elem_t *obj, void * val);
124d5ac70f0Sopenharmony_cisnd_mixer_elem_type_t snd_mixer_elem_get_type(const snd_mixer_elem_t *obj);
125d5ac70f0Sopenharmony_ci
126d5ac70f0Sopenharmony_ciint snd_mixer_class_register(snd_mixer_class_t *class_, snd_mixer_t *mixer);
127d5ac70f0Sopenharmony_ciint snd_mixer_elem_new(snd_mixer_elem_t **elem,
128d5ac70f0Sopenharmony_ci		       snd_mixer_elem_type_t type,
129d5ac70f0Sopenharmony_ci		       int compare_weight,
130d5ac70f0Sopenharmony_ci		       void *private_data,
131d5ac70f0Sopenharmony_ci		       void (*private_free)(snd_mixer_elem_t *elem));
132d5ac70f0Sopenharmony_ciint snd_mixer_elem_add(snd_mixer_elem_t *elem, snd_mixer_class_t *class_);
133d5ac70f0Sopenharmony_ciint snd_mixer_elem_remove(snd_mixer_elem_t *elem);
134d5ac70f0Sopenharmony_civoid snd_mixer_elem_free(snd_mixer_elem_t *elem);
135d5ac70f0Sopenharmony_ciint snd_mixer_elem_info(snd_mixer_elem_t *elem);
136d5ac70f0Sopenharmony_ciint snd_mixer_elem_value(snd_mixer_elem_t *elem);
137d5ac70f0Sopenharmony_ciint snd_mixer_elem_attach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem);
138d5ac70f0Sopenharmony_ciint snd_mixer_elem_detach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem);
139d5ac70f0Sopenharmony_ciint snd_mixer_elem_empty(snd_mixer_elem_t *melem);
140d5ac70f0Sopenharmony_civoid *snd_mixer_elem_get_private(const snd_mixer_elem_t *melem);
141d5ac70f0Sopenharmony_ci
142d5ac70f0Sopenharmony_cisize_t snd_mixer_class_sizeof(void);
143d5ac70f0Sopenharmony_ci/** \hideinitializer
144d5ac70f0Sopenharmony_ci * \brief allocate an invalid #snd_mixer_class_t using standard alloca
145d5ac70f0Sopenharmony_ci * \param ptr returned pointer
146d5ac70f0Sopenharmony_ci */
147d5ac70f0Sopenharmony_ci#define snd_mixer_class_alloca(ptr) __snd_alloca(ptr, snd_mixer_class)
148d5ac70f0Sopenharmony_ciint snd_mixer_class_malloc(snd_mixer_class_t **ptr);
149d5ac70f0Sopenharmony_civoid snd_mixer_class_free(snd_mixer_class_t *obj);
150d5ac70f0Sopenharmony_civoid snd_mixer_class_copy(snd_mixer_class_t *dst, const snd_mixer_class_t *src);
151d5ac70f0Sopenharmony_cisnd_mixer_t *snd_mixer_class_get_mixer(const snd_mixer_class_t *class_);
152d5ac70f0Sopenharmony_cisnd_mixer_event_t snd_mixer_class_get_event(const snd_mixer_class_t *class_);
153d5ac70f0Sopenharmony_civoid *snd_mixer_class_get_private(const snd_mixer_class_t *class_);
154d5ac70f0Sopenharmony_cisnd_mixer_compare_t snd_mixer_class_get_compare(const snd_mixer_class_t *class_);
155d5ac70f0Sopenharmony_ciint snd_mixer_class_set_event(snd_mixer_class_t *class_, snd_mixer_event_t event);
156d5ac70f0Sopenharmony_ciint snd_mixer_class_set_private(snd_mixer_class_t *class_, void *private_data);
157d5ac70f0Sopenharmony_ciint snd_mixer_class_set_private_free(snd_mixer_class_t *class_, void (*private_free)(snd_mixer_class_t *));
158d5ac70f0Sopenharmony_ciint snd_mixer_class_set_compare(snd_mixer_class_t *class_, snd_mixer_compare_t compare);
159d5ac70f0Sopenharmony_ci
160d5ac70f0Sopenharmony_ci/**
161d5ac70f0Sopenharmony_ci *  \defgroup SimpleMixer Simple Mixer Interface
162d5ac70f0Sopenharmony_ci *  \ingroup Mixer
163d5ac70f0Sopenharmony_ci *  The simple mixer interface.
164d5ac70f0Sopenharmony_ci *  \{
165d5ac70f0Sopenharmony_ci */
166d5ac70f0Sopenharmony_ci
167d5ac70f0Sopenharmony_ci/* Simple mixer elements API */
168d5ac70f0Sopenharmony_ci
169d5ac70f0Sopenharmony_ci/** Mixer simple element channel identifier */
170d5ac70f0Sopenharmony_citypedef enum _snd_mixer_selem_channel_id {
171d5ac70f0Sopenharmony_ci	/** Unknown */
172d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_UNKNOWN = -1,
173d5ac70f0Sopenharmony_ci	/** Front left */
174d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_FRONT_LEFT = 0,
175d5ac70f0Sopenharmony_ci	/** Front right */
176d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_FRONT_RIGHT,
177d5ac70f0Sopenharmony_ci	/** Rear left */
178d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_REAR_LEFT,
179d5ac70f0Sopenharmony_ci	/** Rear right */
180d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_REAR_RIGHT,
181d5ac70f0Sopenharmony_ci	/** Front center */
182d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_FRONT_CENTER,
183d5ac70f0Sopenharmony_ci	/** Woofer */
184d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_WOOFER,
185d5ac70f0Sopenharmony_ci	/** Side Left */
186d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_SIDE_LEFT,
187d5ac70f0Sopenharmony_ci	/** Side Right */
188d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_SIDE_RIGHT,
189d5ac70f0Sopenharmony_ci	/** Rear Center */
190d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_REAR_CENTER,
191d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_LAST = 31,
192d5ac70f0Sopenharmony_ci	/** Mono (Front left alias) */
193d5ac70f0Sopenharmony_ci	SND_MIXER_SCHN_MONO = SND_MIXER_SCHN_FRONT_LEFT
194d5ac70f0Sopenharmony_ci} snd_mixer_selem_channel_id_t;
195d5ac70f0Sopenharmony_ci
196d5ac70f0Sopenharmony_ci/** Mixer simple element - register options - abstraction level */
197d5ac70f0Sopenharmony_cienum snd_mixer_selem_regopt_abstract {
198d5ac70f0Sopenharmony_ci	/** no abstraction - try use all universal controls from driver */
199d5ac70f0Sopenharmony_ci	SND_MIXER_SABSTRACT_NONE = 0,
200d5ac70f0Sopenharmony_ci	/** basic abstraction - Master,PCM,CD,Aux,Record-Gain etc. */
201d5ac70f0Sopenharmony_ci	SND_MIXER_SABSTRACT_BASIC,
202d5ac70f0Sopenharmony_ci};
203d5ac70f0Sopenharmony_ci
204d5ac70f0Sopenharmony_ci/** Mixer simple element - register options */
205d5ac70f0Sopenharmony_cistruct snd_mixer_selem_regopt {
206d5ac70f0Sopenharmony_ci	/** structure version */
207d5ac70f0Sopenharmony_ci	int ver;
208d5ac70f0Sopenharmony_ci	/** v1: abstract layer selection */
209d5ac70f0Sopenharmony_ci	enum snd_mixer_selem_regopt_abstract abstract;
210d5ac70f0Sopenharmony_ci	/** v1: device name (must be NULL when playback_pcm or capture_pcm != NULL) */
211d5ac70f0Sopenharmony_ci	const char *device;
212d5ac70f0Sopenharmony_ci	/** v1: playback PCM connected to mixer device (NULL == none) */
213d5ac70f0Sopenharmony_ci	snd_pcm_t *playback_pcm;
214d5ac70f0Sopenharmony_ci	/** v1: capture PCM connected to mixer device (NULL == none) */
215d5ac70f0Sopenharmony_ci	snd_pcm_t *capture_pcm;
216d5ac70f0Sopenharmony_ci};
217d5ac70f0Sopenharmony_ci
218d5ac70f0Sopenharmony_ci/** Mixer simple element identifier */
219d5ac70f0Sopenharmony_citypedef struct _snd_mixer_selem_id snd_mixer_selem_id_t;
220d5ac70f0Sopenharmony_ci
221d5ac70f0Sopenharmony_ciconst char *snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel);
222d5ac70f0Sopenharmony_ci
223d5ac70f0Sopenharmony_ciint snd_mixer_selem_register(snd_mixer_t *mixer,
224d5ac70f0Sopenharmony_ci			     struct snd_mixer_selem_regopt *options,
225d5ac70f0Sopenharmony_ci			     snd_mixer_class_t **classp);
226d5ac70f0Sopenharmony_civoid snd_mixer_selem_get_id(snd_mixer_elem_t *element,
227d5ac70f0Sopenharmony_ci			    snd_mixer_selem_id_t *id);
228d5ac70f0Sopenharmony_ciconst char *snd_mixer_selem_get_name(snd_mixer_elem_t *elem);
229d5ac70f0Sopenharmony_ciunsigned int snd_mixer_selem_get_index(snd_mixer_elem_t *elem);
230d5ac70f0Sopenharmony_cisnd_mixer_elem_t *snd_mixer_find_selem(snd_mixer_t *mixer,
231d5ac70f0Sopenharmony_ci				       const snd_mixer_selem_id_t *id);
232d5ac70f0Sopenharmony_ci
233d5ac70f0Sopenharmony_ciint snd_mixer_selem_is_active(snd_mixer_elem_t *elem);
234d5ac70f0Sopenharmony_ciint snd_mixer_selem_is_playback_mono(snd_mixer_elem_t *elem);
235d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_playback_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel);
236d5ac70f0Sopenharmony_ciint snd_mixer_selem_is_capture_mono(snd_mixer_elem_t *elem);
237d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_capture_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel);
238d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_capture_group(snd_mixer_elem_t *elem);
239d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_common_volume(snd_mixer_elem_t *elem);
240d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_playback_volume(snd_mixer_elem_t *elem);
241d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_playback_volume_joined(snd_mixer_elem_t *elem);
242d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_capture_volume(snd_mixer_elem_t *elem);
243d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_capture_volume_joined(snd_mixer_elem_t *elem);
244d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_common_switch(snd_mixer_elem_t *elem);
245d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_playback_switch(snd_mixer_elem_t *elem);
246d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_playback_switch_joined(snd_mixer_elem_t *elem);
247d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_capture_switch(snd_mixer_elem_t *elem);
248d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_capture_switch_joined(snd_mixer_elem_t *elem);
249d5ac70f0Sopenharmony_ciint snd_mixer_selem_has_capture_switch_exclusive(snd_mixer_elem_t *elem);
250d5ac70f0Sopenharmony_ci
251d5ac70f0Sopenharmony_ciint snd_mixer_selem_ask_playback_vol_dB(snd_mixer_elem_t *elem, long value, long *dBvalue);
252d5ac70f0Sopenharmony_ciint snd_mixer_selem_ask_capture_vol_dB(snd_mixer_elem_t *elem, long value, long *dBvalue);
253d5ac70f0Sopenharmony_ciint snd_mixer_selem_ask_playback_dB_vol(snd_mixer_elem_t *elem, long dBvalue, int dir, long *value);
254d5ac70f0Sopenharmony_ciint snd_mixer_selem_ask_capture_dB_vol(snd_mixer_elem_t *elem, long dBvalue, int dir, long *value);
255d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
256d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
257d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
258d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
259d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value);
260d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value);
261d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value);
262d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value);
263d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir);
264d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir);
265d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_playback_volume_all(snd_mixer_elem_t *elem, long value);
266d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_capture_volume_all(snd_mixer_elem_t *elem, long value);
267d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_playback_dB_all(snd_mixer_elem_t *elem, long value, int dir);
268d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_capture_dB_all(snd_mixer_elem_t *elem, long value, int dir);
269d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value);
270d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value);
271d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_playback_switch_all(snd_mixer_elem_t *elem, int value);
272d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_capture_switch_all(snd_mixer_elem_t *elem, int value);
273d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_playback_volume_range(snd_mixer_elem_t *elem,
274d5ac70f0Sopenharmony_ci					      long *min, long *max);
275d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_playback_dB_range(snd_mixer_elem_t *elem,
276d5ac70f0Sopenharmony_ci					  long *min, long *max);
277d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_playback_volume_range(snd_mixer_elem_t *elem,
278d5ac70f0Sopenharmony_ci					      long min, long max);
279d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_capture_volume_range(snd_mixer_elem_t *elem,
280d5ac70f0Sopenharmony_ci					     long *min, long *max);
281d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_capture_dB_range(snd_mixer_elem_t *elem,
282d5ac70f0Sopenharmony_ci					 long *min, long *max);
283d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_capture_volume_range(snd_mixer_elem_t *elem,
284d5ac70f0Sopenharmony_ci					     long min, long max);
285d5ac70f0Sopenharmony_ci
286d5ac70f0Sopenharmony_ciint snd_mixer_selem_is_enumerated(snd_mixer_elem_t *elem);
287d5ac70f0Sopenharmony_ciint snd_mixer_selem_is_enum_playback(snd_mixer_elem_t *elem);
288d5ac70f0Sopenharmony_ciint snd_mixer_selem_is_enum_capture(snd_mixer_elem_t *elem);
289d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_enum_items(snd_mixer_elem_t *elem);
290d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_enum_item_name(snd_mixer_elem_t *elem, unsigned int idx, size_t maxlen, char *str);
291d5ac70f0Sopenharmony_ciint snd_mixer_selem_get_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *idxp);
292d5ac70f0Sopenharmony_ciint snd_mixer_selem_set_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int idx);
293d5ac70f0Sopenharmony_ci
294d5ac70f0Sopenharmony_cisize_t snd_mixer_selem_id_sizeof(void);
295d5ac70f0Sopenharmony_ci/** \hideinitializer
296d5ac70f0Sopenharmony_ci * \brief allocate an invalid #snd_mixer_selem_id_t using standard alloca
297d5ac70f0Sopenharmony_ci * \param ptr returned pointer
298d5ac70f0Sopenharmony_ci */
299d5ac70f0Sopenharmony_ci#define snd_mixer_selem_id_alloca(ptr) __snd_alloca(ptr, snd_mixer_selem_id)
300d5ac70f0Sopenharmony_ciint snd_mixer_selem_id_malloc(snd_mixer_selem_id_t **ptr);
301d5ac70f0Sopenharmony_civoid snd_mixer_selem_id_free(snd_mixer_selem_id_t *obj);
302d5ac70f0Sopenharmony_civoid snd_mixer_selem_id_copy(snd_mixer_selem_id_t *dst, const snd_mixer_selem_id_t *src);
303d5ac70f0Sopenharmony_ciconst char *snd_mixer_selem_id_get_name(const snd_mixer_selem_id_t *obj);
304d5ac70f0Sopenharmony_ciunsigned int snd_mixer_selem_id_get_index(const snd_mixer_selem_id_t *obj);
305d5ac70f0Sopenharmony_civoid snd_mixer_selem_id_set_name(snd_mixer_selem_id_t *obj, const char *val);
306d5ac70f0Sopenharmony_civoid snd_mixer_selem_id_set_index(snd_mixer_selem_id_t *obj, unsigned int val);
307d5ac70f0Sopenharmony_ciint snd_mixer_selem_id_parse(snd_mixer_selem_id_t *dst, const char *str);
308d5ac70f0Sopenharmony_ci
309d5ac70f0Sopenharmony_ci/** \} */
310d5ac70f0Sopenharmony_ci
311d5ac70f0Sopenharmony_ci/** \} */
312d5ac70f0Sopenharmony_ci
313d5ac70f0Sopenharmony_ci#ifdef __cplusplus
314d5ac70f0Sopenharmony_ci}
315d5ac70f0Sopenharmony_ci#endif
316d5ac70f0Sopenharmony_ci
317d5ac70f0Sopenharmony_ci#endif /* __ALSA_MIXER_H */
318d5ac70f0Sopenharmony_ci
319