mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-03-09 05:33:43 -04:00
Merge branch 'fallback'
This commit is contained in:
commit
78dbc57b99
5 changed files with 53 additions and 1 deletions
|
|
@ -224,6 +224,7 @@ char *snd_device_name_get_hint(const void *hint, const char *id);
|
||||||
|
|
||||||
int snd_ctl_open(snd_ctl_t **ctl, const char *name, int mode);
|
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_open_lconf(snd_ctl_t **ctl, const char *name, int mode, snd_config_t *lconf);
|
||||||
|
int snd_ctl_open_fallback(snd_ctl_t **ctl, snd_config_t *root, const char *name, const char *orig_name, int mode);
|
||||||
int snd_ctl_close(snd_ctl_t *ctl);
|
int snd_ctl_close(snd_ctl_t *ctl);
|
||||||
int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock);
|
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,
|
int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl,
|
||||||
|
|
|
||||||
|
|
@ -410,6 +410,9 @@ int snd_pcm_open(snd_pcm_t **pcm, const char *name,
|
||||||
int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name,
|
int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name,
|
||||||
snd_pcm_stream_t stream, int mode,
|
snd_pcm_stream_t stream, int mode,
|
||||||
snd_config_t *lconf);
|
snd_config_t *lconf);
|
||||||
|
int snd_pcm_open_fallback(snd_pcm_t **pcm, snd_config_t *root,
|
||||||
|
const char *name, const char *orig_name,
|
||||||
|
snd_pcm_stream_t stream, int mode);
|
||||||
|
|
||||||
int snd_pcm_close(snd_pcm_t *pcm);
|
int snd_pcm_close(snd_pcm_t *pcm);
|
||||||
const char *snd_pcm_name(snd_pcm_t *pcm);
|
const char *snd_pcm_name(snd_pcm_t *pcm);
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@ defaults.timer.subdevice 0
|
||||||
pcm.cards cards.pcm
|
pcm.cards cards.pcm
|
||||||
|
|
||||||
pcm.default cards.pcm.default
|
pcm.default cards.pcm.default
|
||||||
|
pcm.sysdefault cards.pcm.default
|
||||||
pcm.front cards.pcm.front
|
pcm.front cards.pcm.front
|
||||||
pcm.rear cards.pcm.rear
|
pcm.rear cards.pcm.rear
|
||||||
pcm.center_lfe cards.pcm.center_lfe
|
pcm.center_lfe cards.pcm.center_lfe
|
||||||
|
|
@ -321,7 +322,7 @@ pcm.null {
|
||||||
# Control interface
|
# Control interface
|
||||||
#
|
#
|
||||||
|
|
||||||
ctl.default {
|
ctl.sysdefault {
|
||||||
type hw
|
type hw
|
||||||
card {
|
card {
|
||||||
@func getenv
|
@func getenv
|
||||||
|
|
@ -335,6 +336,7 @@ ctl.default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ctl.default ctl.sysdefault
|
||||||
|
|
||||||
ctl.hw {
|
ctl.hw {
|
||||||
@args [ CARD ]
|
@args [ CARD ]
|
||||||
|
|
|
||||||
|
|
@ -919,6 +919,28 @@ int snd_ctl_open_lconf(snd_ctl_t **ctlp, const char *name,
|
||||||
return snd_ctl_open_noupdate(ctlp, lconf, name, mode);
|
return snd_ctl_open_noupdate(ctlp, lconf, name, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Opens a fallback CTL
|
||||||
|
* \param ctlp Returned CTL handle
|
||||||
|
* \param root Configuration root
|
||||||
|
* \param name ASCII identifier of the CTL handle used as fallback
|
||||||
|
* \param orig_name The original ASCII name
|
||||||
|
* \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC)
|
||||||
|
* \return 0 on success otherwise a negative error code
|
||||||
|
*/
|
||||||
|
int snd_ctl_open_fallback(snd_ctl_t **ctlp, snd_config_t *root,
|
||||||
|
const char *name, const char *orig_name, int mode)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
assert(ctlp && name && root);
|
||||||
|
err = snd_ctl_open_noupdate(ctlp, root, name, mode);
|
||||||
|
if (err >= 0) {
|
||||||
|
free((*ctlp)->name);
|
||||||
|
(*ctlp)->name = orig_name ? strdup(orig_name) : NULL;
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef DOC_HIDDEN
|
#ifndef DOC_HIDDEN
|
||||||
#define TYPE(v) [SND_CTL_ELEM_TYPE_##v] = #v
|
#define TYPE(v) [SND_CTL_ELEM_TYPE_##v] = #v
|
||||||
#define IFACE(v) [SND_CTL_ELEM_IFACE_##v] = #v
|
#define IFACE(v) [SND_CTL_ELEM_IFACE_##v] = #v
|
||||||
|
|
|
||||||
|
|
@ -2259,6 +2259,30 @@ int snd_pcm_open_lconf(snd_pcm_t **pcmp, const char *name,
|
||||||
return snd_pcm_open_noupdate(pcmp, lconf, name, stream, mode, 0);
|
return snd_pcm_open_noupdate(pcmp, lconf, name, stream, mode, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Opens a fallback PCM
|
||||||
|
* \param pcmp Returned PCM handle
|
||||||
|
* \param root Configuration root
|
||||||
|
* \param name ASCII identifier of the PCM handle
|
||||||
|
* \param orig_name The original ASCII name
|
||||||
|
* \param stream Wanted stream
|
||||||
|
* \param mode Open mode (see #SND_PCM_NONBLOCK, #SND_PCM_ASYNC)
|
||||||
|
* \return 0 on success otherwise a negative error code
|
||||||
|
*/
|
||||||
|
int snd_pcm_open_fallback(snd_pcm_t **pcmp, snd_config_t *root,
|
||||||
|
const char *name, const char *orig_name,
|
||||||
|
snd_pcm_stream_t stream, int mode)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
assert(pcmp && name && root);
|
||||||
|
err = snd_pcm_open_noupdate(pcmp, root, name, stream, mode, 0);
|
||||||
|
if (err >= 0) {
|
||||||
|
free((*pcmp)->name);
|
||||||
|
(*pcmp)->name = orig_name ? strdup(orig_name) : NULL;
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef DOC_HIDDEN
|
#ifndef DOC_HIDDEN
|
||||||
int snd_pcm_new(snd_pcm_t **pcmp, snd_pcm_type_t type, const char *name,
|
int snd_pcm_new(snd_pcm_t **pcmp, snd_pcm_type_t type, const char *name,
|
||||||
snd_pcm_stream_t stream, int mode)
|
snd_pcm_stream_t stream, int mode)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue