mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Added mode argument to open functions where it was missing. First part of CTL documentation
This commit is contained in:
parent
4bee8c5678
commit
7893ea238d
21 changed files with 570 additions and 276 deletions
|
|
@ -88,7 +88,7 @@ int snd_card_get_index(const char *string)
|
|||
for (card = 0; card < 32; card++) {
|
||||
if (snd_card_load(card) < 0)
|
||||
continue;
|
||||
if (snd_ctl_hw_open(&handle, NULL, card) < 0)
|
||||
if (snd_ctl_hw_open(&handle, NULL, card, 0) < 0)
|
||||
continue;
|
||||
if (snd_ctl_card_info(handle, &info) < 0) {
|
||||
snd_ctl_close(handle);
|
||||
|
|
@ -109,7 +109,7 @@ int snd_card_get_name(int card, char **name)
|
|||
|
||||
if (name == NULL)
|
||||
return -EINVAL;
|
||||
if ((err = snd_ctl_hw_open(&handle, NULL, card)) < 0)
|
||||
if ((err = snd_ctl_hw_open(&handle, NULL, card, 0)) < 0)
|
||||
return err;
|
||||
if ((err = snd_ctl_card_info(handle, &info)) < 0) {
|
||||
snd_ctl_close(handle);
|
||||
|
|
@ -130,7 +130,7 @@ int snd_card_get_longname(int card, char **name)
|
|||
|
||||
if (name == NULL)
|
||||
return -EINVAL;
|
||||
if ((err = snd_ctl_hw_open(&handle, NULL, card)) < 0)
|
||||
if ((err = snd_ctl_hw_open(&handle, NULL, card, 0)) < 0)
|
||||
return err;
|
||||
if ((err = snd_ctl_card_info(handle, &info)) < 0) {
|
||||
snd_ctl_close(handle);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
/**
|
||||
* \file control/control.c
|
||||
* \author Abramo Bagnara <abramo@alsa-project.org>
|
||||
* \date 2000
|
||||
*
|
||||
* CTL interface is designed to access primitive controls.
|
||||
*/
|
||||
/*
|
||||
* Control Interface - main file
|
||||
* Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>
|
||||
|
|
@ -19,6 +26,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
|
@ -26,21 +34,46 @@
|
|||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <dlfcn.h>
|
||||
#include <signal.h>
|
||||
#include <sys/poll.h>
|
||||
#include "control_local.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief get identifier of CTL handle
|
||||
* \param ctl CTL handle
|
||||
* \return ascii identifier of CTL handle
|
||||
*
|
||||
* Returns the ASCII identifier of given CTL handle. It's the same
|
||||
* identifier specified in snd_ctl_open().
|
||||
*/
|
||||
const char *snd_ctl_name(snd_ctl_t *ctl)
|
||||
{
|
||||
assert(ctl);
|
||||
return ctl->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get type of CTL handle
|
||||
* \param ctl CTL handle
|
||||
* \return type of CTL handle
|
||||
*
|
||||
* Returns the type #snd_ctl_type_t of given CTL handle.
|
||||
*/
|
||||
snd_ctl_type_t snd_ctl_type(snd_ctl_t *ctl)
|
||||
{
|
||||
assert(ctl);
|
||||
return ctl->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief close CTL handle
|
||||
* \param ctl CTL handle
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* Closes the specified CTL handle and frees all associated
|
||||
* resources.
|
||||
*/
|
||||
int snd_ctl_close(snd_ctl_t *ctl)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -51,6 +84,12 @@ int snd_ctl_close(snd_ctl_t *ctl)
|
|||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief set nonblock mode
|
||||
* \param ctl CTL handle
|
||||
* \param nonblock 0 = block, 1 = nonblock mode
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock)
|
||||
{
|
||||
int err;
|
||||
|
|
@ -62,24 +101,51 @@ int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief set async mode
|
||||
* \param ctl CTL handle
|
||||
* \param sig Signal to raise: < 0 disable, 0 default (SIGIO)
|
||||
* \param pid Process ID to signal: 0 current
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* A signal is raised when a change happens.
|
||||
*/
|
||||
int snd_ctl_async(snd_ctl_t *ctl, int sig, pid_t pid)
|
||||
{
|
||||
int err;
|
||||
assert(ctl);
|
||||
return ctl->ops->async(ctl, sig, pid);
|
||||
}
|
||||
|
||||
int _snd_ctl_poll_descriptor(snd_ctl_t *ctl)
|
||||
{
|
||||
assert(ctl);
|
||||
return ctl->ops->poll_descriptor(ctl);
|
||||
err = ctl->ops->async(ctl, sig, pid);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (sig)
|
||||
ctl->async_sig = sig;
|
||||
else
|
||||
ctl->async_sig = SIGIO;
|
||||
if (pid)
|
||||
ctl->async_pid = pid;
|
||||
else
|
||||
ctl->async_pid = getpid();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get count of poll descriptors for CTL handle
|
||||
* \param ctl CTL handle
|
||||
* \return count of poll descriptors
|
||||
*/
|
||||
int snd_ctl_poll_descriptors_count(snd_ctl_t *ctl)
|
||||
{
|
||||
assert(ctl);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get poll descriptors
|
||||
* \param ctl CTL handle
|
||||
* \param pfds array of poll descriptors
|
||||
* \param space space in the poll descriptor array
|
||||
* \return count of filled descriptors
|
||||
*/
|
||||
int snd_ctl_poll_descriptors(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int space)
|
||||
{
|
||||
assert(ctl);
|
||||
|
|
@ -91,18 +157,37 @@ int snd_ctl_poll_descriptors(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int s
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Ask to be informed about events (poll, #snd_ctl_async, #snd_ctl_read)
|
||||
* \param ctl CTL handle
|
||||
* \param subscribe 0 = unsubscribe, 1 = subscribe
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe)
|
||||
{
|
||||
assert(ctl);
|
||||
return ctl->ops->subscribe_events(ctl, subscribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get card related information
|
||||
* \param ctl CTL handle
|
||||
* \param info Card info pointer
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info)
|
||||
{
|
||||
assert(ctl && info);
|
||||
return ctl->ops->card_info(ctl, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get a list of element identificators
|
||||
* \param ctl CTL handle
|
||||
* \param list CTL element identificators list pointer
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_elem_list(snd_ctl_t *ctl, snd_ctl_elem_list_t *list)
|
||||
{
|
||||
assert(ctl && list);
|
||||
|
|
@ -110,78 +195,157 @@ int snd_ctl_elem_list(snd_ctl_t *ctl, snd_ctl_elem_list_t *list)
|
|||
return ctl->ops->element_list(ctl, list);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get CTL element information
|
||||
* \param ctl CTL handle
|
||||
* \param info CTL element id/information pointer
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_elem_info(snd_ctl_t *ctl, snd_ctl_elem_info_t *info)
|
||||
{
|
||||
assert(ctl && info && (info->id.name[0] || info->id.numid));
|
||||
return ctl->ops->element_info(ctl, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get CTL element value
|
||||
* \param ctl CTL handle
|
||||
* \param control CTL element id/value pointer
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_elem_read(snd_ctl_t *ctl, snd_ctl_elem_value_t *control)
|
||||
{
|
||||
assert(ctl && control && (control->id.name[0] || control->id.numid));
|
||||
return ctl->ops->element_read(ctl, control);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set CTL element value
|
||||
* \param ctl CTL handle
|
||||
* \param control CTL element id/value pointer
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *control)
|
||||
{
|
||||
assert(ctl && control && (control->id.name[0] || control->id.numid));
|
||||
return ctl->ops->element_write(ctl, control);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get next hardware dependent device number
|
||||
* \param ctl CTL handle
|
||||
* \param device current device on entry and next device on return
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_hwdep_next_device(snd_ctl_t *ctl, int *device)
|
||||
{
|
||||
assert(ctl && device);
|
||||
return ctl->ops->hwdep_next_device(ctl, device);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get info about a hardware dependent device
|
||||
* \param ctl CTL handle
|
||||
* \param info Hardware dependent device id/info pointer
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_hwdep_info(snd_ctl_t *ctl, snd_hwdep_info_t * info)
|
||||
{
|
||||
assert(ctl && info);
|
||||
return ctl->ops->hwdep_info(ctl, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get next PCM device number
|
||||
* \param ctl CTL handle
|
||||
* \param device current device on entry and next device on return
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_pcm_next_device(snd_ctl_t *ctl, int * device)
|
||||
{
|
||||
assert(ctl && device);
|
||||
return ctl->ops->pcm_next_device(ctl, device);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get info about a PCM device
|
||||
* \param ctl CTL handle
|
||||
* \param info PCM device id/info pointer
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_pcm_info(snd_ctl_t *ctl, snd_pcm_info_t * info)
|
||||
{
|
||||
assert(ctl && info);
|
||||
return ctl->ops->pcm_info(ctl, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set preferred PCM subdevice number of successive PCM open
|
||||
* \param ctl CTL handle
|
||||
* \param subdev Preferred PCM subdevice number
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_pcm_prefer_subdevice(snd_ctl_t *ctl, int subdev)
|
||||
{
|
||||
assert(ctl);
|
||||
return ctl->ops->pcm_prefer_subdevice(ctl, subdev);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get next RawMidi device number
|
||||
* \param ctl CTL handle
|
||||
* \param device current device on entry and next device on return
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device)
|
||||
{
|
||||
assert(ctl && device);
|
||||
return ctl->ops->rawmidi_next_device(ctl, device);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get info about a RawMidi device
|
||||
* \param ctl CTL handle
|
||||
* \param info RawMidi device id/info pointer
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info)
|
||||
{
|
||||
assert(ctl && info);
|
||||
return ctl->ops->rawmidi_info(ctl, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set preferred RawMidi subdevice number of successive RawMidi open
|
||||
* \param ctl CTL handle
|
||||
* \param subdev Preferred RawMidi subdevice number
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev)
|
||||
{
|
||||
assert(ctl);
|
||||
return ctl->ops->rawmidi_prefer_subdevice(ctl, subdev);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Read an event
|
||||
* \param ctl CTL handle
|
||||
* \param event Event pointer
|
||||
* \return number of events read otherwise a negative error code on failure
|
||||
*/
|
||||
int snd_ctl_read(snd_ctl_t *ctl, snd_ctl_event_t *event)
|
||||
{
|
||||
assert(ctl && event);
|
||||
return ctl->ops->read(ctl, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Wait for a CTL to become ready (i.e. at least one event pending)
|
||||
* \param ctl CTL handle
|
||||
* \param timeout maximum time in milliseconds to wait
|
||||
* \return 0 otherwise a negative error code on failure
|
||||
*/
|
||||
int snd_ctl_wait(snd_ctl_t *ctl, int timeout)
|
||||
{
|
||||
struct pollfd pfd;
|
||||
|
|
@ -194,7 +358,14 @@ int snd_ctl_wait(snd_ctl_t *ctl, int timeout)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int snd_ctl_open(snd_ctl_t **ctlp, const char *name)
|
||||
/**
|
||||
* \brief Opens a CTL
|
||||
* \param ctlp Returned CTL handle
|
||||
* \param name ASCII identifier of the CTL handle
|
||||
* \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC)
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_open(snd_ctl_t **ctlp, const char *name, int mode)
|
||||
{
|
||||
const char *str;
|
||||
char buf[256];
|
||||
|
|
@ -202,7 +373,7 @@ int snd_ctl_open(snd_ctl_t **ctlp, const char *name)
|
|||
snd_config_t *ctl_conf, *conf, *type_conf;
|
||||
snd_config_iterator_t i, next;
|
||||
const char *lib = NULL, *open = NULL;
|
||||
int (*open_func)(snd_ctl_t **ctlp, const char *name, snd_config_t *conf);
|
||||
int (*open_func)(snd_ctl_t **ctlp, const char *name, snd_config_t *conf, int mode);
|
||||
void *h;
|
||||
const char *name1;
|
||||
assert(ctlp && name);
|
||||
|
|
@ -217,10 +388,10 @@ int snd_ctl_open(snd_ctl_t **ctlp, const char *name)
|
|||
char socket[256], sname[256];
|
||||
err = sscanf(name1, "hw:%d", &card);
|
||||
if (err == 1)
|
||||
return snd_ctl_hw_open(ctlp, name, card);
|
||||
return snd_ctl_hw_open(ctlp, name, card, mode);
|
||||
err = sscanf(name1, "shm:%256[^,],%256[^,]", socket, sname);
|
||||
if (err == 2)
|
||||
return snd_ctl_shm_open(ctlp, name, socket, sname);
|
||||
return snd_ctl_shm_open(ctlp, name, socket, sname, mode);
|
||||
SNDERR("Unknown ctl %s", name1);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
|
@ -278,21 +449,31 @@ int snd_ctl_open(snd_ctl_t **ctlp, const char *name)
|
|||
dlclose(h);
|
||||
return -ENXIO;
|
||||
}
|
||||
return open_func(ctlp, name, ctl_conf);
|
||||
return open_func(ctlp, name, ctl_conf, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set CTL element #SND_CTL_ELEM_TYPE_BYTES value
|
||||
* \param ctl CTL handle
|
||||
* \param data Bytes value
|
||||
* \param size Size in bytes
|
||||
*/
|
||||
void snd_ctl_elem_set_bytes(snd_ctl_elem_value_t *obj, void *data, size_t size)
|
||||
{
|
||||
assert(obj);
|
||||
assert(size <= sizeof(obj->value.bytes.data));
|
||||
if (size >= sizeof(obj->value.bytes.data)) {
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
memcpy(obj->value.bytes.data, data, size);
|
||||
}
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
#define TYPE(v) [SND_CTL_ELEM_TYPE_##v] = #v
|
||||
#define IFACE(v) [SND_CTL_ELEM_IFACE_##v] = #v
|
||||
#define EVENT(v) [SND_CTL_EVENT_##v] = #v
|
||||
|
||||
const char *snd_ctl_elem_type_names[] = {
|
||||
static const char *snd_ctl_elem_type_names[] = {
|
||||
TYPE(NONE),
|
||||
TYPE(BOOLEAN),
|
||||
TYPE(INTEGER),
|
||||
|
|
@ -301,7 +482,7 @@ const char *snd_ctl_elem_type_names[] = {
|
|||
TYPE(IEC958),
|
||||
};
|
||||
|
||||
const char *snd_ctl_elem_iface_names[] = {
|
||||
static const char *snd_ctl_elem_iface_names[] = {
|
||||
IFACE(CARD),
|
||||
IFACE(HWDEP),
|
||||
IFACE(MIXER),
|
||||
|
|
@ -311,28 +492,50 @@ const char *snd_ctl_elem_iface_names[] = {
|
|||
IFACE(SEQUENCER),
|
||||
};
|
||||
|
||||
const char *snd_ctl_event_type_names[] = {
|
||||
static const char *snd_ctl_event_type_names[] = {
|
||||
EVENT(ELEM),
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief get name of a CTL element type
|
||||
* \param type CTL element type
|
||||
* \return ascii name of CTL element type
|
||||
*/
|
||||
const char *snd_ctl_elem_type_name(snd_ctl_elem_type_t type)
|
||||
{
|
||||
assert(type <= SND_CTL_ELEM_TYPE_LAST);
|
||||
return snd_ctl_elem_type_names[snd_enum_to_int(type)];
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get name of a CTL element related interface
|
||||
* \param iface CTL element related interface
|
||||
* \return ascii name of CTL element related interface
|
||||
*/
|
||||
const char *snd_ctl_elem_iface_name(snd_ctl_elem_iface_t iface)
|
||||
{
|
||||
assert(iface <= SND_CTL_ELEM_IFACE_LAST);
|
||||
return snd_ctl_elem_iface_names[snd_enum_to_int(iface)];
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get name of a CTL event type
|
||||
* \param type CTL event type
|
||||
* \return ascii name of CTL event type
|
||||
*/
|
||||
const char *snd_ctl_event_type_name(snd_ctl_event_type_t type)
|
||||
{
|
||||
assert(type <= SND_CTL_EVENT_LAST);
|
||||
return snd_ctl_event_type_names[snd_enum_to_int(type)];
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief allocate space for CTL element identificators list
|
||||
* \param obj CTL element identificators list
|
||||
* \param entries Entries to allocate
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_ctl_elem_list_alloc_space(snd_ctl_elem_list_t *obj, unsigned int entries)
|
||||
{
|
||||
if (obj->pids)
|
||||
|
|
@ -346,12 +549,21 @@ int snd_ctl_elem_list_alloc_space(snd_ctl_elem_list_t *obj, unsigned int entries
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief free previously allocated space for CTL element identificators list
|
||||
* \param obj CTL element identificators list
|
||||
*/
|
||||
void snd_ctl_elem_list_free_space(snd_ctl_elem_list_t *obj)
|
||||
{
|
||||
free(obj->pids);
|
||||
obj->pids = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get event mask for an element related event
|
||||
* \param obj CTL event
|
||||
* \return event mask for element related event
|
||||
*/
|
||||
unsigned int snd_ctl_event_elem_get_mask(const snd_ctl_event_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
|
|
@ -359,6 +571,11 @@ unsigned int snd_ctl_event_elem_get_mask(const snd_ctl_event_t *obj)
|
|||
return obj->data.elem.mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get element numeric identificator for an element related event
|
||||
* \param obj CTL event
|
||||
* \return element numeric identificator for element related event
|
||||
*/
|
||||
unsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
|
|
@ -366,6 +583,11 @@ unsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t *obj)
|
|||
return obj->data.elem.id.numid;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get CTL element identificator for an element related event
|
||||
* \param obj CTL event
|
||||
* \param ptr Pointer to returned CTL element identificator
|
||||
*/
|
||||
void snd_ctl_event_elem_get_id(const snd_ctl_event_t *obj, snd_ctl_elem_id_t *ptr)
|
||||
{
|
||||
assert(obj && ptr);
|
||||
|
|
@ -373,6 +595,11 @@ void snd_ctl_event_elem_get_id(const snd_ctl_event_t *obj, snd_ctl_elem_id_t *pt
|
|||
*ptr = obj->data.elem.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get interface part of CTL element identificator for an element related event
|
||||
* \param obj CTL event
|
||||
* \return interface part of element identificator
|
||||
*/
|
||||
snd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
|
|
@ -380,6 +607,11 @@ snd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t *obj
|
|||
return snd_int_to_enum(obj->data.elem.id.iface);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get device part of CTL element identificator for an element related event
|
||||
* \param obj CTL event
|
||||
* \return device part of element identificator
|
||||
*/
|
||||
unsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
|
|
@ -387,6 +619,11 @@ unsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t *obj)
|
|||
return obj->data.elem.id.device;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get subdevice part of CTL element identificator for an element related event
|
||||
* \param obj CTL event
|
||||
* \return subdevice part of element identificator
|
||||
*/
|
||||
unsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
|
|
@ -394,6 +631,11 @@ unsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t *obj)
|
|||
return obj->data.elem.id.subdevice;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get name part of CTL element identificator for an element related event
|
||||
* \param obj CTL event
|
||||
* \return name part of element identificator
|
||||
*/
|
||||
const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
|
|
@ -401,6 +643,11 @@ const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj)
|
|||
return obj->data.elem.id.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get index part of CTL element identificator for an element related event
|
||||
* \param obj CTL event
|
||||
* \return index part of element identificator
|
||||
*/
|
||||
unsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
|
|
@ -408,3 +655,10 @@ unsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t *obj)
|
|||
return obj->data.elem.id.index;
|
||||
}
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
int _snd_ctl_poll_descriptor(snd_ctl_t *ctl)
|
||||
{
|
||||
assert(ctl);
|
||||
return ctl->ops->poll_descriptor(ctl);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -259,10 +259,11 @@ snd_ctl_ops_t snd_ctl_hw_ops = {
|
|||
read: snd_ctl_hw_read,
|
||||
};
|
||||
|
||||
int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card)
|
||||
int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
|
||||
{
|
||||
int fd, ver;
|
||||
char filename[32];
|
||||
int fmode;
|
||||
snd_ctl_t *ctl;
|
||||
snd_ctl_hw_t *hw;
|
||||
|
||||
|
|
@ -270,7 +271,12 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card)
|
|||
|
||||
assert(card >= 0 && card < 32);
|
||||
sprintf(filename, SNDRV_FILE_CONTROL, card);
|
||||
if ((fd = open(filename, O_RDWR)) < 0) {
|
||||
fmode = O_RDWR;
|
||||
if (mode & SND_CTL_NONBLOCK)
|
||||
fmode |= O_NONBLOCK;
|
||||
if (mode & SND_CTL_ASYNC)
|
||||
fmode |= O_ASYNC;
|
||||
if ((fd = open(filename, fmode)) < 0) {
|
||||
snd_card_load(card);
|
||||
if ((fd = open(filename, O_RDWR)) < 0)
|
||||
return -errno;
|
||||
|
|
@ -335,6 +341,6 @@ int _snd_ctl_hw_open(snd_ctl_t **handlep, char *name, snd_config_t *conf)
|
|||
}
|
||||
if (card < 0)
|
||||
return -EINVAL;
|
||||
return snd_ctl_hw_open(handlep, name, card);
|
||||
return snd_ctl_hw_open(handlep, name, card, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ struct _snd_ctl {
|
|||
snd_ctl_ops_t *ops;
|
||||
void *private_data;
|
||||
int nonblock;
|
||||
int async_sig;
|
||||
pid_t async_pid;
|
||||
};
|
||||
|
||||
struct _snd_hctl_elem {
|
||||
|
|
@ -77,5 +79,5 @@ struct _snd_hctl {
|
|||
|
||||
|
||||
int _snd_ctl_poll_descriptor(snd_ctl_t *ctl);
|
||||
int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card);
|
||||
int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *socket, const char *sname);
|
||||
int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode);
|
||||
int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *socket, const char *sname, int mode);
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ static int make_inet_socket(const char *host, int port)
|
|||
}
|
||||
#endif
|
||||
|
||||
int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *socket, const char *sname)
|
||||
int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *socket, const char *sname, int mode)
|
||||
{
|
||||
snd_ctl_t *ctl;
|
||||
snd_ctl_shm_t *shm = NULL;
|
||||
|
|
@ -430,7 +430,7 @@ int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *socket,
|
|||
req->dev_type = SND_DEV_TYPE_CONTROL;
|
||||
req->transport_type = SND_TRANSPORT_TYPE_SHM;
|
||||
req->stream = 0;
|
||||
req->mode = 0;
|
||||
req->mode = mode;
|
||||
req->namelen = snamelen;
|
||||
err = write(sock, req, reqlen);
|
||||
if (err < 0) {
|
||||
|
|
@ -498,7 +498,7 @@ int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *socket,
|
|||
|
||||
extern int is_local(struct hostent *hent);
|
||||
|
||||
int _snd_ctl_shm_open(snd_ctl_t **handlep, char *name, snd_config_t *conf)
|
||||
int _snd_ctl_shm_open(snd_ctl_t **handlep, char *name, snd_config_t *conf, int mode)
|
||||
{
|
||||
snd_config_iterator_t i, next;
|
||||
const char *server = NULL;
|
||||
|
|
@ -604,6 +604,6 @@ int _snd_ctl_shm_open(snd_ctl_t **handlep, char *name, snd_config_t *conf)
|
|||
SNDERR("%s is not the local host", host);
|
||||
return -EINVAL;
|
||||
}
|
||||
return snd_ctl_shm_open(handlep, name, socket, sname);
|
||||
return snd_ctl_shm_open(handlep, name, socket, sname, mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ int snd_defaults_pcm_device(void)
|
|||
if (result >= 0)
|
||||
return result;
|
||||
sprintf(id, "hw:%i", snd_defaults_pcm_card());
|
||||
if (snd_ctl_open(&handle, id) < 0)
|
||||
if (snd_ctl_open(&handle, id, 0) < 0)
|
||||
return -ENOENT;
|
||||
result = -1;
|
||||
if (snd_ctl_pcm_next_device(handle, &result) < 0) {
|
||||
|
|
@ -120,7 +120,7 @@ int snd_defaults_rawmidi_device(void)
|
|||
if (result >= 0)
|
||||
return result;
|
||||
sprintf(id, "hw:%i", snd_defaults_rawmidi_card());
|
||||
if (snd_ctl_open(&handle, id) < 0)
|
||||
if (snd_ctl_open(&handle, id, 0) < 0)
|
||||
return -ENOENT;
|
||||
result = -1;
|
||||
if (snd_ctl_rawmidi_next_device(handle, &result) < 0) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
static int snd_hctl_compare_default(const snd_hctl_elem_t *c1,
|
||||
const snd_hctl_elem_t *c2);
|
||||
|
||||
int snd_hctl_open(snd_hctl_t **hctlp, const char *name)
|
||||
int snd_hctl_open(snd_hctl_t **hctlp, const char *name, int mode)
|
||||
{
|
||||
snd_hctl_t *hctl;
|
||||
snd_ctl_t *ctl;
|
||||
|
|
@ -42,7 +42,7 @@ int snd_hctl_open(snd_hctl_t **hctlp, const char *name)
|
|||
|
||||
assert(hctlp);
|
||||
*hctlp = NULL;
|
||||
if ((err = snd_ctl_open(&ctl, name)) < 0)
|
||||
if ((err = snd_ctl_open(&ctl, name, mode)) < 0)
|
||||
return err;
|
||||
if ((hctl = (snd_hctl_t *)calloc(1, sizeof(snd_hctl_t))) == NULL) {
|
||||
snd_ctl_close(ctl);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ struct _snd_input {
|
|||
/**
|
||||
* \brief close input handle
|
||||
* \param input Input handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_input_close(snd_input_t *input)
|
||||
{
|
||||
|
|
@ -65,7 +65,7 @@ int snd_input_close(snd_input_t *input)
|
|||
* \param input Input handle
|
||||
* \param format fscanf format
|
||||
* \param ... other fscanf arguments
|
||||
* \return number of input itmes assigned or a negative error code
|
||||
* \return number of input items assigned otherwise a negative error code
|
||||
*/
|
||||
int snd_input_scanf(snd_input_t *input, const char *format, ...)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ static int snd_mixer_compare_default(const snd_mixer_elem_t *c1,
|
|||
const snd_mixer_elem_t *c2);
|
||||
|
||||
|
||||
int snd_mixer_open(snd_mixer_t **mixerp)
|
||||
int snd_mixer_open(snd_mixer_t **mixerp, int mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
snd_mixer_t *mixer;
|
||||
assert(mixerp);
|
||||
|
|
@ -152,7 +152,7 @@ int snd_mixer_attach(snd_mixer_t *mixer, const char *name)
|
|||
slave = calloc(1, sizeof(*slave));
|
||||
if (slave == NULL)
|
||||
return -ENOMEM;
|
||||
err = snd_hctl_open(&hctl, name);
|
||||
err = snd_hctl_open(&hctl, name, 0);
|
||||
if (err < 0) {
|
||||
free(slave);
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ struct _snd_output {
|
|||
/**
|
||||
* \brief close output handle
|
||||
* \param output Output handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_output_close(snd_output_t *output)
|
||||
{
|
||||
|
|
@ -65,7 +65,7 @@ int snd_output_close(snd_output_t *output)
|
|||
* \param output Output handle
|
||||
* \param format fprintf format
|
||||
* \param ... other fprintf arguments
|
||||
* \return number of characters written or a negative error code
|
||||
* \return number of characters written otherwise a negative error code
|
||||
*/
|
||||
int snd_output_printf(snd_output_t *output, const char *format, ...)
|
||||
{
|
||||
|
|
|
|||
198
src/pcm/pcm.c
198
src/pcm/pcm.c
|
|
@ -54,7 +54,7 @@
|
|||
* \return ascii identifier of PCM handle
|
||||
*
|
||||
* Returns the ASCII identifier of given PCM handle. It's the same
|
||||
* identifier as for snd_pcm_open().
|
||||
* identifier specified in snd_pcm_open().
|
||||
*/
|
||||
const char *snd_pcm_name(snd_pcm_t *pcm)
|
||||
{
|
||||
|
|
@ -91,7 +91,7 @@ snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm)
|
|||
/**
|
||||
* \brief close PCM handle
|
||||
* \param pcm PCM handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* Closes the specified PCM handle and frees all associated
|
||||
* resources.
|
||||
|
|
@ -124,7 +124,7 @@ int snd_pcm_close(snd_pcm_t *pcm)
|
|||
* \brief set nonblock mode
|
||||
* \param pcm PCM handle
|
||||
* \param nonblock 0 = block, 1 = nonblock mode
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock)
|
||||
{
|
||||
|
|
@ -144,7 +144,7 @@ int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock)
|
|||
* \param pcm PCM handle
|
||||
* \param sig Signal to raise: < 0 disable, 0 default (SIGIO)
|
||||
* \param pid Process ID to signal: 0 current
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* A signal is raised every period.
|
||||
*/
|
||||
|
|
@ -170,7 +170,7 @@ int snd_pcm_async(snd_pcm_t *pcm, int sig, pid_t pid)
|
|||
* \brief Obtain general (static) information for PCM handle
|
||||
* \param pcm PCM handle
|
||||
* \param info Information container
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
|
||||
{
|
||||
|
|
@ -181,7 +181,7 @@ int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
|
|||
/** \brief Install one PCM hardware configuration choosen from a configuration space and #snd_pcm_prepare it
|
||||
* \param pcm PCM handle
|
||||
* \param params Configuration space definition container
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* The configuration is choosen fixing single parameters in this order:
|
||||
* first access, first format, first subformat, min channels, min rate,
|
||||
|
|
@ -199,7 +199,7 @@ int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
|
||||
/** \brief Remove PCM hardware configuration and free associated resources
|
||||
* \param pcm PCM handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_hw_free(snd_pcm_t *pcm)
|
||||
{
|
||||
|
|
@ -219,7 +219,7 @@ int snd_pcm_hw_free(snd_pcm_t *pcm)
|
|||
/** \brief Install PCM software configuration defined by params
|
||||
* \param pcm PCM handle
|
||||
* \param params Configuration container
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
|
||||
{
|
||||
|
|
@ -244,7 +244,7 @@ int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
|
|||
* \brief Obtain status (runtime) information for PCM handle
|
||||
* \param pcm PCM handle
|
||||
* \param status Status container
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status)
|
||||
{
|
||||
|
|
@ -267,7 +267,7 @@ snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm)
|
|||
* \brief Obtain delay for a running PCM handle
|
||||
* \param pcm PCM handle
|
||||
* \param delayp Returned delay in frames
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* Delay is distance between current application frame position and
|
||||
* sound frame position.
|
||||
|
|
@ -285,7 +285,7 @@ int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
|
|||
/**
|
||||
* \brief Prepare PCM for use
|
||||
* \param pcm PCM handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_prepare(snd_pcm_t *pcm)
|
||||
{
|
||||
|
|
@ -297,7 +297,7 @@ int snd_pcm_prepare(snd_pcm_t *pcm)
|
|||
/**
|
||||
* \brief Reset PCM position
|
||||
* \param pcm PCM handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* Reduce PCM delay to 0.
|
||||
*/
|
||||
|
|
@ -311,7 +311,7 @@ int snd_pcm_reset(snd_pcm_t *pcm)
|
|||
/**
|
||||
* \brief Start a PCM
|
||||
* \param pcm PCM handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_start(snd_pcm_t *pcm)
|
||||
{
|
||||
|
|
@ -323,7 +323,7 @@ int snd_pcm_start(snd_pcm_t *pcm)
|
|||
/**
|
||||
* \brief Stop a PCM dropping pending frames
|
||||
* \param pcm PCM handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_drop(snd_pcm_t *pcm)
|
||||
{
|
||||
|
|
@ -335,7 +335,7 @@ int snd_pcm_drop(snd_pcm_t *pcm)
|
|||
/**
|
||||
* \brief Stop a PCM preserving pending frames
|
||||
* \param pcm PCM handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* For playback wait for all pending frames to be played and then stop
|
||||
* the PCM.
|
||||
|
|
@ -352,7 +352,7 @@ int snd_pcm_drain(snd_pcm_t *pcm)
|
|||
* \brief Pause/resume PCM
|
||||
* \param pcm PCM handle
|
||||
* \param pause 0 = resume, 1 = pause
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_pause(snd_pcm_t *pcm, int enable)
|
||||
{
|
||||
|
|
@ -448,7 +448,7 @@ snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t s
|
|||
* \brief Link two PCMs
|
||||
* \param pcm1 first PCM handle
|
||||
* \param pcm2 first PCM handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* The two PCMs will start/stop/prepare in sync.
|
||||
*/
|
||||
|
|
@ -468,7 +468,7 @@ int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
|
|||
/**
|
||||
* \brief Remove a PCM from a linked group
|
||||
* \param pcm PCM handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_unlink(snd_pcm_t *pcm)
|
||||
{
|
||||
|
|
@ -762,7 +762,7 @@ const char *snd_pcm_state_name(snd_pcm_state_t state)
|
|||
* \brief Dump current hardware setup for PCM
|
||||
* \param pcm PCM handle
|
||||
* \param out Output handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out)
|
||||
{
|
||||
|
|
@ -788,7 +788,7 @@ int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out)
|
|||
* \brief Dump current software setup for PCM
|
||||
* \param pcm PCM handle
|
||||
* \param out Output handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out)
|
||||
{
|
||||
|
|
@ -812,7 +812,7 @@ int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out)
|
|||
* \brief Dump current setup (hardware and software) for PCM
|
||||
* \param pcm PCM handle
|
||||
* \param out Output handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out)
|
||||
{
|
||||
|
|
@ -825,7 +825,7 @@ int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out)
|
|||
* \brief Dump status
|
||||
* \param status Status container
|
||||
* \param out Output handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out)
|
||||
{
|
||||
|
|
@ -845,7 +845,7 @@ int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out)
|
|||
* \brief Dump PCM info
|
||||
* \param pcm PCM handle
|
||||
* \param out Output handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out)
|
||||
{
|
||||
|
|
@ -913,7 +913,7 @@ ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, int samples)
|
|||
* \param name ASCII identifier of the PCM handle
|
||||
* \param stream Wanted stream
|
||||
* \param mode Open mode (see #SND_PCM_NONBLOCK, #SND_PCM_ASYNC)
|
||||
* \return 0 or a negative error code on failure or zero on success
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_open(snd_pcm_t **pcmp, const char *name,
|
||||
snd_pcm_stream_t stream, int mode)
|
||||
|
|
@ -1060,7 +1060,7 @@ int snd_pcm_open(snd_pcm_t **pcmp, const char *name,
|
|||
* \brief Wait for a PCM to become ready
|
||||
* \param pcm PCM handle
|
||||
* \param timeout maximum time in milliseconds to wait
|
||||
* \return 0 or a negative error code on failure or zero on success
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
|
||||
{
|
||||
|
|
@ -1111,7 +1111,7 @@ snd_pcm_sframes_t snd_pcm_mmap_forward(snd_pcm_t *pcm, snd_pcm_uframes_t size)
|
|||
* \param dst_offset offset in frames inside area
|
||||
* \param samples samples to silence
|
||||
* \param format PCM sample format
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t dst_offset,
|
||||
unsigned int samples, snd_pcm_format_t format)
|
||||
|
|
@ -1202,7 +1202,7 @@ int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes
|
|||
* \param channels channels count
|
||||
* \param frames frames to silence
|
||||
* \param format PCM sample format
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format)
|
||||
|
|
@ -1253,7 +1253,7 @@ int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_areas, snd_pcm_ufram
|
|||
* \param src_offset offset in frames inside source area
|
||||
* \param samples samples to copy
|
||||
* \param format PCM sample format
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_area, snd_pcm_uframes_t src_offset,
|
||||
|
|
@ -1360,7 +1360,7 @@ int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t
|
|||
* \param channels channels count
|
||||
* \param frames frames to copy
|
||||
* \param format PCM sample format
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
|
||||
|
|
@ -1417,7 +1417,7 @@ int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_
|
|||
* \brief Dump a PCM hardware configuration space
|
||||
* \param params Configuration space
|
||||
* \param out Output handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out)
|
||||
{
|
||||
|
|
@ -1435,7 +1435,7 @@ int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out)
|
|||
* \param params Configuration space
|
||||
* \param rate_num Pointer to returned rate numerator
|
||||
* \param rate_den Pointer to returned rate denominator
|
||||
* \return 0 or a negative error code if the info is not available
|
||||
* \return 0 otherwise a negative error code if the info is not available
|
||||
*/
|
||||
int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
|
||||
unsigned int *rate_num, unsigned int *rate_den)
|
||||
|
|
@ -1450,7 +1450,7 @@ int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
|
|||
/**
|
||||
* \brief Get sample resolution info from a configuration space
|
||||
* \param params Configuration space
|
||||
* \return significative bits in sample or a negative error code if the info is not available
|
||||
* \return significative bits in sample otherwise a negative error code if the info is not available
|
||||
*/
|
||||
int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
@ -1462,7 +1462,7 @@ int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params)
|
|||
/**
|
||||
* \brief Get hardare fifo size info from a configuration space
|
||||
* \param params Configuration space
|
||||
* \return fifo size in frames or a negative error code if the info is not available
|
||||
* \return fifo size in frames otherwise a negative error code if the info is not available
|
||||
*/
|
||||
int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
@ -1494,7 +1494,7 @@ size_t snd_pcm_access_mask_sizeof()
|
|||
/**
|
||||
* \brief allocate an empty #snd_pcm_access_mask_t using standard malloc
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success otherwise negative error code
|
||||
* \return 0 on success otherwise negative error code
|
||||
*/
|
||||
int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr)
|
||||
{
|
||||
|
|
@ -1585,7 +1585,7 @@ size_t snd_pcm_format_mask_sizeof()
|
|||
/**
|
||||
* \brief allocate an empty #snd_pcm_format_mask_t using standard malloc
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success otherwise negative error code
|
||||
* \return 0 on success otherwise negative error code
|
||||
*/
|
||||
int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr)
|
||||
{
|
||||
|
|
@ -1677,7 +1677,7 @@ size_t snd_pcm_subformat_mask_sizeof()
|
|||
/**
|
||||
* \brief allocate an empty #snd_pcm_subformat_mask_t using standard malloc
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success otherwise negative error code
|
||||
* \return 0 on success otherwise negative error code
|
||||
*/
|
||||
int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr)
|
||||
{
|
||||
|
|
@ -1769,7 +1769,7 @@ size_t snd_pcm_hw_params_sizeof()
|
|||
/**
|
||||
* \brief allocate an invalid #snd_pcm_hw_params_t using standard malloc
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success otherwise negative error code
|
||||
* \return 0 on success otherwise negative error code
|
||||
*/
|
||||
int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr)
|
||||
{
|
||||
|
|
@ -1803,7 +1803,7 @@ void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t
|
|||
/**
|
||||
* \brief Extract access type from a configuration space
|
||||
* \param params Configuration space
|
||||
* \return access type or a negative error code if not exactly one is present
|
||||
* \return access type otherwise a negative error code if not exactly one is present
|
||||
*/
|
||||
int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
@ -1827,7 +1827,7 @@ int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, s
|
|||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \param val access type
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*/
|
||||
int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t val)
|
||||
{
|
||||
|
|
@ -1872,7 +1872,7 @@ int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *param
|
|||
/**
|
||||
* \brief Extract format from a configuration space
|
||||
* \param params Configuration space
|
||||
* \return format or a negative error code if not exactly one is present
|
||||
* \return format otherwise a negative error code if not exactly one is present
|
||||
*/
|
||||
int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
@ -1896,7 +1896,7 @@ int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, s
|
|||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \param val format
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*/
|
||||
int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)
|
||||
{
|
||||
|
|
@ -1953,7 +1953,7 @@ int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params
|
|||
/**
|
||||
* \brief Extract subformat from a configuration space
|
||||
* \param params Configuration space
|
||||
* \return subformat or a negative error code if not exactly one is present
|
||||
* \return subformat otherwise a negative error code if not exactly one is present
|
||||
*/
|
||||
int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
@ -1965,7 +1965,7 @@ int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params)
|
|||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \param val subformat
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*/
|
||||
int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t val)
|
||||
{
|
||||
|
|
@ -2010,7 +2010,7 @@ int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *pa
|
|||
/**
|
||||
* \brief Extract channels from a configuration space
|
||||
* \param params Configuration space
|
||||
* \return channels count or a negative error code if not exactly one is present
|
||||
* \return channels count otherwise a negative error code if not exactly one is present
|
||||
*/
|
||||
int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
@ -2054,7 +2054,7 @@ int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \param val channels count
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*/
|
||||
int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
|
||||
{
|
||||
|
|
@ -2066,7 +2066,7 @@ int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \param val minimum channels count (on return filled with actual minimum)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*/
|
||||
int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
|
||||
{
|
||||
|
|
@ -2078,7 +2078,7 @@ int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *para
|
|||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \param val maximum channels count (on return filled with actual maximum)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*/
|
||||
int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
|
||||
{
|
||||
|
|
@ -2091,7 +2091,7 @@ int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *para
|
|||
* \param params Configuration space
|
||||
* \param min minimum channels count (on return filled with actual minimum)
|
||||
* \param max maximum channels count (on return filled with actual maximum)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*/
|
||||
int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max)
|
||||
{
|
||||
|
|
@ -2137,7 +2137,7 @@ unsigned int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_para
|
|||
* \brief Extract rate from a configuration space
|
||||
* \param params Configuration space
|
||||
* \param dir Sub unit direction
|
||||
* \return approximate rate or a negative error code if not exactly one is present
|
||||
* \return approximate rate otherwise a negative error code if not exactly one is present
|
||||
*
|
||||
* Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)
|
||||
*/
|
||||
|
|
@ -2193,7 +2193,7 @@ int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, uns
|
|||
* \param params Configuration space
|
||||
* \param val approximate rate
|
||||
* \param dir Sub unit direction
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted exact value is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2208,7 +2208,7 @@ int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsi
|
|||
* \param params Configuration space
|
||||
* \param val approximate minimum rate (on return filled with actual minimum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2223,7 +2223,7 @@ int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
* \param params Configuration space
|
||||
* \param val approximate maximum rate (on return filled with actual maximum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2240,7 +2240,7 @@ int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
* \param mindir Sub unit direction for minimum (on return filled with actual direction)
|
||||
* \param max approximate maximum rate (on return filled with actual maximum)
|
||||
* \param maxdir Sub unit direction for maximum (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2296,7 +2296,7 @@ unsigned int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t
|
|||
* \brief Extract period time from a configuration space
|
||||
* \param params Configuration space
|
||||
* \param dir Sub unit direction
|
||||
* \return approximate period duration in us or a negative error code if not exactly one is present
|
||||
* \return approximate period duration in us otherwise a negative error code if not exactly one is present
|
||||
*
|
||||
* Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)
|
||||
*/
|
||||
|
|
@ -2352,7 +2352,7 @@ int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *para
|
|||
* \param params Configuration space
|
||||
* \param val approximate period duration in us
|
||||
* \param dir Sub unit direction
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted exact value is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2368,7 +2368,7 @@ int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *param
|
|||
* \param params Configuration space
|
||||
* \param val approximate minimum period duration in us (on return filled with actual minimum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2383,7 +2383,7 @@ int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
* \param params Configuration space
|
||||
* \param val approximate maximum period duration in us (on return filled with actual maximum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2400,7 +2400,7 @@ int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
* \param mindir Sub unit direction for minimum (on return filled with actual direction)
|
||||
* \param max approximate maximum period duration in us (on return filled with actual maximum)
|
||||
* \param maxdir Sub unit direction for maximum (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2456,7 +2456,7 @@ unsigned int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_p
|
|||
* \brief Extract period size from a configuration space
|
||||
* \param params Configuration space
|
||||
* \param dir Sub unit direction
|
||||
* \return approximate period size in frames or a negative error code if not exactly one is present
|
||||
* \return approximate period size in frames otherwise a negative error code if not exactly one is present
|
||||
*
|
||||
* Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)
|
||||
*/
|
||||
|
|
@ -2512,7 +2512,7 @@ int snd_pcm_hw_params_test_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *para
|
|||
* \param params Configuration space
|
||||
* \param val approximate period size in frames
|
||||
* \param dir Sub unit direction
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted exact value is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2527,7 +2527,7 @@ int snd_pcm_hw_params_set_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *param
|
|||
* \param params Configuration space
|
||||
* \param val approximate minimum period size in frames (on return filled with actual minimum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2545,7 +2545,7 @@ int snd_pcm_hw_params_set_period_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
* \param params Configuration space
|
||||
* \param val approximate maximum period size in frames (on return filled with actual maximum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2565,7 +2565,7 @@ int snd_pcm_hw_params_set_period_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
* \param mindir Sub unit direction for minimum (on return filled with actual direction)
|
||||
* \param max approximate maximum period size in frames (on return filled with actual maximum)
|
||||
* \param maxdir Sub unit direction for maximum (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2625,7 +2625,7 @@ snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_last(snd_pcm_t *pcm, snd_pcm
|
|||
* \brief Restrict a configuration space to contain only integer period sizes
|
||||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*/
|
||||
int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
@ -2637,7 +2637,7 @@ int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_
|
|||
* \brief Extract periods from a configuration space
|
||||
* \param params Configuration space
|
||||
* \param dir Sub unit direction
|
||||
* \return approximate periods per buffer or a negative error code if not exactly one is present
|
||||
* \return approximate periods per buffer otherwise a negative error code if not exactly one is present
|
||||
*
|
||||
* Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)
|
||||
*/
|
||||
|
|
@ -2693,7 +2693,7 @@ int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
* \param params Configuration space
|
||||
* \param val approximate periods per buffer
|
||||
* \param dir Sub unit direction
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted exact value is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2708,7 +2708,7 @@ int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, u
|
|||
* \param params Configuration space
|
||||
* \param val approximate minimum periods per buffer (on return filled with actual minimum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2723,7 +2723,7 @@ int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *param
|
|||
* \param params Configuration space
|
||||
* \param val approximate maximum periods per buffer (on return filled with actual maximum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2740,7 +2740,7 @@ int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *param
|
|||
* \param mindir Sub unit direction for minimum (on return filled with actual direction)
|
||||
* \param max approximate maximum periods per buffer (on return filled with actual maximum)
|
||||
* \param maxdir Sub unit direction for maximum (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2795,7 +2795,7 @@ unsigned int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_param
|
|||
* \brief Restrict a configuration space to contain only integer periods counts
|
||||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*/
|
||||
int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
@ -2807,7 +2807,7 @@ int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
* \brief Extract buffer time from a configuration space
|
||||
* \param params Configuration space
|
||||
* \param dir Sub unit direction
|
||||
* \return approximate buffer duration in us or a negative error code if not exactly one is present
|
||||
* \return approximate buffer duration in us otherwise a negative error code if not exactly one is present
|
||||
*
|
||||
* Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)
|
||||
*/
|
||||
|
|
@ -2863,7 +2863,7 @@ int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *para
|
|||
* \param params Configuration space
|
||||
* \param val approximate buffer duration in us
|
||||
* \param dir Sub unit direction
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted exact value is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2878,7 +2878,7 @@ int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *param
|
|||
* \param params Configuration space
|
||||
* \param val approximate minimum buffer duration in us (on return filled with actual minimum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2893,7 +2893,7 @@ int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
* \param params Configuration space
|
||||
* \param val approximate maximum buffer duration in us (on return filled with actual maximum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2910,7 +2910,7 @@ int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
* \param mindir Sub unit direction for minimum (on return filled with actual direction)
|
||||
* \param max approximate maximum buffer duration in us (on return filled with actual maximum)
|
||||
* \param maxdir Sub unit direction for maximum (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -2965,7 +2965,7 @@ unsigned int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_p
|
|||
/**
|
||||
* \brief Extract buffer size from a configuration space
|
||||
* \param params Configuration space
|
||||
* \return buffer size in frames or a negative error code if not exactly one is present
|
||||
* \return buffer size in frames otherwise a negative error code if not exactly one is present
|
||||
*/
|
||||
snd_pcm_sframes_t snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
@ -3018,7 +3018,7 @@ int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *para
|
|||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \param val buffer size in frames
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted exact value is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -3033,7 +3033,7 @@ int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *param
|
|||
* \param params Configuration space
|
||||
* \param val approximate minimum buffer size in frames (on return filled with actual minimum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -3051,7 +3051,7 @@ int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
* \param params Configuration space
|
||||
* \param val approximate maximum buffer size in frames (on return filled with actual maximum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -3071,7 +3071,7 @@ int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
* \param mindir Sub unit direction for minimum (on return filled with actual direction)
|
||||
* \param max approximate maximum buffer size in frames (on return filled with actual maximum)
|
||||
* \param maxdir Sub unit direction for maximum (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -3126,7 +3126,7 @@ snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm
|
|||
* \brief Extract tick time from a configuration space
|
||||
* \param params Configuration space
|
||||
* \param dir Sub unit direction
|
||||
* \return approximate tick duration in us or a negative error code if not exactly one is present
|
||||
* \return approximate tick duration in us otherwise a negative error code if not exactly one is present
|
||||
*
|
||||
* Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)
|
||||
*/
|
||||
|
|
@ -3182,7 +3182,7 @@ int snd_pcm_hw_params_test_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params
|
|||
* \param params Configuration space
|
||||
* \param val approximate tick duration in us
|
||||
* \param dir Sub unit direction
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted exact value is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -3197,7 +3197,7 @@ int snd_pcm_hw_params_set_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
* \param params Configuration space
|
||||
* \param val approximate minimum tick duration in us (on return filled with actual minimum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -3212,7 +3212,7 @@ int snd_pcm_hw_params_set_tick_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
|
|||
* \param params Configuration space
|
||||
* \param val approximate maximum tick duration in us (on return filled with actual maximum)
|
||||
* \param dir Sub unit direction (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -3229,7 +3229,7 @@ int snd_pcm_hw_params_set_tick_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
|
|||
* \param mindir Sub unit direction for minimum (on return filled with actual direction)
|
||||
* \param max approximate maximum tick duration in us (on return filled with actual maximum)
|
||||
* \param maxdir Sub unit direction for maximum (on return filled with actual direction)
|
||||
* \return 0 or a negative error code if configuration space would become empty
|
||||
* \return 0 otherwise a negative error code if configuration space would become empty
|
||||
*
|
||||
* Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)
|
||||
*/
|
||||
|
|
@ -3284,7 +3284,7 @@ unsigned int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_par
|
|||
* \brief Return current software configuration for a PCM
|
||||
* \param pcm PCM handle
|
||||
* \param params Software configuration container
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
|
||||
{
|
||||
|
|
@ -3307,7 +3307,7 @@ int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
|
|||
* \brief Dump a software configuration
|
||||
* \param params Software configuration container
|
||||
* \param out Output handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out)
|
||||
{
|
||||
|
|
@ -3336,7 +3336,7 @@ size_t snd_pcm_sw_params_sizeof()
|
|||
/**
|
||||
* \brief allocate an invalid #snd_pcm_sw_params_t using standard malloc
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success otherwise negative error code
|
||||
* \return 0 on success otherwise negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr)
|
||||
{
|
||||
|
|
@ -3372,7 +3372,7 @@ void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t
|
|||
* \param pcm PCM handle
|
||||
* \param params Software configuration container
|
||||
* \param val Start mode
|
||||
* \return 0 or a negative error code
|
||||
* \return 0 otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params_set_start_mode(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sw_params_t *params, snd_pcm_start_t val)
|
||||
{
|
||||
|
|
@ -3399,7 +3399,7 @@ snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *para
|
|||
* \param pcm PCM handle
|
||||
* \param params Software configuration container
|
||||
* \param val Xrun mode
|
||||
* \return 0 or a negative error code
|
||||
* \return 0 otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params_set_xrun_mode(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sw_params_t *params, snd_pcm_xrun_t val)
|
||||
{
|
||||
|
|
@ -3426,7 +3426,7 @@ snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params
|
|||
* \param pcm PCM handle
|
||||
* \param params Software configuration container
|
||||
* \param val Timestamp mode
|
||||
* \return 0 or a negative error code
|
||||
* \return 0 otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val)
|
||||
{
|
||||
|
|
@ -3469,7 +3469,7 @@ unsigned int snd_pcm_sw_params_get_period_step(const snd_pcm_sw_params_t *params
|
|||
* \param pcm PCM handle
|
||||
* \param params Software configuration container
|
||||
* \param val Minimum ticks to sleep or 0 to disable the use of tick timer
|
||||
* \return 0 or a negative error code
|
||||
* \return 0 otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sw_params_t *params, unsigned int val)
|
||||
{
|
||||
|
|
@ -3494,7 +3494,7 @@ unsigned int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params)
|
|||
* \param pcm PCM handle
|
||||
* \param params Software configuration container
|
||||
* \param val Minimum avail frames to consider PCM ready
|
||||
* \return 0 or a negative error code
|
||||
* \return 0 otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
|
||||
{
|
||||
|
|
@ -3520,7 +3520,7 @@ snd_pcm_uframes_t snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *par
|
|||
* \param pcm PCM handle
|
||||
* \param params Software configuration container
|
||||
* \param val Chunk size (frames are attempted to be transferred in chunks)
|
||||
* \return 0 or a negative error code
|
||||
* \return 0 otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
|
||||
{
|
||||
|
|
@ -3547,7 +3547,7 @@ snd_pcm_uframes_t snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *pa
|
|||
* \param pcm PCM handle
|
||||
* \param params Software configuration container
|
||||
* \param val Silence threshold in frames
|
||||
* \return 0 or a negative error code
|
||||
* \return 0 otherwise a negative error code
|
||||
*
|
||||
* A portion of playback buffer is overwritten with silence (see
|
||||
* #snd_pcm_sw_params_set_silence_size) when playback underrun is nearer
|
||||
|
|
@ -3582,7 +3582,7 @@ snd_pcm_uframes_t snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_param
|
|||
* \param pcm PCM handle
|
||||
* \param params Software configuration container
|
||||
* \param val Silence size in frames (0 for disabled)
|
||||
* \return 0 or a negative error code
|
||||
* \return 0 otherwise a negative error code
|
||||
*
|
||||
* A portion of playback buffer is overwritten with silence when playback
|
||||
* underrun is nearer than silence threshold (see
|
||||
|
|
@ -3624,7 +3624,7 @@ size_t snd_pcm_status_sizeof()
|
|||
/**
|
||||
* \brief allocate an invalid #snd_pcm_status_t using standard malloc
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success otherwise negative error code
|
||||
* \return 0 on success otherwise negative error code
|
||||
*/
|
||||
int snd_pcm_status_malloc(snd_pcm_status_t **ptr)
|
||||
{
|
||||
|
|
@ -3733,7 +3733,7 @@ size_t snd_pcm_info_sizeof()
|
|||
/**
|
||||
* \brief allocate an invalid #snd_pcm_info_t using standard malloc
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success otherwise negative error code
|
||||
* \return 0 on success otherwise negative error code
|
||||
*/
|
||||
int snd_pcm_info_malloc(snd_pcm_info_t **ptr)
|
||||
{
|
||||
|
|
@ -3800,7 +3800,7 @@ snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj)
|
|||
/**
|
||||
* \brief Get card from a PCM info container
|
||||
* \param obj PCM info container
|
||||
* \return card number or a negative error code if not associable to a card
|
||||
* \return card number otherwise a negative error code if not associable to a card
|
||||
*/
|
||||
int snd_pcm_info_get_card(const snd_pcm_info_t *obj)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ int snd_pcm_hw_open_subdevice(snd_pcm_t **pcmp, int card, int device, int subdev
|
|||
|
||||
assert(pcmp);
|
||||
|
||||
if ((ret = snd_ctl_hw_open(&ctl, NULL, card)) < 0)
|
||||
if ((ret = snd_ctl_hw_open(&ctl, NULL, card, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
switch (snd_enum_to_int(stream)) {
|
||||
|
|
|
|||
|
|
@ -785,7 +785,7 @@ int _snd_pcm_meter_open(snd_pcm_t **pcmp, const char *name,
|
|||
* \brief Add a scope to a #SND_PCM_TYPE_METER PCM
|
||||
* \param pcm PCM handle
|
||||
* \param scope Scope handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope)
|
||||
{
|
||||
|
|
@ -1115,7 +1115,7 @@ snd_pcm_scope_ops_t s16_ops = {
|
|||
* \brief Add a s16 pseudo scope to a #SND_PCM_TYPE_METER PCM
|
||||
* \param name Scope name
|
||||
* \param scopep Pointer to newly created and added scope
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* s16 pseudo scope convert #SND_PCM_TYPE_METER PCM frames in CPU endian
|
||||
* 16 bit frames for use with other scopes. Don't forget to insert it before
|
||||
|
|
@ -1170,7 +1170,7 @@ int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
|
|||
/**
|
||||
* \brief allocate an invalid #snd_pcm_scope_t using standard malloc
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success otherwise negative error code
|
||||
* \return 0 on success otherwise negative error code
|
||||
*/
|
||||
int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2043,7 +2043,7 @@ int snd_pcm_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
min rate
|
||||
min period_size
|
||||
max periods
|
||||
Return 0 on success or a negative number expressing the error.
|
||||
Return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int _snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
* \brief setup the default parameters
|
||||
* \param rawmidi RawMidi handle
|
||||
* \param params pointer to a snd_rawmidi_params_t structure
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
static int snd_rawmidi_params_default(snd_rawmidi_t *rawmidi, snd_rawmidi_params_t *params)
|
||||
{
|
||||
|
|
@ -66,7 +66,7 @@ static int snd_rawmidi_params_default(snd_rawmidi_t *rawmidi, snd_rawmidi_params
|
|||
* \param outputp Returned output handle (NULL if not wanted)
|
||||
* \param name ASCII identifier of the RawMidi handle
|
||||
* \param mode Open mode
|
||||
* \return a negative error code on failure or zero on success
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* Opens a new connection to the RawMidi interface specified with
|
||||
* an ASCII identifier and mode.
|
||||
|
|
@ -179,7 +179,7 @@ int snd_rawmidi_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
|
|||
/**
|
||||
* \brief close RawMidi handle
|
||||
* \param rawmidi RawMidi handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* Closes the specified RawMidi handle and frees all associated
|
||||
* resources.
|
||||
|
|
@ -202,7 +202,7 @@ int snd_rawmidi_close(snd_rawmidi_t *rawmidi)
|
|||
* \return ascii identifier of RawMidi handle
|
||||
*
|
||||
* Returns the ASCII identifier of given RawMidi handle. It's the same
|
||||
* identifier as for snd_rawmidi_open().
|
||||
* identifier specified in snd_rawmidi_open().
|
||||
*/
|
||||
const char *snd_rawmidi_name(snd_rawmidi_t *rawmidi)
|
||||
{
|
||||
|
|
@ -269,7 +269,7 @@ int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rawmidi, struct pollfd *pfds, un
|
|||
* \brief set nonblock mode
|
||||
* \param rawmidi RawMidi handle
|
||||
* \param nonblock 0 = block, 1 = nonblock mode
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_rawmidi_nonblock(snd_rawmidi_t *rawmidi, int nonblock)
|
||||
{
|
||||
|
|
@ -297,7 +297,7 @@ size_t snd_rawmidi_info_sizeof()
|
|||
/**
|
||||
* \brief allocate a new snd_rawmidi_info_t structure
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success or a negative error code if fails
|
||||
* \return 0 on success otherwise a negative error code if fails
|
||||
*
|
||||
* Allocates a new snd_rawmidi_params_t structure using the standard
|
||||
* malloc C library function.
|
||||
|
|
@ -482,7 +482,7 @@ void snd_rawmidi_info_set_stream(snd_rawmidi_info_t *info, snd_rawmidi_stream_t
|
|||
* \brief get information about RawMidi handle
|
||||
* \param rawmidi RawMidi handle
|
||||
* \param info pointer to a snd_rawmidi_info_t structure to be filled
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_rawmidi_info(snd_rawmidi_t *rawmidi, snd_rawmidi_info_t * info)
|
||||
{
|
||||
|
|
@ -503,7 +503,7 @@ size_t snd_rawmidi_params_sizeof()
|
|||
/**
|
||||
* \brief allocate the snd_rawmidi_params_t structure
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success or a negative error code if fails
|
||||
* \return 0 on success otherwise a negative error code if fails
|
||||
*
|
||||
* Allocates a new snd_rawmidi_params_t structure using the standard
|
||||
* malloc C library function.
|
||||
|
|
@ -546,7 +546,7 @@ void snd_rawmidi_params_copy(snd_rawmidi_params_t *dst, const snd_rawmidi_params
|
|||
* \param rawmidi RawMidi handle
|
||||
* \param params pointer to a snd_rawmidi_params_t structure
|
||||
* \param val size in bytes
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_rawmidi_params_set_buffer_size(snd_rawmidi_t *rawmidi ATTRIBUTE_UNUSED, snd_rawmidi_params_t *params, size_t val)
|
||||
{
|
||||
|
|
@ -597,7 +597,7 @@ size_t snd_rawmidi_params_get_avail_min(const snd_rawmidi_params_t *params)
|
|||
* \param rawmidi RawMidi handle
|
||||
* \param params pointer to snd_rawmidi_params_t structure
|
||||
* \param val value: 0 = enable to send the active sensing message, 1 = disable
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_rawmidi_params_set_no_active_sensing(snd_rawmidi_t *rawmidi ATTRIBUTE_UNUSED, snd_rawmidi_params_t *params, int val)
|
||||
{
|
||||
|
|
@ -621,7 +621,7 @@ int snd_rawmidi_params_get_no_active_sensing(const snd_rawmidi_params_t *params)
|
|||
* \brief get parameters about rawmidi stream
|
||||
* \param rawmidi RawMidi handle
|
||||
* \param params pointer to a snd_rawmidi_params_t structure to be filled
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_rawmidi_params(snd_rawmidi_t *rawmidi, snd_rawmidi_params_t * params)
|
||||
{
|
||||
|
|
@ -641,7 +641,7 @@ int snd_rawmidi_params(snd_rawmidi_t *rawmidi, snd_rawmidi_params_t * params)
|
|||
* \brief get current parameters about rawmidi stream
|
||||
* \param rawmidi RawMidi handle
|
||||
* \param params pointer to a snd_rawmidi_params_t structure to be filled
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_rawmidi_params_current(snd_rawmidi_t *rawmidi, snd_rawmidi_params_t *params)
|
||||
{
|
||||
|
|
@ -665,7 +665,7 @@ size_t snd_rawmidi_status_sizeof()
|
|||
/**
|
||||
* \brief allocate the snd_rawmidi_status_t structure
|
||||
* \param ptr returned pointer
|
||||
* \return zero on success or a negative error code if fails
|
||||
* \return 0 on success otherwise a negative error code if fails
|
||||
*
|
||||
* Allocates a new snd_rawmidi_status_t structure using the standard
|
||||
* malloc C library function.
|
||||
|
|
@ -740,7 +740,7 @@ size_t snd_rawmidi_status_get_xruns(const snd_rawmidi_status_t *status)
|
|||
* \brief get status of rawmidi stream
|
||||
* \param rawmidi RawMidi handle
|
||||
* \param status pointer to a snd_rawmidi_status_t structure to be filled
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_rawmidi_status(snd_rawmidi_t *rawmidi, snd_rawmidi_status_t * status)
|
||||
{
|
||||
|
|
@ -752,7 +752,7 @@ int snd_rawmidi_status(snd_rawmidi_t *rawmidi, snd_rawmidi_status_t * status)
|
|||
/**
|
||||
* \brief drop all bytes in the rawmidi I/O ring buffer immediately
|
||||
* \param rawmidi RawMidi handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*/
|
||||
int snd_rawmidi_drop(snd_rawmidi_t *rawmidi)
|
||||
{
|
||||
|
|
@ -763,7 +763,7 @@ int snd_rawmidi_drop(snd_rawmidi_t *rawmidi)
|
|||
/**
|
||||
* \brief drain all bytes in the rawmidi I/O ring buffer
|
||||
* \param rawmidi RawMidi handle
|
||||
* \return zero on success otherwise a negative error code
|
||||
* \return 0 on success otherwise a negative error code
|
||||
*
|
||||
* Waits until all MIDI bytes are not drained (sent) to the
|
||||
* hardware device.
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ int snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
|
|||
if (outputp)
|
||||
*outputp = NULL;
|
||||
|
||||
if ((ret = snd_ctl_hw_open(&ctl, NULL, card)) < 0)
|
||||
if ((ret = snd_ctl_hw_open(&ctl, NULL, card, 0)) < 0)
|
||||
return ret;
|
||||
sprintf(filename, SNDRV_FILE_RAWMIDI, card, device);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ struct _snd_timer {
|
|||
int fd;
|
||||
};
|
||||
|
||||
int snd_timer_open(snd_timer_t **handle)
|
||||
int snd_timer_open(snd_timer_t **handle, int mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int fd, ver;
|
||||
snd_timer_t *tmr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue