More generic support for poll descriptors

This commit is contained in:
Abramo Bagnara 2001-02-12 23:51:49 +00:00
parent a86efa083c
commit 460660d4b4
25 changed files with 162 additions and 68 deletions

View file

@ -52,12 +52,23 @@ int snd_rawmidi_close(snd_rawmidi_t *rmidi)
return 0;
}
int snd_rawmidi_poll_descriptor(snd_rawmidi_t *rmidi)
int _snd_rawmidi_poll_descriptor(snd_rawmidi_t *rmidi)
{
assert(rmidi);
return rmidi->poll_fd;
}
int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space)
{
assert(rmidi);
if (space >= 1) {
pfds->fd = rmidi->poll_fd;
pfds->events = rmidi->stream == SND_RAWMIDI_STREAM_OUTPUT ? POLLOUT : POLLIN;
}
return 1;
}
int snd_rawmidi_nonblock(snd_rawmidi_t *rmidi, int nonblock)
{
int err;