Added snd_*_open_lconf functions.

Some minor changes in config interface documentation.
This commit is contained in:
Jaroslav Kysela 2001-11-24 17:47:01 +00:00
parent f830a77334
commit c33c5760ab
14 changed files with 145 additions and 4 deletions

View 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,

View 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);

View 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);

View 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);

View 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);

View 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
*/

View 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>,

View File

@ -592,6 +592,21 @@ int snd_ctl_open(snd_ctl_t **ctlp, const char *name, int mode)
return snd_ctl_open_noupdate(ctlp, snd_config, name, 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

View File

@ -171,6 +171,22 @@ int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode)
return snd_hwdep_open_noupdate(hwdep, snd_config, name, 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

View 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)

View File

@ -211,6 +211,25 @@ int snd_rawmidi_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
return snd_rawmidi_open_noupdate(inputp, outputp, snd_config, name, mode);
}
/**
* \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

View File

@ -214,6 +214,25 @@ int snd_seq_open(snd_seq_t **seqp, const char *name,
return snd_seq_open_noupdate(seqp, snd_config, name, streams, mode);
}
/**
* \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()

View File

@ -171,6 +171,24 @@ int snd_timer_open(snd_timer_t **timer, const char *name, int mode)
return snd_timer_open_noupdate(timer, snd_config, name, 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

View File

@ -169,6 +169,24 @@ int snd_timer_query_open(snd_timer_query_t **timer, const char *name, int mode)
return snd_timer_query_open_noupdate(timer, snd_config, name, 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