mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
Updates for the control interface...
This commit is contained in:
parent
d00535cc1b
commit
227fe9d226
4 changed files with 19 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ libasound_la_SOURCES = error.c
|
|||
libasound_la_LIBADD = control/libcontrol.la mixer/libmixer.la pcm/libpcm.la \
|
||||
rawmidi/librawmidi.la timer/libtimer.la seq/libseq.la \
|
||||
instr/libinstr.la
|
||||
libasound_la_LDFLAGS = -version-info 3:1:3
|
||||
libasound_la_LDFLAGS = -version-info 4:0:4
|
||||
|
||||
control/libcontrol.la:
|
||||
$(MAKE) -C control libcontrol.la
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include "asoundlib.h"
|
||||
|
||||
#define SND_FILE_CONTROL "/dev/snd/controlC%i"
|
||||
#define SND_CTL_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
|
||||
#define SND_CTL_VERSION_MAX SND_PROTOCOL_VERSION(2, 0, 0)
|
||||
|
||||
struct snd_ctl {
|
||||
int card;
|
||||
|
|
@ -143,6 +143,20 @@ int snd_ctl_switch_write(snd_ctl_t *handle, snd_switch_t *sw)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int snd_ctl_hwdep_info(snd_ctl_t *handle, int dev, snd_hwdep_info_t * info)
|
||||
{
|
||||
snd_ctl_t *ctl;
|
||||
|
||||
ctl = handle;
|
||||
if (!ctl || !info || dev < 0)
|
||||
return -EINVAL;
|
||||
if (ioctl(ctl->fd, SND_CTL_IOCTL_HWDEP_DEVICE, &dev) < 0)
|
||||
return -errno;
|
||||
if (ioctl(ctl->fd, SND_CTL_IOCTL_HWDEP_INFO, info) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_ctl_pcm_info(snd_ctl_t *handle, int dev, snd_pcm_info_t * info)
|
||||
{
|
||||
snd_ctl_t *ctl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue