mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
Big rawmidi update - added subdevices support.
This commit is contained in:
parent
1e9a496217
commit
cc214bdfea
3 changed files with 10 additions and 22 deletions
|
|
@ -163,35 +163,24 @@ int snd_rawmidi_info(snd_rawmidi_t *rmidi, snd_rawmidi_info_t * info)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_stream_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t * params)
|
||||
int snd_rawmidi_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t * params)
|
||||
{
|
||||
if (!rmidi || !params)
|
||||
return -EINVAL;
|
||||
if (params->stream < 0 || params->stream > 1)
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_STREAM_PARAMS, params) < 0)
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_PARAMS, params) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_stream_setup(snd_rawmidi_t *rmidi, snd_rawmidi_setup_t * setup)
|
||||
{
|
||||
if (!rmidi || !setup)
|
||||
return -EINVAL;
|
||||
if (setup->stream < 0 || setup->stream > 1)
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_STREAM_SETUP, setup) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_stream_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * status)
|
||||
int snd_rawmidi_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * status)
|
||||
{
|
||||
if (!rmidi || !status)
|
||||
return -EINVAL;
|
||||
if (status->stream < 0 || status->stream > 1)
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_STREAM_STATUS, status) < 0)
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_STATUS, status) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -201,7 +190,7 @@ int snd_rawmidi_output_drop(snd_rawmidi_t *rmidi)
|
|||
int str = SND_RAWMIDI_STREAM_OUTPUT;
|
||||
if (!rmidi)
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_STREAM_DROP, &str) < 0)
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_DROP, &str) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -212,7 +201,7 @@ int snd_rawmidi_stream_drain(snd_rawmidi_t *rmidi, int str)
|
|||
return -EINVAL;
|
||||
if (str < 0 || str > 1)
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_STREAM_DRAIN, &str) < 0)
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_DRAIN, &str) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue