1d5ac70f0Sopenharmony_ci/**
2d5ac70f0Sopenharmony_ci * \file include/control.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_CONTROL_H
29d5ac70f0Sopenharmony_ci#define __ALSA_CONTROL_H
30d5ac70f0Sopenharmony_ci
31d5ac70f0Sopenharmony_ci#ifdef __cplusplus
32d5ac70f0Sopenharmony_ciextern "C" {
33d5ac70f0Sopenharmony_ci#endif
34d5ac70f0Sopenharmony_ci
35d5ac70f0Sopenharmony_ci/**
36d5ac70f0Sopenharmony_ci *  \defgroup Control Control Interface
37d5ac70f0Sopenharmony_ci *  The control interface.
38d5ac70f0Sopenharmony_ci *  See \ref control page for more details.
39d5ac70f0Sopenharmony_ci *  \{
40d5ac70f0Sopenharmony_ci */
41d5ac70f0Sopenharmony_ci
42d5ac70f0Sopenharmony_ci/** dlsym version for interface entry callback */
43d5ac70f0Sopenharmony_ci#define SND_CONTROL_DLSYM_VERSION	_dlsym_control_001
44d5ac70f0Sopenharmony_ci
45d5ac70f0Sopenharmony_ci/** IEC958 structure */
46d5ac70f0Sopenharmony_citypedef struct snd_aes_iec958 {
47d5ac70f0Sopenharmony_ci	unsigned char status[24];	/**< AES/IEC958 channel status bits */
48d5ac70f0Sopenharmony_ci	unsigned char subcode[147];	/**< AES/IEC958 subcode bits */
49d5ac70f0Sopenharmony_ci	unsigned char pad;		/**< nothing */
50d5ac70f0Sopenharmony_ci	unsigned char dig_subframe[4];	/**< AES/IEC958 subframe bits */
51d5ac70f0Sopenharmony_ci} snd_aes_iec958_t;
52d5ac70f0Sopenharmony_ci
53d5ac70f0Sopenharmony_ci/** \brief CTL card info container.
54d5ac70f0Sopenharmony_ci *
55d5ac70f0Sopenharmony_ci * This type contains meta information about a sound card, such as the index,
56d5ac70f0Sopenharmony_ci * name, longname, etc.
57d5ac70f0Sopenharmony_ci *
58d5ac70f0Sopenharmony_ci * \par Memory management
59d5ac70f0Sopenharmony_ci *
60d5ac70f0Sopenharmony_ci * Before using a snd_ctl_card_info_t object, it must be allocated using
61d5ac70f0Sopenharmony_ci * snd_ctl_card_info_alloca() or snd_ctl_card_info_malloc(). When using the
62d5ac70f0Sopenharmony_ci * latter, it must be freed again using snd_ctl_card_info_free().
63d5ac70f0Sopenharmony_ci *
64d5ac70f0Sopenharmony_ci * A card info object can be zeroed out using snd_ctl_card_info_clear().
65d5ac70f0Sopenharmony_ci *
66d5ac70f0Sopenharmony_ci * A card info object can be copied to another one using
67d5ac70f0Sopenharmony_ci * snd_ctl_card_info_copy().
68d5ac70f0Sopenharmony_ci *
69d5ac70f0Sopenharmony_ci * \par Obtaining the Information
70d5ac70f0Sopenharmony_ci *
71d5ac70f0Sopenharmony_ci * To obtain the card information, it must first be opened using
72d5ac70f0Sopenharmony_ci * snd_ctl_open(), and a snd_ctl_card_info_t container must be
73d5ac70f0Sopenharmony_ci * allocated. Then, the information can be read using
74d5ac70f0Sopenharmony_ci * snd_ctl_card_info_get_card().
75d5ac70f0Sopenharmony_ci *
76d5ac70f0Sopenharmony_ci * Thereafter, the card properties can be read using the
77d5ac70f0Sopenharmony_ci * snd_ctl_card_info_get_*() functions.
78d5ac70f0Sopenharmony_ci */
79d5ac70f0Sopenharmony_citypedef struct _snd_ctl_card_info snd_ctl_card_info_t;
80d5ac70f0Sopenharmony_ci
81d5ac70f0Sopenharmony_ci/** CTL element identifier container */
82d5ac70f0Sopenharmony_citypedef struct _snd_ctl_elem_id snd_ctl_elem_id_t;
83d5ac70f0Sopenharmony_ci
84d5ac70f0Sopenharmony_ci/** CTL element list container
85d5ac70f0Sopenharmony_ci *
86d5ac70f0Sopenharmony_ci * This is a list of CTL elements. The list contains management
87d5ac70f0Sopenharmony_ci * information (e.g. how many elements the sound card has) as well as
88d5ac70f0Sopenharmony_ci * the element identifiers. All functions which operate on the list
89d5ac70f0Sopenharmony_ci * are named snd_ctl_elem_list_*().
90d5ac70f0Sopenharmony_ci *
91d5ac70f0Sopenharmony_ci * \par Memory management
92d5ac70f0Sopenharmony_ci *
93d5ac70f0Sopenharmony_ci * There are two memory areas to deal with: The list container itself
94d5ac70f0Sopenharmony_ci * and the memory for the element identifiers.
95d5ac70f0Sopenharmony_ci *
96d5ac70f0Sopenharmony_ci * To manage the area for the list container, the following functions
97d5ac70f0Sopenharmony_ci * are used:
98d5ac70f0Sopenharmony_ci *
99d5ac70f0Sopenharmony_ci * - snd_ctl_elem_list_malloc() / snd_ctl_elem_list_free() to allocate
100d5ac70f0Sopenharmony_ci *   and free memory on the heap, or
101d5ac70f0Sopenharmony_ci * - snd_ctl_elem_list_alloca() to allocate the memory on the
102d5ac70f0Sopenharmony_ci *   stack. This memory is auto-released when the stack is unwound.
103d5ac70f0Sopenharmony_ci *
104d5ac70f0Sopenharmony_ci * To manage the space for the element identifiers, the
105d5ac70f0Sopenharmony_ci * snd_ctl_elem_list_alloc_space() and snd_ctl_elem_list_free_space()
106d5ac70f0Sopenharmony_ci * are used. Allocating the right amount of space can be achieved by
107d5ac70f0Sopenharmony_ci * first obtaining the number of elements and then calling
108d5ac70f0Sopenharmony_ci * snd_ctl_elem_list_alloc_space():
109d5ac70f0Sopenharmony_ci *
110d5ac70f0Sopenharmony_ci * \code
111d5ac70f0Sopenharmony_ci *   snd_ctl_elem_list_t* list;
112d5ac70f0Sopenharmony_ci *   int count;
113d5ac70f0Sopenharmony_ci *
114d5ac70f0Sopenharmony_ci *   // Initialise list
115d5ac70f0Sopenharmony_ci *   snd_ctl_elem_list_malloc(&list);
116d5ac70f0Sopenharmony_ci *
117d5ac70f0Sopenharmony_ci *   // Get number of elements
118d5ac70f0Sopenharmony_ci *   snd_ctl_elem_list(ctl, list);
119d5ac70f0Sopenharmony_ci *   count = snd_ctl_elem_list_get_count(list);
120d5ac70f0Sopenharmony_ci *
121d5ac70f0Sopenharmony_ci *   // Allocate space for identifiers
122d5ac70f0Sopenharmony_ci *   snd_ctl_elem_list_alloc_space(list, count);
123d5ac70f0Sopenharmony_ci *
124d5ac70f0Sopenharmony_ci *   // Get identifiers
125d5ac70f0Sopenharmony_ci *   snd_ctl_elem_list(ctl, list); // yes, this is same as above :)
126d5ac70f0Sopenharmony_ci *
127d5ac70f0Sopenharmony_ci *   // Do something useful with the list...
128d5ac70f0Sopenharmony_ci *
129d5ac70f0Sopenharmony_ci *   // Cleanup
130d5ac70f0Sopenharmony_ci *   snd_ctl_elem_list_free_space(list);
131d5ac70f0Sopenharmony_ci *   snd_ctl_elem_list_free(list);
132d5ac70f0Sopenharmony_ci * \endcode
133d5ac70f0Sopenharmony_ci *
134d5ac70f0Sopenharmony_ci *
135d5ac70f0Sopenharmony_ci * \par The Elements
136d5ac70f0Sopenharmony_ci *
137d5ac70f0Sopenharmony_ci * The elements in the list are accessed using an index. This index is
138d5ac70f0Sopenharmony_ci * the location in the list; Don't confuse it with the 'index' of the
139d5ac70f0Sopenharmony_ci * element identifier. For example:
140d5ac70f0Sopenharmony_ci *
141d5ac70f0Sopenharmony_ci * \code
142d5ac70f0Sopenharmony_ci *     snd_ctl_elem_list_t list;
143d5ac70f0Sopenharmony_ci *     unsigned int element_index;
144d5ac70f0Sopenharmony_ci *
145d5ac70f0Sopenharmony_ci *     // Allocate space, fill list ...
146d5ac70f0Sopenharmony_ci *
147d5ac70f0Sopenharmony_ci *     element_index = snd_ctl_elem_list_get_index(&list, 2);
148d5ac70f0Sopenharmony_ci * \endcode
149d5ac70f0Sopenharmony_ci *
150d5ac70f0Sopenharmony_ci * This will access the 3rd element in the list (index=2) and get the
151d5ac70f0Sopenharmony_ci * elements index from the driver (which might be 13, for example).
152d5ac70f0Sopenharmony_ci */
153d5ac70f0Sopenharmony_citypedef struct _snd_ctl_elem_list snd_ctl_elem_list_t;
154d5ac70f0Sopenharmony_ci
155d5ac70f0Sopenharmony_ci/** CTL element info container */
156d5ac70f0Sopenharmony_citypedef struct _snd_ctl_elem_info snd_ctl_elem_info_t;
157d5ac70f0Sopenharmony_ci
158d5ac70f0Sopenharmony_ci/** CTL element value container.
159d5ac70f0Sopenharmony_ci *
160d5ac70f0Sopenharmony_ci * Contains the value(s) (i.e. members) of a single element. All
161d5ac70f0Sopenharmony_ci * values of a given element are of the same type.
162d5ac70f0Sopenharmony_ci *
163d5ac70f0Sopenharmony_ci * \par Memory management
164d5ac70f0Sopenharmony_ci *
165d5ac70f0Sopenharmony_ci * To access a value, a snd_ctl_elem_value_t must be allocated using
166d5ac70f0Sopenharmony_ci * snd_ctl_elem_value_alloca() or snd_ctl_elem_value_malloc(). When
167d5ac70f0Sopenharmony_ci * using the latter, it must be freed again using
168d5ac70f0Sopenharmony_ci * snd_ctl_elem_value_free().
169d5ac70f0Sopenharmony_ci *
170d5ac70f0Sopenharmony_ci * A value object can be zeroed out using snd_ctl_elem_value_clear().
171d5ac70f0Sopenharmony_ci *
172d5ac70f0Sopenharmony_ci * A value object can be copied to another one using
173d5ac70f0Sopenharmony_ci * snd_ctl_elem_value_copy().
174d5ac70f0Sopenharmony_ci *
175d5ac70f0Sopenharmony_ci * \par Identifier
176d5ac70f0Sopenharmony_ci *
177d5ac70f0Sopenharmony_ci * Then, the ID must be filled. It is sufficient to fill only the
178d5ac70f0Sopenharmony_ci * numid, if known. Otherwise, interface type, device, subdevice,
179d5ac70f0Sopenharmony_ci * name, index must all be given.  The following functions can be used
180d5ac70f0Sopenharmony_ci * to fill the ID:
181d5ac70f0Sopenharmony_ci *
182d5ac70f0Sopenharmony_ci * - snd_ctl_elem_value_set_id(): Set the ID. Requires an
183d5ac70f0Sopenharmony_ci *   snd_ctl_elem_id_t object.
184d5ac70f0Sopenharmony_ci * - snd_ctl_elem_value_set_numid(): Set the numid.
185d5ac70f0Sopenharmony_ci * - Or use all of the following:
186d5ac70f0Sopenharmony_ci *
187d5ac70f0Sopenharmony_ci *   - snd_ctl_elem_value_set_interface()
188d5ac70f0Sopenharmony_ci *   - snd_ctl_elem_value_set_device()
189d5ac70f0Sopenharmony_ci *   - snd_ctl_elem_value_set_subdevice()
190d5ac70f0Sopenharmony_ci *   - snd_ctl_elem_value_set_name()
191d5ac70f0Sopenharmony_ci *   - snd_ctl_elem_value_set_index()
192d5ac70f0Sopenharmony_ci *
193d5ac70f0Sopenharmony_ci * When communicating with the driver (snd_ctl_elem_read(),
194d5ac70f0Sopenharmony_ci * snd_ctl_elem_write()), and the numid was given, the interface,
195d5ac70f0Sopenharmony_ci * device, ... are filled (even if you set the before). When the numid
196d5ac70f0Sopenharmony_ci * is unset (i.e. it is 0), it is filled.
197d5ac70f0Sopenharmony_ci *
198d5ac70f0Sopenharmony_ci * \par Communicating with the driver
199d5ac70f0Sopenharmony_ci *
200d5ac70f0Sopenharmony_ci * After the value container was created and filled with the ID of the
201d5ac70f0Sopenharmony_ci * desired element, the value(s) can be fetched from the driver (and
202d5ac70f0Sopenharmony_ci * thus from the hardware) or written to the driver.
203d5ac70f0Sopenharmony_ci *
204d5ac70f0Sopenharmony_ci * To fetch a value, use snd_ctl_elem_read(). Thereafter, use the
205d5ac70f0Sopenharmony_ci * snd_ctl_elem_value_get_*() functions to obtain the actual value.
206d5ac70f0Sopenharmony_ci *
207d5ac70f0Sopenharmony_ci * To write a new value, first use a snd_ctl_elem_value_set_*() to set
208d5ac70f0Sopenharmony_ci * it, then call snd_ctl_elem_write() to write it to the driver.
209d5ac70f0Sopenharmony_ci */
210d5ac70f0Sopenharmony_citypedef struct _snd_ctl_elem_value snd_ctl_elem_value_t;
211d5ac70f0Sopenharmony_ci
212d5ac70f0Sopenharmony_ci/** CTL event container */
213d5ac70f0Sopenharmony_citypedef struct _snd_ctl_event snd_ctl_event_t;
214d5ac70f0Sopenharmony_ci
215d5ac70f0Sopenharmony_ci/** CTL element type */
216d5ac70f0Sopenharmony_citypedef enum _snd_ctl_elem_type {
217d5ac70f0Sopenharmony_ci	/** Invalid type */
218d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_TYPE_NONE = 0,
219d5ac70f0Sopenharmony_ci	/** Boolean contents */
220d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_TYPE_BOOLEAN,
221d5ac70f0Sopenharmony_ci	/** Integer contents */
222d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_TYPE_INTEGER,
223d5ac70f0Sopenharmony_ci	/** Enumerated contents */
224d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_TYPE_ENUMERATED,
225d5ac70f0Sopenharmony_ci	/** Bytes contents */
226d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_TYPE_BYTES,
227d5ac70f0Sopenharmony_ci	/** IEC958 (S/PDIF) setting content */
228d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_TYPE_IEC958,
229d5ac70f0Sopenharmony_ci	/** 64-bit integer contents */
230d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_TYPE_INTEGER64,
231d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_TYPE_LAST = SND_CTL_ELEM_TYPE_INTEGER64
232d5ac70f0Sopenharmony_ci} snd_ctl_elem_type_t;
233d5ac70f0Sopenharmony_ci
234d5ac70f0Sopenharmony_ci/** CTL related interface */
235d5ac70f0Sopenharmony_citypedef enum _snd_ctl_elem_iface {
236d5ac70f0Sopenharmony_ci	/** Card level */
237d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_IFACE_CARD = 0,
238d5ac70f0Sopenharmony_ci	/** Hardware dependent device */
239d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_IFACE_HWDEP,
240d5ac70f0Sopenharmony_ci	/** Mixer */
241d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_IFACE_MIXER,
242d5ac70f0Sopenharmony_ci	/** PCM */
243d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_IFACE_PCM,
244d5ac70f0Sopenharmony_ci	/** RawMidi */
245d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_IFACE_RAWMIDI,
246d5ac70f0Sopenharmony_ci	/** Timer */
247d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_IFACE_TIMER,
248d5ac70f0Sopenharmony_ci	/** Sequencer */
249d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_IFACE_SEQUENCER,
250d5ac70f0Sopenharmony_ci	SND_CTL_ELEM_IFACE_LAST = SND_CTL_ELEM_IFACE_SEQUENCER
251d5ac70f0Sopenharmony_ci} snd_ctl_elem_iface_t;
252d5ac70f0Sopenharmony_ci
253d5ac70f0Sopenharmony_ci/** Event class */
254d5ac70f0Sopenharmony_citypedef enum _snd_ctl_event_type {
255d5ac70f0Sopenharmony_ci	/** Elements related event */
256d5ac70f0Sopenharmony_ci	SND_CTL_EVENT_ELEM = 0,
257d5ac70f0Sopenharmony_ci	SND_CTL_EVENT_LAST = SND_CTL_EVENT_ELEM
258d5ac70f0Sopenharmony_ci}snd_ctl_event_type_t;
259d5ac70f0Sopenharmony_ci
260d5ac70f0Sopenharmony_ci/** Element has been removed (Warning: test this first and if set don't
261d5ac70f0Sopenharmony_ci  * test the other masks) \hideinitializer */
262d5ac70f0Sopenharmony_ci#define SND_CTL_EVENT_MASK_REMOVE 	(~0U)
263d5ac70f0Sopenharmony_ci/** Element value has been changed \hideinitializer */
264d5ac70f0Sopenharmony_ci#define SND_CTL_EVENT_MASK_VALUE	(1<<0)
265d5ac70f0Sopenharmony_ci/** Element info has been changed \hideinitializer */
266d5ac70f0Sopenharmony_ci#define SND_CTL_EVENT_MASK_INFO		(1<<1)
267d5ac70f0Sopenharmony_ci/** Element has been added \hideinitializer */
268d5ac70f0Sopenharmony_ci#define SND_CTL_EVENT_MASK_ADD		(1<<2)
269d5ac70f0Sopenharmony_ci/** Element's TLV value has been changed \hideinitializer */
270d5ac70f0Sopenharmony_ci#define SND_CTL_EVENT_MASK_TLV		(1<<3)
271d5ac70f0Sopenharmony_ci
272d5ac70f0Sopenharmony_ci/** CTL name helper */
273d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_NONE				""
274d5ac70f0Sopenharmony_ci/** CTL name helper */
275d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_PLAYBACK				"Playback "
276d5ac70f0Sopenharmony_ci/** CTL name helper */
277d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_CAPTURE				"Capture "
278d5ac70f0Sopenharmony_ci
279d5ac70f0Sopenharmony_ci/** CTL name helper */
280d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_IEC958_NONE			""
281d5ac70f0Sopenharmony_ci/** CTL name helper */
282d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_IEC958_SWITCH			"Switch"
283d5ac70f0Sopenharmony_ci/** CTL name helper */
284d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_IEC958_VOLUME			"Volume"
285d5ac70f0Sopenharmony_ci/** CTL name helper */
286d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_IEC958_DEFAULT			"Default"
287d5ac70f0Sopenharmony_ci/** CTL name helper */
288d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_IEC958_MASK			"Mask"
289d5ac70f0Sopenharmony_ci/** CTL name helper */
290d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_IEC958_CON_MASK			"Con Mask"
291d5ac70f0Sopenharmony_ci/** CTL name helper */
292d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_IEC958_PRO_MASK			"Pro Mask"
293d5ac70f0Sopenharmony_ci/** CTL name helper */
294d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_IEC958_PCM_STREAM			"PCM Stream"
295d5ac70f0Sopenharmony_ci/** Element name for IEC958 (S/PDIF) */
296d5ac70f0Sopenharmony_ci#define SND_CTL_NAME_IEC958(expl,direction,what)	"IEC958 " expl SND_CTL_NAME_##direction SND_CTL_NAME_IEC958_##what
297d5ac70f0Sopenharmony_ci
298d5ac70f0Sopenharmony_ci/** Mask for the major Power State identifier */
299d5ac70f0Sopenharmony_ci#define SND_CTL_POWER_MASK		0xff00
300d5ac70f0Sopenharmony_ci/** ACPI/PCI Power State D0 */
301d5ac70f0Sopenharmony_ci#define SND_CTL_POWER_D0          	0x0000
302d5ac70f0Sopenharmony_ci/** ACPI/PCI Power State D1 */
303d5ac70f0Sopenharmony_ci#define SND_CTL_POWER_D1     	     	0x0100
304d5ac70f0Sopenharmony_ci/** ACPI/PCI Power State D2 */
305d5ac70f0Sopenharmony_ci#define SND_CTL_POWER_D2 	        0x0200
306d5ac70f0Sopenharmony_ci/** ACPI/PCI Power State D3 */
307d5ac70f0Sopenharmony_ci#define SND_CTL_POWER_D3         	0x0300
308d5ac70f0Sopenharmony_ci/** ACPI/PCI Power State D3hot */
309d5ac70f0Sopenharmony_ci#define SND_CTL_POWER_D3hot		(SND_CTL_POWER_D3|0x0000)
310d5ac70f0Sopenharmony_ci/** ACPI/PCI Power State D3cold */
311d5ac70f0Sopenharmony_ci#define SND_CTL_POWER_D3cold	      	(SND_CTL_POWER_D3|0x0001)
312d5ac70f0Sopenharmony_ci
313d5ac70f0Sopenharmony_ci/** TLV type - Container */
314d5ac70f0Sopenharmony_ci#define SND_CTL_TLVT_CONTAINER		0x0000
315d5ac70f0Sopenharmony_ci/** TLV type - basic dB scale */
316d5ac70f0Sopenharmony_ci#define SND_CTL_TLVT_DB_SCALE		0x0001
317d5ac70f0Sopenharmony_ci/** TLV type - linear volume */
318d5ac70f0Sopenharmony_ci#define SND_CTL_TLVT_DB_LINEAR		0x0002
319d5ac70f0Sopenharmony_ci/** TLV type - dB range container */
320d5ac70f0Sopenharmony_ci#define SND_CTL_TLVT_DB_RANGE		0x0003
321d5ac70f0Sopenharmony_ci/** TLV type - dB scale specified by min/max values */
322d5ac70f0Sopenharmony_ci#define SND_CTL_TLVT_DB_MINMAX		0x0004
323d5ac70f0Sopenharmony_ci/** TLV type - dB scale specified by min/max values (with mute) */
324d5ac70f0Sopenharmony_ci#define SND_CTL_TLVT_DB_MINMAX_MUTE	0x0005
325d5ac70f0Sopenharmony_ci
326d5ac70f0Sopenharmony_ci/** Mute state */
327d5ac70f0Sopenharmony_ci#define SND_CTL_TLV_DB_GAIN_MUTE	-9999999
328d5ac70f0Sopenharmony_ci
329d5ac70f0Sopenharmony_ci/** TLV type - fixed channel map positions */
330d5ac70f0Sopenharmony_ci#define SND_CTL_TLVT_CHMAP_FIXED	0x00101
331d5ac70f0Sopenharmony_ci/** TLV type - freely swappable channel map positions */
332d5ac70f0Sopenharmony_ci#define SND_CTL_TLVT_CHMAP_VAR		0x00102
333d5ac70f0Sopenharmony_ci/** TLV type - pair-wise swappable channel map positions */
334d5ac70f0Sopenharmony_ci#define SND_CTL_TLVT_CHMAP_PAIRED	0x00103
335d5ac70f0Sopenharmony_ci
336d5ac70f0Sopenharmony_ci/** CTL type */
337d5ac70f0Sopenharmony_citypedef enum _snd_ctl_type {
338d5ac70f0Sopenharmony_ci	/** Kernel level CTL */
339d5ac70f0Sopenharmony_ci	SND_CTL_TYPE_HW,
340d5ac70f0Sopenharmony_ci	/** Shared memory client CTL */
341d5ac70f0Sopenharmony_ci	SND_CTL_TYPE_SHM,
342d5ac70f0Sopenharmony_ci	/** INET client CTL (not yet implemented) */
343d5ac70f0Sopenharmony_ci	SND_CTL_TYPE_INET,
344d5ac70f0Sopenharmony_ci	/** External control plugin */
345d5ac70f0Sopenharmony_ci	SND_CTL_TYPE_EXT,
346d5ac70f0Sopenharmony_ci	/** Control functionality remapping */
347d5ac70f0Sopenharmony_ci	SND_CTL_TYPE_REMAP,
348d5ac70f0Sopenharmony_ci} snd_ctl_type_t;
349d5ac70f0Sopenharmony_ci
350d5ac70f0Sopenharmony_ci/** Non blocking mode (flag for open mode) \hideinitializer */
351d5ac70f0Sopenharmony_ci#define SND_CTL_NONBLOCK		0x0001
352d5ac70f0Sopenharmony_ci
353d5ac70f0Sopenharmony_ci/** Async notification (flag for open mode) \hideinitializer */
354d5ac70f0Sopenharmony_ci#define SND_CTL_ASYNC			0x0002
355d5ac70f0Sopenharmony_ci
356d5ac70f0Sopenharmony_ci/** Read only (flag for open mode) \hideinitializer */
357d5ac70f0Sopenharmony_ci#define SND_CTL_READONLY		0x0004
358d5ac70f0Sopenharmony_ci
359d5ac70f0Sopenharmony_ci/** Return EINTR instead blocking (flag for open mode) \hideinitializer */
360d5ac70f0Sopenharmony_ci#define SND_CTL_EINTR			0x0080
361d5ac70f0Sopenharmony_ci
362d5ac70f0Sopenharmony_ci/** CTL handle */
363d5ac70f0Sopenharmony_citypedef struct _snd_ctl snd_ctl_t;
364d5ac70f0Sopenharmony_ci
365d5ac70f0Sopenharmony_ci/** Don't destroy the ctl handle when close */
366d5ac70f0Sopenharmony_ci#define SND_SCTL_NOFREE			0x0001
367d5ac70f0Sopenharmony_ci
368d5ac70f0Sopenharmony_ci/** SCTL type */
369d5ac70f0Sopenharmony_citypedef struct _snd_sctl snd_sctl_t;
370d5ac70f0Sopenharmony_ci
371d5ac70f0Sopenharmony_ciint snd_card_load(int card);
372d5ac70f0Sopenharmony_ciint snd_card_next(int *card);
373d5ac70f0Sopenharmony_ciint snd_card_get_index(const char *name);
374d5ac70f0Sopenharmony_ciint snd_card_get_name(int card, char **name);
375d5ac70f0Sopenharmony_ciint snd_card_get_longname(int card, char **name);
376d5ac70f0Sopenharmony_ci
377d5ac70f0Sopenharmony_ciint snd_ctl_open(snd_ctl_t **ctl, const char *name, int mode);
378d5ac70f0Sopenharmony_ciint snd_ctl_open_lconf(snd_ctl_t **ctl, const char *name, int mode, snd_config_t *lconf);
379d5ac70f0Sopenharmony_ciint snd_ctl_open_fallback(snd_ctl_t **ctl, snd_config_t *root, const char *name, const char *orig_name, int mode);
380d5ac70f0Sopenharmony_ciint snd_ctl_close(snd_ctl_t *ctl);
381d5ac70f0Sopenharmony_ciint snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock);
382d5ac70f0Sopenharmony_cistatic __inline__ int snd_ctl_abort(snd_ctl_t *ctl) { return snd_ctl_nonblock(ctl, 2); }
383d5ac70f0Sopenharmony_ciint snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl,
384d5ac70f0Sopenharmony_ci			      snd_async_callback_t callback, void *private_data);
385d5ac70f0Sopenharmony_cisnd_ctl_t *snd_async_handler_get_ctl(snd_async_handler_t *handler);
386d5ac70f0Sopenharmony_ciint snd_ctl_poll_descriptors_count(snd_ctl_t *ctl);
387d5ac70f0Sopenharmony_ciint snd_ctl_poll_descriptors(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int space);
388d5ac70f0Sopenharmony_ciint snd_ctl_poll_descriptors_revents(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
389d5ac70f0Sopenharmony_ciint snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe);
390d5ac70f0Sopenharmony_ciint snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info);
391d5ac70f0Sopenharmony_ciint snd_ctl_elem_list(snd_ctl_t *ctl, snd_ctl_elem_list_t *list);
392d5ac70f0Sopenharmony_ciint snd_ctl_elem_info(snd_ctl_t *ctl, snd_ctl_elem_info_t *info);
393d5ac70f0Sopenharmony_ciint snd_ctl_elem_read(snd_ctl_t *ctl, snd_ctl_elem_value_t *data);
394d5ac70f0Sopenharmony_ciint snd_ctl_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *data);
395d5ac70f0Sopenharmony_ciint snd_ctl_elem_lock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
396d5ac70f0Sopenharmony_ciint snd_ctl_elem_unlock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
397d5ac70f0Sopenharmony_ciint snd_ctl_elem_tlv_read(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
398d5ac70f0Sopenharmony_ci			  unsigned int *tlv, unsigned int tlv_size);
399d5ac70f0Sopenharmony_ciint snd_ctl_elem_tlv_write(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
400d5ac70f0Sopenharmony_ci			   const unsigned int *tlv);
401d5ac70f0Sopenharmony_ciint snd_ctl_elem_tlv_command(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
402d5ac70f0Sopenharmony_ci			     const unsigned int *tlv);
403d5ac70f0Sopenharmony_ci#ifdef __ALSA_HWDEP_H
404d5ac70f0Sopenharmony_ciint snd_ctl_hwdep_next_device(snd_ctl_t *ctl, int * device);
405d5ac70f0Sopenharmony_ciint snd_ctl_hwdep_info(snd_ctl_t *ctl, snd_hwdep_info_t * info);
406d5ac70f0Sopenharmony_ci#endif
407d5ac70f0Sopenharmony_ci#ifdef __ALSA_PCM_H
408d5ac70f0Sopenharmony_ciint snd_ctl_pcm_next_device(snd_ctl_t *ctl, int *device);
409d5ac70f0Sopenharmony_ciint snd_ctl_pcm_info(snd_ctl_t *ctl, snd_pcm_info_t * info);
410d5ac70f0Sopenharmony_ciint snd_ctl_pcm_prefer_subdevice(snd_ctl_t *ctl, int subdev);
411d5ac70f0Sopenharmony_ci#endif
412d5ac70f0Sopenharmony_ci#ifdef __ALSA_RAWMIDI_H
413d5ac70f0Sopenharmony_ciint snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device);
414d5ac70f0Sopenharmony_ciint snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info);
415d5ac70f0Sopenharmony_ciint snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev);
416d5ac70f0Sopenharmony_ci#endif
417d5ac70f0Sopenharmony_ci#ifdef __ALSA_UMP_H
418d5ac70f0Sopenharmony_ciint snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device);
419d5ac70f0Sopenharmony_ciint snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info);
420d5ac70f0Sopenharmony_ciint snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info);
421d5ac70f0Sopenharmony_ci#endif
422d5ac70f0Sopenharmony_ciint snd_ctl_set_power_state(snd_ctl_t *ctl, unsigned int state);
423d5ac70f0Sopenharmony_ciint snd_ctl_get_power_state(snd_ctl_t *ctl, unsigned int *state);
424d5ac70f0Sopenharmony_ci
425d5ac70f0Sopenharmony_ciint snd_ctl_read(snd_ctl_t *ctl, snd_ctl_event_t *event);
426d5ac70f0Sopenharmony_ciint snd_ctl_wait(snd_ctl_t *ctl, int timeout);
427d5ac70f0Sopenharmony_ciconst char *snd_ctl_name(snd_ctl_t *ctl);
428d5ac70f0Sopenharmony_cisnd_ctl_type_t snd_ctl_type(snd_ctl_t *ctl);
429d5ac70f0Sopenharmony_ci
430d5ac70f0Sopenharmony_ciconst char *snd_ctl_elem_type_name(snd_ctl_elem_type_t type);
431d5ac70f0Sopenharmony_ciconst char *snd_ctl_elem_iface_name(snd_ctl_elem_iface_t iface);
432d5ac70f0Sopenharmony_ciconst char *snd_ctl_event_type_name(snd_ctl_event_type_t type);
433d5ac70f0Sopenharmony_ci
434d5ac70f0Sopenharmony_ciunsigned int snd_ctl_event_elem_get_mask(const snd_ctl_event_t *obj);
435d5ac70f0Sopenharmony_ciunsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t *obj);
436d5ac70f0Sopenharmony_civoid snd_ctl_event_elem_get_id(const snd_ctl_event_t *obj, snd_ctl_elem_id_t *ptr);
437d5ac70f0Sopenharmony_cisnd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t *obj);
438d5ac70f0Sopenharmony_ciunsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t *obj);
439d5ac70f0Sopenharmony_ciunsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t *obj);
440d5ac70f0Sopenharmony_ciconst char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj);
441d5ac70f0Sopenharmony_ciunsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t *obj);
442d5ac70f0Sopenharmony_ci
443d5ac70f0Sopenharmony_ciint snd_ctl_elem_list_alloc_space(snd_ctl_elem_list_t *obj, unsigned int entries);
444d5ac70f0Sopenharmony_civoid snd_ctl_elem_list_free_space(snd_ctl_elem_list_t *obj);
445d5ac70f0Sopenharmony_ci
446d5ac70f0Sopenharmony_cichar *snd_ctl_ascii_elem_id_get(snd_ctl_elem_id_t *id);
447d5ac70f0Sopenharmony_ciint snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst, const char *str);
448d5ac70f0Sopenharmony_ciint snd_ctl_ascii_value_parse(snd_ctl_t *handle,
449d5ac70f0Sopenharmony_ci			      snd_ctl_elem_value_t *dst,
450d5ac70f0Sopenharmony_ci			      snd_ctl_elem_info_t *info,
451d5ac70f0Sopenharmony_ci			      const char *value);
452d5ac70f0Sopenharmony_ci
453d5ac70f0Sopenharmony_cisize_t snd_ctl_elem_id_sizeof(void);
454d5ac70f0Sopenharmony_ci/** \hideinitializer
455d5ac70f0Sopenharmony_ci * \brief allocate an invalid #snd_ctl_elem_id_t using standard alloca
456d5ac70f0Sopenharmony_ci * \param ptr returned pointer
457d5ac70f0Sopenharmony_ci */
458d5ac70f0Sopenharmony_ci#define snd_ctl_elem_id_alloca(ptr) __snd_alloca(ptr, snd_ctl_elem_id)
459d5ac70f0Sopenharmony_ciint snd_ctl_elem_id_malloc(snd_ctl_elem_id_t **ptr);
460d5ac70f0Sopenharmony_civoid snd_ctl_elem_id_free(snd_ctl_elem_id_t *obj);
461d5ac70f0Sopenharmony_civoid snd_ctl_elem_id_clear(snd_ctl_elem_id_t *obj);
462d5ac70f0Sopenharmony_civoid snd_ctl_elem_id_copy(snd_ctl_elem_id_t *dst, const snd_ctl_elem_id_t *src);
463d5ac70f0Sopenharmony_ciint snd_ctl_elem_id_compare_numid(const snd_ctl_elem_id_t *id1, const snd_ctl_elem_id_t *id2);
464d5ac70f0Sopenharmony_ciint snd_ctl_elem_id_compare_set(const snd_ctl_elem_id_t *id1, const snd_ctl_elem_id_t *id2);
465d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_id_get_numid(const snd_ctl_elem_id_t *obj);
466d5ac70f0Sopenharmony_cisnd_ctl_elem_iface_t snd_ctl_elem_id_get_interface(const snd_ctl_elem_id_t *obj);
467d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_id_get_device(const snd_ctl_elem_id_t *obj);
468d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_id_get_subdevice(const snd_ctl_elem_id_t *obj);
469d5ac70f0Sopenharmony_ciconst char *snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t *obj);
470d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_id_get_index(const snd_ctl_elem_id_t *obj);
471d5ac70f0Sopenharmony_civoid snd_ctl_elem_id_set_numid(snd_ctl_elem_id_t *obj, unsigned int val);
472d5ac70f0Sopenharmony_civoid snd_ctl_elem_id_set_interface(snd_ctl_elem_id_t *obj, snd_ctl_elem_iface_t val);
473d5ac70f0Sopenharmony_civoid snd_ctl_elem_id_set_device(snd_ctl_elem_id_t *obj, unsigned int val);
474d5ac70f0Sopenharmony_civoid snd_ctl_elem_id_set_subdevice(snd_ctl_elem_id_t *obj, unsigned int val);
475d5ac70f0Sopenharmony_civoid snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val);
476d5ac70f0Sopenharmony_civoid snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val);
477d5ac70f0Sopenharmony_ci
478d5ac70f0Sopenharmony_cisize_t snd_ctl_card_info_sizeof(void);
479d5ac70f0Sopenharmony_ci
480d5ac70f0Sopenharmony_ci/** \hideinitializer
481d5ac70f0Sopenharmony_ci * \brief Allocate an invalid #snd_ctl_card_info_t on the stack.
482d5ac70f0Sopenharmony_ci *
483d5ac70f0Sopenharmony_ci * Allocate space for a card info object on the stack. The allocated
484d5ac70f0Sopenharmony_ci * memory need not be freed, because it is on the stack.
485d5ac70f0Sopenharmony_ci *
486d5ac70f0Sopenharmony_ci * See snd_ctl_card_info_t for details.
487d5ac70f0Sopenharmony_ci *
488d5ac70f0Sopenharmony_ci * \param ptr Pointer to a snd_ctl_elem_value_t pointer. The address
489d5ac70f0Sopenharmony_ci *            of the allocated space will returned here.
490d5ac70f0Sopenharmony_ci */
491d5ac70f0Sopenharmony_ci#define snd_ctl_card_info_alloca(ptr) __snd_alloca(ptr, snd_ctl_card_info)
492d5ac70f0Sopenharmony_ci
493d5ac70f0Sopenharmony_ciint snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr);
494d5ac70f0Sopenharmony_civoid snd_ctl_card_info_free(snd_ctl_card_info_t *obj);
495d5ac70f0Sopenharmony_civoid snd_ctl_card_info_clear(snd_ctl_card_info_t *obj);
496d5ac70f0Sopenharmony_civoid snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src);
497d5ac70f0Sopenharmony_ciint snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj);
498d5ac70f0Sopenharmony_ciconst char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj);
499d5ac70f0Sopenharmony_ciconst char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj);
500d5ac70f0Sopenharmony_ciconst char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj);
501d5ac70f0Sopenharmony_ciconst char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj);
502d5ac70f0Sopenharmony_ciconst char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj);
503d5ac70f0Sopenharmony_ciconst char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj);
504d5ac70f0Sopenharmony_ci
505d5ac70f0Sopenharmony_cisize_t snd_ctl_event_sizeof(void);
506d5ac70f0Sopenharmony_ci/** \hideinitializer
507d5ac70f0Sopenharmony_ci * \brief allocate an invalid #snd_ctl_event_t using standard alloca
508d5ac70f0Sopenharmony_ci * \param ptr returned pointer
509d5ac70f0Sopenharmony_ci */
510d5ac70f0Sopenharmony_ci#define snd_ctl_event_alloca(ptr) __snd_alloca(ptr, snd_ctl_event)
511d5ac70f0Sopenharmony_ciint snd_ctl_event_malloc(snd_ctl_event_t **ptr);
512d5ac70f0Sopenharmony_civoid snd_ctl_event_free(snd_ctl_event_t *obj);
513d5ac70f0Sopenharmony_civoid snd_ctl_event_clear(snd_ctl_event_t *obj);
514d5ac70f0Sopenharmony_civoid snd_ctl_event_copy(snd_ctl_event_t *dst, const snd_ctl_event_t *src);
515d5ac70f0Sopenharmony_cisnd_ctl_event_type_t snd_ctl_event_get_type(const snd_ctl_event_t *obj);
516d5ac70f0Sopenharmony_ci
517d5ac70f0Sopenharmony_cisize_t snd_ctl_elem_list_sizeof(void);
518d5ac70f0Sopenharmony_ci
519d5ac70f0Sopenharmony_ci/** \hideinitializer
520d5ac70f0Sopenharmony_ci *
521d5ac70f0Sopenharmony_ci * \brief Allocate a #snd_ctl_elem_list_t using standard alloca.
522d5ac70f0Sopenharmony_ci *
523d5ac70f0Sopenharmony_ci * The memory is allocated on the stack and will automatically be
524d5ac70f0Sopenharmony_ci * released when the stack unwinds (i.e. no free() is needed).
525d5ac70f0Sopenharmony_ci *
526d5ac70f0Sopenharmony_ci * \param ptr Pointer to allocated memory.
527d5ac70f0Sopenharmony_ci */
528d5ac70f0Sopenharmony_ci#define snd_ctl_elem_list_alloca(ptr) __snd_alloca(ptr, snd_ctl_elem_list)
529d5ac70f0Sopenharmony_ci
530d5ac70f0Sopenharmony_ciint snd_ctl_elem_list_malloc(snd_ctl_elem_list_t **ptr);
531d5ac70f0Sopenharmony_civoid snd_ctl_elem_list_free(snd_ctl_elem_list_t *obj);
532d5ac70f0Sopenharmony_civoid snd_ctl_elem_list_clear(snd_ctl_elem_list_t *obj);
533d5ac70f0Sopenharmony_civoid snd_ctl_elem_list_copy(snd_ctl_elem_list_t *dst, const snd_ctl_elem_list_t *src);
534d5ac70f0Sopenharmony_civoid snd_ctl_elem_list_set_offset(snd_ctl_elem_list_t *obj, unsigned int val);
535d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_list_get_used(const snd_ctl_elem_list_t *obj);
536d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_list_get_count(const snd_ctl_elem_list_t *obj);
537d5ac70f0Sopenharmony_civoid snd_ctl_elem_list_get_id(const snd_ctl_elem_list_t *obj, unsigned int idx, snd_ctl_elem_id_t *ptr);
538d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_list_get_numid(const snd_ctl_elem_list_t *obj, unsigned int idx);
539d5ac70f0Sopenharmony_cisnd_ctl_elem_iface_t snd_ctl_elem_list_get_interface(const snd_ctl_elem_list_t *obj, unsigned int idx);
540d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_list_get_device(const snd_ctl_elem_list_t *obj, unsigned int idx);
541d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_list_get_subdevice(const snd_ctl_elem_list_t *obj, unsigned int idx);
542d5ac70f0Sopenharmony_ciconst char *snd_ctl_elem_list_get_name(const snd_ctl_elem_list_t *obj, unsigned int idx);
543d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_list_get_index(const snd_ctl_elem_list_t *obj, unsigned int idx);
544d5ac70f0Sopenharmony_ci
545d5ac70f0Sopenharmony_cisize_t snd_ctl_elem_info_sizeof(void);
546d5ac70f0Sopenharmony_ci/** \hideinitializer
547d5ac70f0Sopenharmony_ci * \brief allocate an invalid #snd_ctl_elem_info_t using standard alloca
548d5ac70f0Sopenharmony_ci * \param ptr returned pointer
549d5ac70f0Sopenharmony_ci */
550d5ac70f0Sopenharmony_ci#define snd_ctl_elem_info_alloca(ptr) __snd_alloca(ptr, snd_ctl_elem_info)
551d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_malloc(snd_ctl_elem_info_t **ptr);
552d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_free(snd_ctl_elem_info_t *obj);
553d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_clear(snd_ctl_elem_info_t *obj);
554d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_copy(snd_ctl_elem_info_t *dst, const snd_ctl_elem_info_t *src);
555d5ac70f0Sopenharmony_cisnd_ctl_elem_type_t snd_ctl_elem_info_get_type(const snd_ctl_elem_info_t *obj);
556d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_readable(const snd_ctl_elem_info_t *obj);
557d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_writable(const snd_ctl_elem_info_t *obj);
558d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_volatile(const snd_ctl_elem_info_t *obj);
559d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_inactive(const snd_ctl_elem_info_t *obj);
560d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_locked(const snd_ctl_elem_info_t *obj);
561d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_tlv_readable(const snd_ctl_elem_info_t *obj);
562d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_tlv_writable(const snd_ctl_elem_info_t *obj);
563d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_tlv_commandable(const snd_ctl_elem_info_t *obj);
564d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_owner(const snd_ctl_elem_info_t *obj);
565d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_is_user(const snd_ctl_elem_info_t *obj);
566d5ac70f0Sopenharmony_cipid_t snd_ctl_elem_info_get_owner(const snd_ctl_elem_info_t *obj);
567d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_info_get_count(const snd_ctl_elem_info_t *obj);
568d5ac70f0Sopenharmony_cilong snd_ctl_elem_info_get_min(const snd_ctl_elem_info_t *obj);
569d5ac70f0Sopenharmony_cilong snd_ctl_elem_info_get_max(const snd_ctl_elem_info_t *obj);
570d5ac70f0Sopenharmony_cilong snd_ctl_elem_info_get_step(const snd_ctl_elem_info_t *obj);
571d5ac70f0Sopenharmony_cilong long snd_ctl_elem_info_get_min64(const snd_ctl_elem_info_t *obj);
572d5ac70f0Sopenharmony_cilong long snd_ctl_elem_info_get_max64(const snd_ctl_elem_info_t *obj);
573d5ac70f0Sopenharmony_cilong long snd_ctl_elem_info_get_step64(const snd_ctl_elem_info_t *obj);
574d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_info_get_items(const snd_ctl_elem_info_t *obj);
575d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_item(snd_ctl_elem_info_t *obj, unsigned int val);
576d5ac70f0Sopenharmony_ciconst char *snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t *obj);
577d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj);
578d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int idx);
579d5ac70f0Sopenharmony_ciint snd_ctl_elem_info_set_dimension(snd_ctl_elem_info_t *info,
580d5ac70f0Sopenharmony_ci				    const int dimension[4]);
581d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_get_id(const snd_ctl_elem_info_t *obj, snd_ctl_elem_id_t *ptr);
582d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_info_get_numid(const snd_ctl_elem_info_t *obj);
583d5ac70f0Sopenharmony_cisnd_ctl_elem_iface_t snd_ctl_elem_info_get_interface(const snd_ctl_elem_info_t *obj);
584d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_info_get_device(const snd_ctl_elem_info_t *obj);
585d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_info_get_subdevice(const snd_ctl_elem_info_t *obj);
586d5ac70f0Sopenharmony_ciconst char *snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t *obj);
587d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_info_get_index(const snd_ctl_elem_info_t *obj);
588d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_id(snd_ctl_elem_info_t *obj, const snd_ctl_elem_id_t *ptr);
589d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_numid(snd_ctl_elem_info_t *obj, unsigned int val);
590d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_interface(snd_ctl_elem_info_t *obj, snd_ctl_elem_iface_t val);
591d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_device(snd_ctl_elem_info_t *obj, unsigned int val);
592d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_subdevice(snd_ctl_elem_info_t *obj, unsigned int val);
593d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_name(snd_ctl_elem_info_t *obj, const char *val);
594d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_index(snd_ctl_elem_info_t *obj, unsigned int val);
595d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_read_write(snd_ctl_elem_info_t *obj, int rval, int wval);
596d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_tlv_read_write(snd_ctl_elem_info_t *obj, int rval, int wval);
597d5ac70f0Sopenharmony_civoid snd_ctl_elem_info_set_inactive(snd_ctl_elem_info_t *obj, int val);
598d5ac70f0Sopenharmony_ci
599d5ac70f0Sopenharmony_ciint snd_ctl_add_integer_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
600d5ac70f0Sopenharmony_ci				 unsigned int element_count,
601d5ac70f0Sopenharmony_ci				 unsigned int member_count,
602d5ac70f0Sopenharmony_ci				 long min, long max, long step);
603d5ac70f0Sopenharmony_ciint snd_ctl_add_integer64_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
604d5ac70f0Sopenharmony_ci				   unsigned int element_count,
605d5ac70f0Sopenharmony_ci				   unsigned int member_count,
606d5ac70f0Sopenharmony_ci				   long long min, long long max,
607d5ac70f0Sopenharmony_ci				   long long step);
608d5ac70f0Sopenharmony_ciint snd_ctl_add_boolean_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
609d5ac70f0Sopenharmony_ci				 unsigned int element_count,
610d5ac70f0Sopenharmony_ci				 unsigned int member_count);
611d5ac70f0Sopenharmony_ciint snd_ctl_add_enumerated_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
612d5ac70f0Sopenharmony_ci				    unsigned int element_count,
613d5ac70f0Sopenharmony_ci				    unsigned int member_count,
614d5ac70f0Sopenharmony_ci				    unsigned int items,
615d5ac70f0Sopenharmony_ci				    const char *const labels[]);
616d5ac70f0Sopenharmony_ciint snd_ctl_add_bytes_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
617d5ac70f0Sopenharmony_ci			       unsigned int element_count,
618d5ac70f0Sopenharmony_ci			       unsigned int member_count);
619d5ac70f0Sopenharmony_ci
620d5ac70f0Sopenharmony_ciint snd_ctl_elem_add_integer(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count, long imin, long imax, long istep);
621d5ac70f0Sopenharmony_ciint snd_ctl_elem_add_integer64(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count, long long imin, long long imax, long long istep);
622d5ac70f0Sopenharmony_ciint snd_ctl_elem_add_boolean(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count);
623d5ac70f0Sopenharmony_ciint snd_ctl_elem_add_enumerated(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count, unsigned int items, const char *const names[]);
624d5ac70f0Sopenharmony_ciint snd_ctl_elem_add_iec958(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id);
625d5ac70f0Sopenharmony_ciint snd_ctl_elem_remove(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
626d5ac70f0Sopenharmony_ci
627d5ac70f0Sopenharmony_cisize_t snd_ctl_elem_value_sizeof(void);
628d5ac70f0Sopenharmony_ci
629d5ac70f0Sopenharmony_ci/** \hideinitializer
630d5ac70f0Sopenharmony_ci * \brief Allocate an invalid #snd_ctl_elem_value_t on the stack.
631d5ac70f0Sopenharmony_ci *
632d5ac70f0Sopenharmony_ci * Allocate space for a value object on the stack. The allocated
633d5ac70f0Sopenharmony_ci * memory need not be freed, because it is on the stack.
634d5ac70f0Sopenharmony_ci *
635d5ac70f0Sopenharmony_ci * See snd_ctl_elem_value_t for details.
636d5ac70f0Sopenharmony_ci *
637d5ac70f0Sopenharmony_ci * \param ptr Pointer to a snd_ctl_elem_value_t pointer. The address
638d5ac70f0Sopenharmony_ci *            of the allocated space will returned here.
639d5ac70f0Sopenharmony_ci */
640d5ac70f0Sopenharmony_ci#define snd_ctl_elem_value_alloca(ptr) __snd_alloca(ptr, snd_ctl_elem_value)
641d5ac70f0Sopenharmony_ci
642d5ac70f0Sopenharmony_ciint snd_ctl_elem_value_malloc(snd_ctl_elem_value_t **ptr);
643d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_free(snd_ctl_elem_value_t *obj);
644d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_clear(snd_ctl_elem_value_t *obj);
645d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_copy(snd_ctl_elem_value_t *dst, const snd_ctl_elem_value_t *src);
646d5ac70f0Sopenharmony_ciint snd_ctl_elem_value_compare(snd_ctl_elem_value_t *left, const snd_ctl_elem_value_t *right);
647d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_get_id(const snd_ctl_elem_value_t *obj, snd_ctl_elem_id_t *ptr);
648d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_value_get_numid(const snd_ctl_elem_value_t *obj);
649d5ac70f0Sopenharmony_cisnd_ctl_elem_iface_t snd_ctl_elem_value_get_interface(const snd_ctl_elem_value_t *obj);
650d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_value_get_device(const snd_ctl_elem_value_t *obj);
651d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_value_get_subdevice(const snd_ctl_elem_value_t *obj);
652d5ac70f0Sopenharmony_ciconst char *snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t *obj);
653d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_value_get_index(const snd_ctl_elem_value_t *obj);
654d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_id(snd_ctl_elem_value_t *obj, const snd_ctl_elem_id_t *ptr);
655d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_numid(snd_ctl_elem_value_t *obj, unsigned int val);
656d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_interface(snd_ctl_elem_value_t *obj, snd_ctl_elem_iface_t val);
657d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_device(snd_ctl_elem_value_t *obj, unsigned int val);
658d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_subdevice(snd_ctl_elem_value_t *obj, unsigned int val);
659d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_name(snd_ctl_elem_value_t *obj, const char *val);
660d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_index(snd_ctl_elem_value_t *obj, unsigned int val);
661d5ac70f0Sopenharmony_ciint snd_ctl_elem_value_get_boolean(const snd_ctl_elem_value_t *obj, unsigned int idx);
662d5ac70f0Sopenharmony_cilong snd_ctl_elem_value_get_integer(const snd_ctl_elem_value_t *obj, unsigned int idx);
663d5ac70f0Sopenharmony_cilong long snd_ctl_elem_value_get_integer64(const snd_ctl_elem_value_t *obj, unsigned int idx);
664d5ac70f0Sopenharmony_ciunsigned int snd_ctl_elem_value_get_enumerated(const snd_ctl_elem_value_t *obj, unsigned int idx);
665d5ac70f0Sopenharmony_ciunsigned char snd_ctl_elem_value_get_byte(const snd_ctl_elem_value_t *obj, unsigned int idx);
666d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_boolean(snd_ctl_elem_value_t *obj, unsigned int idx, long val);
667d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_integer(snd_ctl_elem_value_t *obj, unsigned int idx, long val);
668d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_integer64(snd_ctl_elem_value_t *obj, unsigned int idx, long long val);
669d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_enumerated(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned int val);
670d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_byte(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned char val);
671d5ac70f0Sopenharmony_civoid snd_ctl_elem_set_bytes(snd_ctl_elem_value_t *obj, void *data, size_t size);
672d5ac70f0Sopenharmony_ciconst void * snd_ctl_elem_value_get_bytes(const snd_ctl_elem_value_t *obj);
673d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_get_iec958(const snd_ctl_elem_value_t *obj, snd_aes_iec958_t *ptr);
674d5ac70f0Sopenharmony_civoid snd_ctl_elem_value_set_iec958(snd_ctl_elem_value_t *obj, const snd_aes_iec958_t *ptr);
675d5ac70f0Sopenharmony_ci
676d5ac70f0Sopenharmony_ciint snd_tlv_parse_dB_info(unsigned int *tlv, unsigned int tlv_size,
677d5ac70f0Sopenharmony_ci			  unsigned int **db_tlvp);
678d5ac70f0Sopenharmony_ciint snd_tlv_get_dB_range(unsigned int *tlv, long rangemin, long rangemax,
679d5ac70f0Sopenharmony_ci			 long *min, long *max);
680d5ac70f0Sopenharmony_ciint snd_tlv_convert_to_dB(unsigned int *tlv, long rangemin, long rangemax,
681d5ac70f0Sopenharmony_ci			  long volume, long *db_gain);
682d5ac70f0Sopenharmony_ciint snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax,
683d5ac70f0Sopenharmony_ci			    long db_gain, long *value, int xdir);
684d5ac70f0Sopenharmony_ciint snd_ctl_get_dB_range(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
685d5ac70f0Sopenharmony_ci			 long *min, long *max);
686d5ac70f0Sopenharmony_ciint snd_ctl_convert_to_dB(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
687d5ac70f0Sopenharmony_ci			  long volume, long *db_gain);
688d5ac70f0Sopenharmony_ciint snd_ctl_convert_from_dB(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
689d5ac70f0Sopenharmony_ci			    long db_gain, long *value, int xdir);
690d5ac70f0Sopenharmony_ci
691d5ac70f0Sopenharmony_ci/**
692d5ac70f0Sopenharmony_ci *  \defgroup HControl High level Control Interface
693d5ac70f0Sopenharmony_ci *  \ingroup Control
694d5ac70f0Sopenharmony_ci *  The high level control interface.
695d5ac70f0Sopenharmony_ci *  See \ref hcontrol page for more details.
696d5ac70f0Sopenharmony_ci *  \{
697d5ac70f0Sopenharmony_ci */
698d5ac70f0Sopenharmony_ci
699d5ac70f0Sopenharmony_ci/** HCTL element handle */
700d5ac70f0Sopenharmony_citypedef struct _snd_hctl_elem snd_hctl_elem_t;
701d5ac70f0Sopenharmony_ci
702d5ac70f0Sopenharmony_ci/** HCTL handle */
703d5ac70f0Sopenharmony_citypedef struct _snd_hctl snd_hctl_t;
704d5ac70f0Sopenharmony_ci
705d5ac70f0Sopenharmony_ci/**
706d5ac70f0Sopenharmony_ci * \brief Compare function for sorting HCTL elements
707d5ac70f0Sopenharmony_ci * \param e1 First element
708d5ac70f0Sopenharmony_ci * \param e2 Second element
709d5ac70f0Sopenharmony_ci * \return -1 if e1 < e2, 0 if e1 == e2, 1 if e1 > e2
710d5ac70f0Sopenharmony_ci */
711d5ac70f0Sopenharmony_citypedef int (*snd_hctl_compare_t)(const snd_hctl_elem_t *e1,
712d5ac70f0Sopenharmony_ci				  const snd_hctl_elem_t *e2);
713d5ac70f0Sopenharmony_ciint snd_hctl_compare_fast(const snd_hctl_elem_t *c1,
714d5ac70f0Sopenharmony_ci			  const snd_hctl_elem_t *c2);
715d5ac70f0Sopenharmony_ci/**
716d5ac70f0Sopenharmony_ci * \brief HCTL callback function
717d5ac70f0Sopenharmony_ci * \param hctl HCTL handle
718d5ac70f0Sopenharmony_ci * \param mask event mask
719d5ac70f0Sopenharmony_ci * \param elem related HCTL element (if any)
720d5ac70f0Sopenharmony_ci * \return 0 on success otherwise a negative error code
721d5ac70f0Sopenharmony_ci */
722d5ac70f0Sopenharmony_citypedef int (*snd_hctl_callback_t)(snd_hctl_t *hctl,
723d5ac70f0Sopenharmony_ci				   unsigned int mask,
724d5ac70f0Sopenharmony_ci				   snd_hctl_elem_t *elem);
725d5ac70f0Sopenharmony_ci/**
726d5ac70f0Sopenharmony_ci * \brief HCTL element callback function
727d5ac70f0Sopenharmony_ci * \param elem HCTL element
728d5ac70f0Sopenharmony_ci * \param mask event mask
729d5ac70f0Sopenharmony_ci * \return 0 on success otherwise a negative error code
730d5ac70f0Sopenharmony_ci */
731d5ac70f0Sopenharmony_citypedef int (*snd_hctl_elem_callback_t)(snd_hctl_elem_t *elem,
732d5ac70f0Sopenharmony_ci					unsigned int mask);
733d5ac70f0Sopenharmony_ci
734d5ac70f0Sopenharmony_ciint snd_hctl_open(snd_hctl_t **hctl, const char *name, int mode);
735d5ac70f0Sopenharmony_ciint snd_hctl_open_ctl(snd_hctl_t **hctlp, snd_ctl_t *ctl);
736d5ac70f0Sopenharmony_ciint snd_hctl_close(snd_hctl_t *hctl);
737d5ac70f0Sopenharmony_ciint snd_hctl_nonblock(snd_hctl_t *hctl, int nonblock);
738d5ac70f0Sopenharmony_cistatic __inline__ int snd_hctl_abort(snd_hctl_t *hctl) { return snd_hctl_nonblock(hctl, 2); }
739d5ac70f0Sopenharmony_ciint snd_hctl_poll_descriptors_count(snd_hctl_t *hctl);
740d5ac70f0Sopenharmony_ciint snd_hctl_poll_descriptors(snd_hctl_t *hctl, struct pollfd *pfds, unsigned int space);
741d5ac70f0Sopenharmony_ciint snd_hctl_poll_descriptors_revents(snd_hctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
742d5ac70f0Sopenharmony_ciunsigned int snd_hctl_get_count(snd_hctl_t *hctl);
743d5ac70f0Sopenharmony_ciint snd_hctl_set_compare(snd_hctl_t *hctl, snd_hctl_compare_t hsort);
744d5ac70f0Sopenharmony_cisnd_hctl_elem_t *snd_hctl_first_elem(snd_hctl_t *hctl);
745d5ac70f0Sopenharmony_cisnd_hctl_elem_t *snd_hctl_last_elem(snd_hctl_t *hctl);
746d5ac70f0Sopenharmony_cisnd_hctl_elem_t *snd_hctl_find_elem(snd_hctl_t *hctl, const snd_ctl_elem_id_t *id);
747d5ac70f0Sopenharmony_civoid snd_hctl_set_callback(snd_hctl_t *hctl, snd_hctl_callback_t callback);
748d5ac70f0Sopenharmony_civoid snd_hctl_set_callback_private(snd_hctl_t *hctl, void *data);
749d5ac70f0Sopenharmony_civoid *snd_hctl_get_callback_private(snd_hctl_t *hctl);
750d5ac70f0Sopenharmony_ciint snd_hctl_load(snd_hctl_t *hctl);
751d5ac70f0Sopenharmony_ciint snd_hctl_free(snd_hctl_t *hctl);
752d5ac70f0Sopenharmony_ciint snd_hctl_handle_events(snd_hctl_t *hctl);
753d5ac70f0Sopenharmony_ciconst char *snd_hctl_name(snd_hctl_t *hctl);
754d5ac70f0Sopenharmony_ciint snd_hctl_wait(snd_hctl_t *hctl, int timeout);
755d5ac70f0Sopenharmony_cisnd_ctl_t *snd_hctl_ctl(snd_hctl_t *hctl);
756d5ac70f0Sopenharmony_ci
757d5ac70f0Sopenharmony_cisnd_hctl_elem_t *snd_hctl_elem_next(snd_hctl_elem_t *elem);
758d5ac70f0Sopenharmony_cisnd_hctl_elem_t *snd_hctl_elem_prev(snd_hctl_elem_t *elem);
759d5ac70f0Sopenharmony_ciint snd_hctl_elem_info(snd_hctl_elem_t *elem, snd_ctl_elem_info_t * info);
760d5ac70f0Sopenharmony_ciint snd_hctl_elem_read(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value);
761d5ac70f0Sopenharmony_ciint snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value);
762d5ac70f0Sopenharmony_ciint snd_hctl_elem_tlv_read(snd_hctl_elem_t *elem, unsigned int *tlv, unsigned int tlv_size);
763d5ac70f0Sopenharmony_ciint snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv);
764d5ac70f0Sopenharmony_ciint snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv);
765d5ac70f0Sopenharmony_ci
766d5ac70f0Sopenharmony_cisnd_hctl_t *snd_hctl_elem_get_hctl(snd_hctl_elem_t *elem);
767d5ac70f0Sopenharmony_ci
768d5ac70f0Sopenharmony_civoid snd_hctl_elem_get_id(const snd_hctl_elem_t *obj, snd_ctl_elem_id_t *ptr);
769d5ac70f0Sopenharmony_ciunsigned int snd_hctl_elem_get_numid(const snd_hctl_elem_t *obj);
770d5ac70f0Sopenharmony_cisnd_ctl_elem_iface_t snd_hctl_elem_get_interface(const snd_hctl_elem_t *obj);
771d5ac70f0Sopenharmony_ciunsigned int snd_hctl_elem_get_device(const snd_hctl_elem_t *obj);
772d5ac70f0Sopenharmony_ciunsigned int snd_hctl_elem_get_subdevice(const snd_hctl_elem_t *obj);
773d5ac70f0Sopenharmony_ciconst char *snd_hctl_elem_get_name(const snd_hctl_elem_t *obj);
774d5ac70f0Sopenharmony_ciunsigned int snd_hctl_elem_get_index(const snd_hctl_elem_t *obj);
775d5ac70f0Sopenharmony_civoid snd_hctl_elem_set_callback(snd_hctl_elem_t *obj, snd_hctl_elem_callback_t val);
776d5ac70f0Sopenharmony_civoid * snd_hctl_elem_get_callback_private(const snd_hctl_elem_t *obj);
777d5ac70f0Sopenharmony_civoid snd_hctl_elem_set_callback_private(snd_hctl_elem_t *obj, void * val);
778d5ac70f0Sopenharmony_ci
779d5ac70f0Sopenharmony_ci/** \} */
780d5ac70f0Sopenharmony_ci
781d5ac70f0Sopenharmony_ci/** \} */
782d5ac70f0Sopenharmony_ci
783d5ac70f0Sopenharmony_ci/**
784d5ac70f0Sopenharmony_ci *  \defgroup SControl Setup Control Interface
785d5ac70f0Sopenharmony_ci *  \ingroup Control
786d5ac70f0Sopenharmony_ci *  The setup control interface - set or modify control elements from a configuration file.
787d5ac70f0Sopenharmony_ci *  \{
788d5ac70f0Sopenharmony_ci */
789d5ac70f0Sopenharmony_ci
790d5ac70f0Sopenharmony_ciint snd_sctl_build(snd_sctl_t **ctl, snd_ctl_t *handle, snd_config_t *config,
791d5ac70f0Sopenharmony_ci		   snd_config_t *private_data, int mode);
792d5ac70f0Sopenharmony_ciint snd_sctl_free(snd_sctl_t *handle);
793d5ac70f0Sopenharmony_ciint snd_sctl_install(snd_sctl_t *handle);
794d5ac70f0Sopenharmony_ciint snd_sctl_remove(snd_sctl_t *handle);
795d5ac70f0Sopenharmony_ci
796d5ac70f0Sopenharmony_ci/** \} */
797d5ac70f0Sopenharmony_ci
798d5ac70f0Sopenharmony_ci/**
799d5ac70f0Sopenharmony_ci *  \defgroup Hint Name Hint Interface
800d5ac70f0Sopenharmony_ci *  \ingroup Configuration
801d5ac70f0Sopenharmony_ci *  The name hint interface - get descriptive information about a device
802d5ac70f0Sopenharmony_ci *  (name, description, input/output).
803d5ac70f0Sopenharmony_ci *  \{
804d5ac70f0Sopenharmony_ci */
805d5ac70f0Sopenharmony_ci
806d5ac70f0Sopenharmony_ciint snd_device_name_hint(int card, const char *iface, void ***hints);
807d5ac70f0Sopenharmony_ciint snd_device_name_free_hint(void **hints);
808d5ac70f0Sopenharmony_cichar *snd_device_name_get_hint(const void *hint, const char *id);
809d5ac70f0Sopenharmony_ci
810d5ac70f0Sopenharmony_ci/** \} */
811d5ac70f0Sopenharmony_ci
812d5ac70f0Sopenharmony_ci#ifdef __cplusplus
813d5ac70f0Sopenharmony_ci}
814d5ac70f0Sopenharmony_ci#endif
815d5ac70f0Sopenharmony_ci
816d5ac70f0Sopenharmony_ci#endif /* __ALSA_CONTROL_H */
817