Control API encapsulation. Better names for kernel API. Simpler PCM hw_params API. Added missing const.

This commit is contained in:
Abramo Bagnara 2001-02-06 23:48:10 +00:00
parent ccb399f0cd
commit 8f0cb26fdf
71 changed files with 2001 additions and 694 deletions

View file

@ -23,7 +23,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@ -73,7 +72,7 @@ int snd_card_get_index(const char *string)
{
int card;
snd_ctl_t *handle;
snd_ctl_hw_info_t info;
snd_ctl_info_t info;
if (!string || *string == '\0')
return -EINVAL;
@ -91,7 +90,7 @@ int snd_card_get_index(const char *string)
continue;
if (snd_ctl_hw_open(&handle, NULL, card) < 0)
continue;
if (snd_ctl_hw_info(handle, &info) < 0) {
if (snd_ctl_info(handle, &info) < 0) {
snd_ctl_close(handle);
continue;
}
@ -105,14 +104,14 @@ int snd_card_get_index(const char *string)
int snd_card_get_name(int card, char **name)
{
snd_ctl_t *handle;
snd_ctl_hw_info_t info;
snd_ctl_info_t info;
int err;
if (name == NULL)
return -EINVAL;
if ((err = snd_ctl_hw_open(&handle, NULL, card)) < 0)
return err;
if ((err = snd_ctl_hw_info(handle, &info)) < 0) {
if ((err = snd_ctl_info(handle, &info)) < 0) {
snd_ctl_close(handle);
return err;
}
@ -126,14 +125,14 @@ int snd_card_get_name(int card, char **name)
int snd_card_get_longname(int card, char **name)
{
snd_ctl_t *handle;
snd_ctl_hw_info_t info;
snd_ctl_info_t info;
int err;
if (name == NULL)
return -EINVAL;
if ((err = snd_ctl_hw_open(&handle, NULL, card)) < 0)
return err;
if ((err = snd_ctl_hw_info(handle, &info)) < 0) {
if ((err = snd_ctl_info(handle, &info)) < 0) {
snd_ctl_close(handle);
return err;
}