OSDN Git Service

Added snd_*_open_lconf functions.
authorJaroslav Kysela <perex@perex.cz>
Sat, 24 Nov 2001 17:47:01 +0000 (17:47 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sat, 24 Nov 2001 17:47:01 +0000 (17:47 +0000)
Some minor changes in config interface documentation.

14 files changed:
include/control.h
include/pcm.h
include/rawmidi.h
include/seq.h
include/timer.h
src/conf.c
src/confmisc.c
src/control/control.c
src/hwdep/hwdep.c
src/pcm/pcm.c
src/rawmidi/rawmidi.c
src/seq/seq.c
src/timer/timer.c
src/timer/timer_query.c

index 0c6ccc2..0567e1a 100644 (file)
@@ -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, 
index 6ab6cef..40a12e5 100644 (file)
@@ -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);
index e7b3757..ba35584 100644 (file)
@@ -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);
index f4fcbf4..3cdd1ce 100644 (file)
@@ -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);
index 9aeeddb..b6bd11e 100644 (file)
@@ -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);
index 4568c77..794e6ec 100644 (file)
@@ -1,11 +1,14 @@
 /**
  * \file conf.c
+ * \ingroup Configuration
  * \brief Configuration helper functions
  * \author Abramo Bagnara <abramo@alsa-project.org>
  * \author Jaroslav Kysela <perex@suse.cz>
  * \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
  */
index 31c9615..d93fe9c 100644 (file)
@@ -1,11 +1,15 @@
 /**
  * \file confmisc.c
+ * \ingroup Configuration
  * \brief Configuration helper functions
  * \author Abramo Bagnara <abramo@alsa-project.org>
  * \author Jaroslav Kysela <perex@suse.cz>
  * \date 2000-2001
  * 
  * Configuration helper functions.
+ *
+ * See the \ref conffunc page for more details.
+ */
 /*
  *  Miscellaneous configuration helper functions
  *  Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>,
index 374b4d9..c8292a0 100644 (file)
@@ -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
index 23dbf6a..2d62a4e 100644 (file)
@@ -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
index bc0e26e..82a9a54 100644 (file)
@@ -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)
index 1d136d2..bef3d50 100644 (file)
@@ -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
index da04532..98b3cce 100644 (file)
@@ -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
index 2480689..5ccc1cb 100644 (file)
@@ -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
index 84559a7..121c77e 100644 (file)
@@ -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