From: Jaroslav Kysela Date: Sat, 24 Nov 2001 17:47:01 +0000 (+0000) Subject: Added snd_*_open_lconf functions. X-Git-Tag: android-x86-9.0-r1~2632 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c33c5760ab412f2f1551bc0f406c6749827417e8;p=android-x86%2Fexternal-alsa-lib.git Added snd_*_open_lconf functions. Some minor changes in config interface documentation. --- diff --git a/include/control.h b/include/control.h index 0c6ccc21..0567e1a2 100644 --- a/include/control.h +++ b/include/control.h @@ -193,6 +193,7 @@ int snd_card_get_name(int card, char **name); int snd_card_get_longname(int card, char **name); int snd_ctl_open(snd_ctl_t **ctl, const char *name, int mode); +int snd_ctl_open_lconf(snd_ctl_t **ctl, const char *name, int mode, snd_config_t *lconf); int snd_ctl_close(snd_ctl_t *ctl); int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock); int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl, diff --git a/include/pcm.h b/include/pcm.h index 6ab6cef3..40a12e53 100644 --- a/include/pcm.h +++ b/include/pcm.h @@ -350,6 +350,9 @@ typedef struct _snd_pcm_scope snd_pcm_scope_t; int snd_pcm_open(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode); +int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, + snd_pcm_stream_t stream, int mode, + snd_config_t *lconf); int snd_pcm_close(snd_pcm_t *pcm); const char *snd_pcm_name(snd_pcm_t *pcm); diff --git a/include/rawmidi.h b/include/rawmidi.h index e7b37576..ba355841 100644 --- a/include/rawmidi.h +++ b/include/rawmidi.h @@ -79,6 +79,8 @@ typedef enum _snd_rawmidi_type { int snd_rawmidi_open(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, const char *name, int mode); +int snd_rawmidi_open_lconf(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, + const char *name, int mode, snd_config_t *lconf); int snd_rawmidi_close(snd_rawmidi_t *rmidi); int snd_rawmidi_poll_descriptors_count(snd_rawmidi_t *rmidi); int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space); diff --git a/include/seq.h b/include/seq.h index f4fcbf4a..3cdd1cee 100644 --- a/include/seq.h +++ b/include/seq.h @@ -84,6 +84,7 @@ typedef enum _snd_seq_type { /* */ int snd_seq_open(snd_seq_t **handle, const char *name, int streams, int mode); +int snd_seq_open_lconf(snd_seq_t **handle, const char *name, int streams, int mode, snd_config_t *lconf); const char *snd_seq_name(snd_seq_t *seq); snd_seq_type_t snd_seq_type(snd_seq_t *seq); int snd_seq_close(snd_seq_t *handle); diff --git a/include/timer.h b/include/timer.h index 9aeeddba..b6bd11e5 100644 --- a/include/timer.h +++ b/include/timer.h @@ -101,10 +101,12 @@ typedef struct _snd_timer snd_timer_t; int snd_timer_query_open(snd_timer_query_t **handle, const char *name, int mode); +int snd_timer_query_open_lconf(snd_timer_query_t **handle, const char *name, int mode, snd_config_t *lconf); int snd_timer_query_close(snd_timer_query_t *handle); int snd_timer_query_next_device(snd_timer_query_t *handle, snd_timer_id_t *tid); int snd_timer_open(snd_timer_t **handle, const char *name, int mode); +int snd_timer_open_lconf(snd_timer_t **handle, const char *name, int mode, snd_config_t *lconf); int snd_timer_close(snd_timer_t *handle); int snd_timer_poll_descriptors_count(snd_timer_t *handle); int snd_timer_poll_descriptors(snd_timer_t *handle, struct pollfd *pfds, unsigned int space); diff --git a/src/conf.c b/src/conf.c index 4568c775..794e6ec8 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1,11 +1,14 @@ /** * \file conf.c + * \ingroup Configuration * \brief Configuration helper functions * \author Abramo Bagnara * \author Jaroslav Kysela * \date 2000-2001 * * Tree based, full nesting configuration functions. + * + * See the \ref conf page for more details. */ /* * Configuration helper functions @@ -216,7 +219,7 @@ a.0 "first" a.1 "second" \endcode -\section conf_summary Summary +\section conf_syntax_summary Syntax summary \code # Configuration file syntax @@ -248,6 +251,8 @@ name.0 [=] value0 [,|;] name.1 [=] value1 [,|;] \endcode + + */ /*! \page confarg Configuration - runtime arguments @@ -2425,13 +2430,14 @@ SND_DLSYM_BUILD_VERSION(snd_config_hook_load_for_all_cards, SND_CONFIG_DLSYM_VER #endif /** - * \brief Update #snd_config rereading (if needed) files specified in - * environment variable ALSA_CONFIG_PATH. If it's not set the default value is - * "/usr/share/alsa/alsa.conf". + * \brief Update #snd_config rereading (if needed) global configuration files. * \return non-negative value on success, otherwise a negative error code * \retval 0 no action is needed * \retval 1 tree has been rebuild * + * The global configuration files are specified in environment variable ALSA_CONFIG_PATH. + * If it is not set the default value is "/usr/share/alsa/alsa.conf". + * * Warning: If config tree is reread all the string pointer and config * node handle previously obtained from this tree become invalid */ diff --git a/src/confmisc.c b/src/confmisc.c index 31c96156..d93fe9c7 100644 --- a/src/confmisc.c +++ b/src/confmisc.c @@ -1,11 +1,15 @@ /** * \file confmisc.c + * \ingroup Configuration * \brief Configuration helper functions * \author Abramo Bagnara * \author Jaroslav Kysela * \date 2000-2001 * * Configuration helper functions. + * + * See the \ref conffunc page for more details. + */ /* * Miscellaneous configuration helper functions * Copyright (c) 2000 by Abramo Bagnara , diff --git a/src/control/control.c b/src/control/control.c index 374b4d94..c8292a09 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -593,6 +593,21 @@ int snd_ctl_open(snd_ctl_t **ctlp, const char *name, int mode) } /** + * \brief Opens a CTL using local configuration + * \param ctlp Returned CTL handle + * \param name ASCII identifier of the CTL handle + * \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC) + * \param lconf Local configuration + * \return 0 on success otherwise a negative error code + */ +int snd_ctl_open_lconf(snd_ctl_t **ctlp, const char *name, + int mode, snd_config_t *lconf) +{ + assert(ctlp && name && lconf); + return snd_ctl_open_noupdate(ctlp, lconf, name, mode); +} + +/** * \brief Set CTL element #SND_CTL_ELEM_TYPE_BYTES value * \param ctl CTL handle * \param data Bytes value diff --git a/src/hwdep/hwdep.c b/src/hwdep/hwdep.c index 23dbf6a9..2d62a4e2 100644 --- a/src/hwdep/hwdep.c +++ b/src/hwdep/hwdep.c @@ -172,6 +172,22 @@ int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode) } /** + * \brief Opens a new connection to the HwDep interface using local configuration + * \param hwdep Returned handle (NULL if not wanted) + * \param name ASCII identifier of the HwDep handle + * \param mode Open mode + * \return 0 on success otherwise a negative error code + * + * Opens a new connection to the HwDep interface specified with + * an ASCII identifier and mode. + */ +int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode, snd_config_t *lconf) +{ + assert(hwdep && name); + return snd_hwdep_open_noupdate(hwdep, lconf, name, mode); +} + +/** * \brief close HwDep handle * \param hwdep HwDep handle * \return 0 on success otherwise a negative error code diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index bc0e26e1..82a9a543 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -1604,6 +1604,23 @@ int snd_pcm_open(snd_pcm_t **pcmp, const char *name, return snd_pcm_open_noupdate(pcmp, snd_config, name, stream, mode); } +/** + * \brief Opens a PCM using local configuration + * \param pcmp Returned PCM handle + * \param name ASCII identifier of the PCM handle + * \param stream Wanted stream + * \param mode Open mode (see #SND_PCM_NONBLOCK, #SND_PCM_ASYNC) + * \param lconf Local configuration + * \return 0 on success otherwise a negative error code + */ +int snd_pcm_open_lconf(snd_pcm_t **pcmp, const char *name, + snd_pcm_stream_t stream, int mode, + snd_config_t *lconf) +{ + assert(pcmp && name && lconf); + return snd_pcm_open_noupdate(pcmp, lconf, name, stream, mode); +} + #ifndef DOC_HIDDEN int snd_pcm_new(snd_pcm_t **pcmp, snd_pcm_type_t type, const char *name, snd_pcm_stream_t stream, int mode) diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c index 1d136d20..bef3d50d 100644 --- a/src/rawmidi/rawmidi.c +++ b/src/rawmidi/rawmidi.c @@ -212,6 +212,25 @@ int snd_rawmidi_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp, } /** + * \brief Opens a new connection to the RawMidi interface using local configuration + * \param inputp Returned input handle (NULL if not wanted) + * \param outputp Returned output handle (NULL if not wanted) + * \param name ASCII identifier of the RawMidi handle + * \param mode Open mode + * \param lconf Local configuration + * \return 0 on success otherwise a negative error code + * + * Opens a new connection to the RawMidi interface specified with + * an ASCII identifier and mode. + */ +int snd_rawmidi_open_lconf(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp, + const char *name, int mode, snd_config_t *lconf) +{ + assert((inputp || outputp) && name && lconf); + return snd_rawmidi_open_noupdate(inputp, outputp, lconf, name, mode); +} + +/** * \brief close RawMidi handle * \param rawmidi RawMidi handle * \return 0 on success otherwise a negative error code diff --git a/src/seq/seq.c b/src/seq/seq.c index da04532e..98b3cced 100644 --- a/src/seq/seq.c +++ b/src/seq/seq.c @@ -215,6 +215,25 @@ int snd_seq_open(snd_seq_t **seqp, const char *name, } /** + * \brief Open the ALSA sequencer using local configuration + * + * \param seqp Pointer to a snd_seq_t pointer. + * \param streams The read/write mode of the sequencer. + * \param mode Optional modifier + * \param lconf Local configuration + * \return 0 on success otherwise a negative error code + * + * See the snd_seq_open() function for further details. The extension + * is that the given configuration is used to resolve abstract name. + */ +int snd_seq_open_lconf(snd_seq_t **seqp, const char *name, + int streams, int mode, snd_config_t *lconf) +{ + assert(seqp && name && lconf); + return snd_seq_open_noupdate(seqp, lconf, name, streams, mode); +} + +/** * \brief Close the sequencer * \param handle Handle returned from #snd_seq_open() * \return 0 on success otherwise a negative error code diff --git a/src/timer/timer.c b/src/timer/timer.c index 24806899..5ccc1cb1 100644 --- a/src/timer/timer.c +++ b/src/timer/timer.c @@ -172,6 +172,24 @@ int snd_timer_open(snd_timer_t **timer, const char *name, int mode) } /** + * \brief Opens a new connection to the timer interface using local configuration + * \param timer Returned handle (NULL if not wanted) + * \param name ASCII identifier of the timer handle + * \param mode Open mode + * \param lconf Local configuration + * \return 0 on success otherwise a negative error code + * + * Opens a new connection to the timer interface specified with + * an ASCII identifier and mode. + */ +int snd_timer_open_lconf(snd_timer_t **timer, const char *name, + int mode, snd_config_t *lconf) +{ + assert(timer && name && lconf); + return snd_timer_open_noupdate(timer, lconf, name, mode); +} + +/** * \brief close timer handle * \param timer timer handle * \return 0 on success otherwise a negative error code diff --git a/src/timer/timer_query.c b/src/timer/timer_query.c index 84559a7f..121c77e3 100644 --- a/src/timer/timer_query.c +++ b/src/timer/timer_query.c @@ -170,6 +170,24 @@ int snd_timer_query_open(snd_timer_query_t **timer, const char *name, int mode) } /** + * \brief Opens a new connection to the timer query interface using local configuration + * \param timer Returned handle (NULL if not wanted) + * \param name ASCII identifier of the RawMidi handle + * \param mode Open mode + * \param lconf Local configuration + * \return 0 on success otherwise a negative error code + * + * Opens a new connection to the RawMidi interface specified with + * an ASCII identifier and mode. + */ +int snd_timer_query_open_lconf(snd_timer_query_t **timer, const char *name, + int mode, snd_config_t *lconf) +{ + assert(timer && name && lconf); + return snd_timer_query_open_noupdate(timer, lconf, name, mode); +} + +/** * \brief close timer query handle * \param timer timer handle * \return 0 on success otherwise a negative error code