| 
									
										
										
										
											2001-09-13 11:38:32 +00:00
										 |  |  | /**
 | 
					
						
							| 
									
										
										
										
											2005-01-17 17:34:31 +00:00
										 |  |  |  * \file include/conf.h | 
					
						
							| 
									
										
										
										
											2001-09-13 11:38:32 +00:00
										 |  |  |  * \brief Application interface library for the ALSA driver | 
					
						
							| 
									
										
										
										
											2007-10-15 10:24:55 +02:00
										 |  |  |  * \author Jaroslav Kysela <perex@perex.cz> | 
					
						
							| 
									
										
										
										
											2001-09-13 11:38:32 +00:00
										 |  |  |  * \author Abramo Bagnara <abramo@alsa-project.org> | 
					
						
							|  |  |  |  * \author Takashi Iwai <tiwai@suse.de> | 
					
						
							|  |  |  |  * \date 1998-2001 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Application interface library for the ALSA driver | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2001-09-13 11:38:32 +00:00
										 |  |  |  *   This library is free software; you can redistribute it and/or modify | 
					
						
							| 
									
										
										
										
											2001-12-30 09:22:54 +00:00
										 |  |  |  *   it under the terms of the GNU Lesser General Public License as | 
					
						
							|  |  |  |  *   published by the Free Software Foundation; either version 2.1 of | 
					
						
							| 
									
										
										
										
											2001-09-13 11:38:32 +00:00
										 |  |  |  *   the License, or (at your option) any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *   This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  *   but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							| 
									
										
										
										
											2001-12-30 09:22:54 +00:00
										 |  |  |  *   GNU Lesser General Public License for more details. | 
					
						
							| 
									
										
										
										
											2001-09-13 11:38:32 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2001-12-30 09:22:54 +00:00
										 |  |  |  *   You should have received a copy of the GNU Lesser General Public | 
					
						
							| 
									
										
										
										
											2001-09-13 11:38:32 +00:00
										 |  |  |  *   License along with this library; if not, write to the Free Software | 
					
						
							| 
									
										
										
										
											2001-12-30 09:22:54 +00:00
										 |  |  |  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA | 
					
						
							| 
									
										
										
										
											2001-09-13 11:38:32 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef __ALSA_CONF_H
 | 
					
						
							|  |  |  | #define __ALSA_CONF_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-11-14 11:40:46 +00:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | extern "C" { | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-24 13:02:58 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  *  \defgroup Config Configuration Interface | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  |  *  The configuration functions and types allow you to read, enumerate, | 
					
						
							|  |  |  |  *  modify and write the contents of ALSA configuration files. | 
					
						
							| 
									
										
										
										
											2001-04-24 13:02:58 +00:00
										 |  |  |  *  \{ | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | /** \brief \c dlsym version for the config evaluate callback. */ | 
					
						
							| 
									
										
										
										
											2001-08-15 12:12:16 +00:00
										 |  |  | #define SND_CONFIG_DLSYM_VERSION_EVALUATE	_dlsym_config_evaluate_001
 | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | /** \brief \c dlsym version for the config hook callback. */ | 
					
						
							| 
									
										
										
										
											2001-08-15 12:12:16 +00:00
										 |  |  | #define SND_CONFIG_DLSYM_VERSION_HOOK		_dlsym_config_hook_001
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-27 10:09:03 +02:00
										 |  |  | /** \brief Configuration node type. */ | 
					
						
							| 
									
										
										
										
											2001-03-25 14:13:55 +00:00
										 |  |  | typedef enum _snd_config_type { | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | 	/** Integer number. */ | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  |         SND_CONFIG_TYPE_INTEGER, | 
					
						
							| 
									
										
										
										
											2009-07-27 10:09:03 +02:00
										 |  |  | 	/** 64-bit integer number. */ | 
					
						
							| 
									
										
										
										
											2002-05-13 09:34:08 +00:00
										 |  |  |         SND_CONFIG_TYPE_INTEGER64, | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | 	/** Real number. */ | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  |         SND_CONFIG_TYPE_REAL, | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | 	/** Character string. */ | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  |         SND_CONFIG_TYPE_STRING, | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  |         /** Pointer (runtime only, cannot be saved). */ | 
					
						
							| 
									
										
										
										
											2001-11-19 08:14:21 +00:00
										 |  |  |         SND_CONFIG_TYPE_POINTER, | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | 	/** Compound node. */ | 
					
						
							| 
									
										
										
										
											2002-02-05 11:36:20 +00:00
										 |  |  | 	SND_CONFIG_TYPE_COMPOUND = 1024 | 
					
						
							| 
									
										
										
										
											2009-07-27 10:09:03 +02:00
										 |  |  | } snd_config_type_t; /**< \brief Configuration node type. */ | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * \brief Internal structure for a configuration node object. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The ALSA library uses a pointer to this structure as a handle to a | 
					
						
							|  |  |  |  * configuration node. Applications don't access its contents directly. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2000-11-20 20:10:46 +00:00
										 |  |  | typedef struct _snd_config snd_config_t; | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * \brief Type for a configuration compound iterator. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The ALSA library uses this pointer type as a handle to a configuration | 
					
						
							|  |  |  |  * compound iterator. Applications don't directly access the contents of | 
					
						
							|  |  |  |  * the structure pointed to by this type. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2001-02-07 11:34:33 +00:00
										 |  |  | typedef struct _snd_config_iterator *snd_config_iterator_t; | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * \brief Internal structure for a configuration private update object. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The ALSA library uses this structure to save private update information. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2001-12-07 14:12:35 +00:00
										 |  |  | typedef struct _snd_config_update snd_config_update_t; | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-11-19 08:14:21 +00:00
										 |  |  | extern snd_config_t *snd_config; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-08-24 17:07:44 +00:00
										 |  |  | int snd_config_top(snd_config_t **config); | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-17 11:00:32 +00:00
										 |  |  | int snd_config_load(snd_config_t *config, snd_input_t *in); | 
					
						
							| 
									
										
										
										
											2002-01-09 21:28:15 +00:00
										 |  |  | int snd_config_load_override(snd_config_t *config, snd_input_t *in); | 
					
						
							| 
									
										
										
										
											2001-01-17 11:00:32 +00:00
										 |  |  | int snd_config_save(snd_config_t *config, snd_output_t *out); | 
					
						
							| 
									
										
										
										
											2001-11-19 08:14:21 +00:00
										 |  |  | int snd_config_update(void); | 
					
						
							| 
									
										
										
										
											2001-12-07 14:12:35 +00:00
										 |  |  | int snd_config_update_r(snd_config_t **top, snd_config_update_t **update, const char *path); | 
					
						
							|  |  |  | int snd_config_update_free(snd_config_update_t *update); | 
					
						
							| 
									
										
										
										
											2001-12-15 19:50:36 +00:00
										 |  |  | int snd_config_update_free_global(void); | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-02-06 23:48:10 +00:00
										 |  |  | int snd_config_search(snd_config_t *config, const char *key, | 
					
						
							|  |  |  | 		      snd_config_t **result); | 
					
						
							| 
									
										
										
										
											2000-08-24 17:07:44 +00:00
										 |  |  | int snd_config_searchv(snd_config_t *config,  | 
					
						
							|  |  |  | 		       snd_config_t **result, ...); | 
					
						
							| 
									
										
										
										
											2001-06-15 14:00:19 +00:00
										 |  |  | int snd_config_search_definition(snd_config_t *config, | 
					
						
							|  |  |  | 				 const char *base, const char *key, | 
					
						
							|  |  |  | 				 snd_config_t **result); | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-06-16 22:03:23 +00:00
										 |  |  | int snd_config_expand(snd_config_t *config, snd_config_t *root, | 
					
						
							| 
									
										
										
										
											2001-11-19 08:14:21 +00:00
										 |  |  | 		      const char *args, snd_config_t *private_data, | 
					
						
							| 
									
										
										
										
											2001-06-16 22:03:23 +00:00
										 |  |  | 		      snd_config_t **result); | 
					
						
							|  |  |  | int snd_config_evaluate(snd_config_t *config, snd_config_t *root, | 
					
						
							| 
									
										
										
										
											2001-11-19 08:14:21 +00:00
										 |  |  | 			snd_config_t *private_data, snd_config_t **result); | 
					
						
							| 
									
										
										
										
											2001-05-18 17:18:47 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | int snd_config_add(snd_config_t *config, snd_config_t *leaf); | 
					
						
							|  |  |  | int snd_config_delete(snd_config_t *config); | 
					
						
							| 
									
										
										
										
											2001-12-15 19:50:36 +00:00
										 |  |  | int snd_config_delete_compound_members(const snd_config_t *config); | 
					
						
							| 
									
										
										
										
											2001-06-11 13:35:48 +00:00
										 |  |  | int snd_config_copy(snd_config_t **dst, snd_config_t *src); | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-02-06 23:48:10 +00:00
										 |  |  | int snd_config_make(snd_config_t **config, const char *key, | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 		    snd_config_type_t type); | 
					
						
							| 
									
										
										
										
											2001-02-07 11:34:33 +00:00
										 |  |  | int snd_config_make_integer(snd_config_t **config, const char *key); | 
					
						
							| 
									
										
										
										
											2002-05-13 09:34:08 +00:00
										 |  |  | int snd_config_make_integer64(snd_config_t **config, const char *key); | 
					
						
							| 
									
										
										
										
											2001-02-07 11:34:33 +00:00
										 |  |  | int snd_config_make_real(snd_config_t **config, const char *key); | 
					
						
							|  |  |  | int snd_config_make_string(snd_config_t **config, const char *key); | 
					
						
							| 
									
										
										
										
											2001-11-19 08:14:21 +00:00
										 |  |  | int snd_config_make_pointer(snd_config_t **config, const char *key); | 
					
						
							| 
									
										
										
										
											2001-02-07 11:34:33 +00:00
										 |  |  | int snd_config_make_compound(snd_config_t **config, const char *key, int join); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-11-24 18:29:15 +00:00
										 |  |  | int snd_config_imake_integer(snd_config_t **config, const char *key, const long value); | 
					
						
							| 
									
										
										
										
											2002-05-13 09:34:08 +00:00
										 |  |  | int snd_config_imake_integer64(snd_config_t **config, const char *key, const long long value); | 
					
						
							| 
									
										
										
										
											2001-11-24 18:29:15 +00:00
										 |  |  | int snd_config_imake_real(snd_config_t **config, const char *key, const double value); | 
					
						
							|  |  |  | int snd_config_imake_string(snd_config_t **config, const char *key, const char *ascii); | 
					
						
							|  |  |  | int snd_config_imake_pointer(snd_config_t **config, const char *key, const void *ptr); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-12-15 19:50:36 +00:00
										 |  |  | snd_config_type_t snd_config_get_type(const snd_config_t *config); | 
					
						
							| 
									
										
										
										
											2001-11-19 08:14:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-05-18 17:18:47 +00:00
										 |  |  | int snd_config_set_id(snd_config_t *config, const char *id); | 
					
						
							| 
									
										
										
										
											2001-02-07 11:34:33 +00:00
										 |  |  | int snd_config_set_integer(snd_config_t *config, long value); | 
					
						
							| 
									
										
										
										
											2002-05-13 09:34:08 +00:00
										 |  |  | int snd_config_set_integer64(snd_config_t *config, long long value); | 
					
						
							| 
									
										
										
										
											2001-02-07 11:34:33 +00:00
										 |  |  | int snd_config_set_real(snd_config_t *config, double value); | 
					
						
							|  |  |  | int snd_config_set_string(snd_config_t *config, const char *value); | 
					
						
							| 
									
										
										
										
											2001-06-11 13:35:48 +00:00
										 |  |  | int snd_config_set_ascii(snd_config_t *config, const char *ascii); | 
					
						
							| 
									
										
										
										
											2001-11-19 08:14:21 +00:00
										 |  |  | int snd_config_set_pointer(snd_config_t *config, const void *ptr); | 
					
						
							| 
									
										
										
										
											2001-12-15 19:50:36 +00:00
										 |  |  | int snd_config_get_id(const snd_config_t *config, const char **value); | 
					
						
							|  |  |  | int snd_config_get_integer(const snd_config_t *config, long *value); | 
					
						
							| 
									
										
										
										
											2002-05-13 09:34:08 +00:00
										 |  |  | int snd_config_get_integer64(const snd_config_t *config, long long *value); | 
					
						
							| 
									
										
										
										
											2001-12-15 19:50:36 +00:00
										 |  |  | int snd_config_get_real(const snd_config_t *config, double *value); | 
					
						
							|  |  |  | int snd_config_get_ireal(const snd_config_t *config, double *value); | 
					
						
							|  |  |  | int snd_config_get_string(const snd_config_t *config, const char **value); | 
					
						
							|  |  |  | int snd_config_get_ascii(const snd_config_t *config, char **value); | 
					
						
							|  |  |  | int snd_config_get_pointer(const snd_config_t *config, const void **value); | 
					
						
							|  |  |  | int snd_config_test_id(const snd_config_t *config, const char *id); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-06-18 16:05:36 +00:00
										 |  |  | snd_config_iterator_t snd_config_iterator_first(const snd_config_t *node); | 
					
						
							|  |  |  | snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t iterator); | 
					
						
							|  |  |  | snd_config_iterator_t snd_config_iterator_end(const snd_config_t *node); | 
					
						
							| 
									
										
										
										
											2001-12-15 19:50:36 +00:00
										 |  |  | snd_config_t *snd_config_iterator_entry(const snd_config_iterator_t iterator); | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-07-23 19:51:16 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * \brief Helper macro to iterate over the children of a compound node. | 
					
						
							| 
									
										
										
										
											2009-07-27 10:09:03 +02:00
										 |  |  |  * \param[in,out] pos Iterator variable for the current node. | 
					
						
							|  |  |  |  * \param[in,out] next Temporary iterator variable for the next node. | 
					
						
							|  |  |  |  * \param[in] node Handle to the compound configuration node to iterate over. | 
					
						
							| 
									
										
										
										
											2001-03-25 14:13:55 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2009-07-27 10:09:03 +02:00
										 |  |  |  * Use this macro like a \c for statement, e.g.: | 
					
						
							|  |  |  |  * \code | 
					
						
							|  |  |  |  * snd_config_iterator_t pos, next; | 
					
						
							|  |  |  |  * snd_config_for_each(pos, next, node) { | 
					
						
							|  |  |  |  *     snd_config_t *entry = snd_config_iterator_entry(pos); | 
					
						
							|  |  |  |  *     ... | 
					
						
							|  |  |  |  * } | 
					
						
							|  |  |  |  * \endcode | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This macro allows deleting or removing the current node. | 
					
						
							| 
									
										
										
										
											2001-03-25 14:13:55 +00:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2001-02-11 15:45:35 +00:00
										 |  |  | #define snd_config_for_each(pos, next, node) \
 | 
					
						
							|  |  |  | 	for (pos = snd_config_iterator_first(node), next = snd_config_iterator_next(pos); pos != snd_config_iterator_end(node); pos = next, next = snd_config_iterator_next(pos)) | 
					
						
							| 
									
										
										
										
											2000-08-24 12:49:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-06-11 13:35:48 +00:00
										 |  |  | /* Misc functions */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int snd_config_get_bool_ascii(const char *ascii); | 
					
						
							| 
									
										
										
										
											2001-12-15 19:50:36 +00:00
										 |  |  | int snd_config_get_bool(const snd_config_t *conf); | 
					
						
							| 
									
										
										
										
											2001-06-11 13:35:48 +00:00
										 |  |  | int snd_config_get_ctl_iface_ascii(const char *ascii); | 
					
						
							| 
									
										
										
										
											2001-12-15 19:50:36 +00:00
										 |  |  | int snd_config_get_ctl_iface(const snd_config_t *conf); | 
					
						
							| 
									
										
										
										
											2001-06-11 13:35:48 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-05-10 10:52:30 +00:00
										 |  |  | /* Names functions */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-05-24 14:14:28 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * Device-name list element | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2005-05-10 10:52:30 +00:00
										 |  |  | typedef struct snd_devname snd_devname_t; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-05-24 14:14:28 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * Device-name list element (definition) | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2005-05-10 10:52:30 +00:00
										 |  |  | struct snd_devname { | 
					
						
							| 
									
										
										
										
											2005-05-24 14:14:28 +00:00
										 |  |  | 	char *name;	/**< Device name string */ | 
					
						
							|  |  |  | 	char *comment;	/**< Comments */ | 
					
						
							|  |  |  | 	snd_devname_t *next;	/**< Next pointer */ | 
					
						
							| 
									
										
										
										
											2005-05-10 10:52:30 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-05-29 14:26:20 +00:00
										 |  |  | int snd_names_list(const char *iface, snd_devname_t **list); | 
					
						
							| 
									
										
										
										
											2005-05-10 10:52:30 +00:00
										 |  |  | void snd_names_list_free(snd_devname_t *list); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-11-14 11:40:46 +00:00
										 |  |  | /** \} */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-02-07 11:34:33 +00:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-09-13 11:38:32 +00:00
										 |  |  | #endif /* __ALSA_CONF_H */
 |