mirror of https://github.com/ericonr/sndio.git
Merge branch 'master' into mixer
This commit is contained in:
commit
33d512b797
|
@ -1165,6 +1165,7 @@ playrec(char *dev, int mode, int bufsz, char *port)
|
||||||
if (dev_mh)
|
if (dev_mh)
|
||||||
n += mio_nfds(dev_mh);
|
n += mio_nfds(dev_mh);
|
||||||
pfds = xmalloc(n * sizeof(struct pollfd));
|
pfds = xmalloc(n * sizeof(struct pollfd));
|
||||||
|
|
||||||
for (s = slot_list; s != NULL; s = s->next)
|
for (s = slot_list; s != NULL; s = s->next)
|
||||||
slot_init(s);
|
slot_init(s);
|
||||||
if (dev_mh == NULL)
|
if (dev_mh == NULL)
|
||||||
|
|
|
@ -141,10 +141,6 @@ mio_read(struct mio_hdl *hdl, void *buf, size_t len)
|
||||||
hdl->eof = 1;
|
hdl->eof = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (len == 0) {
|
|
||||||
DPRINTF("mio_read: zero length read ignored\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
while (todo > 0) {
|
while (todo > 0) {
|
||||||
n = hdl->ops->read(hdl, data, todo);
|
n = hdl->ops->read(hdl, data, todo);
|
||||||
if (n == 0 && hdl->eof)
|
if (n == 0 && hdl->eof)
|
||||||
|
@ -175,14 +171,6 @@ mio_write(struct mio_hdl *hdl, const void *buf, size_t len)
|
||||||
hdl->eof = 1;
|
hdl->eof = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (len == 0) {
|
|
||||||
DPRINTF("mio_write: zero length write ignored\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (todo == 0) {
|
|
||||||
DPRINTF("mio_write: zero length write ignored\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
while (todo > 0) {
|
while (todo > 0) {
|
||||||
n = hdl->ops->write(hdl, data, todo);
|
n = hdl->ops->write(hdl, data, todo);
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
|
|
|
@ -53,7 +53,7 @@ library allows user processes to access
|
||||||
hardware and
|
hardware and
|
||||||
.Xr sndiod 8
|
.Xr sndiod 8
|
||||||
MIDI thru boxes and control ports in a uniform way.
|
MIDI thru boxes and control ports in a uniform way.
|
||||||
.Ss Opening and closing an MIDI stream
|
.Ss Opening and closing a MIDI stream
|
||||||
First the application must call the
|
First the application must call the
|
||||||
.Fn mio_open
|
.Fn mio_open
|
||||||
function to obtain a handle representing the newly created stream;
|
function to obtain a handle representing the newly created stream;
|
||||||
|
|
|
@ -311,10 +311,6 @@ sio_read(struct sio_hdl *hdl, void *buf, size_t len)
|
||||||
hdl->eof = 1;
|
hdl->eof = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (todo == 0) {
|
|
||||||
DPRINTF("sio_read: zero length read ignored\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
while (todo > 0) {
|
while (todo > 0) {
|
||||||
if (!sio_rdrop(hdl))
|
if (!sio_rdrop(hdl))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -352,10 +348,6 @@ sio_write(struct sio_hdl *hdl, const void *buf, size_t len)
|
||||||
hdl->eof = 1;
|
hdl->eof = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (todo == 0) {
|
|
||||||
DPRINTF("sio_write: zero length write ignored\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
while (todo > 0) {
|
while (todo > 0) {
|
||||||
if (!sio_wsil(hdl))
|
if (!sio_wsil(hdl))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -284,6 +284,11 @@ Applications that need to have a set of working
|
||||||
parameter combinations in advance can use the
|
parameter combinations in advance can use the
|
||||||
.Fn sio_getcap
|
.Fn sio_getcap
|
||||||
function.
|
function.
|
||||||
|
However, for most new applications it's generally
|
||||||
|
not recommended to use
|
||||||
|
.Fn sio_getcap .
|
||||||
|
Instead, follow the recommendations for negotiating
|
||||||
|
device parameters (see above).
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
.Vt sio_cap
|
.Vt sio_cap
|
||||||
|
@ -367,6 +372,11 @@ structure, then the second element of the
|
||||||
array of the
|
array of the
|
||||||
.Vt sio_cap
|
.Vt sio_cap
|
||||||
structure is valid for this configuration.
|
structure is valid for this configuration.
|
||||||
|
As such, when reading the array elements in the
|
||||||
|
.Vt sio_cap
|
||||||
|
structure, the corresponding
|
||||||
|
.Vt sio_conf
|
||||||
|
bitmasks should always be used.
|
||||||
.El
|
.El
|
||||||
.Ss Starting and stopping the device
|
.Ss Starting and stopping the device
|
||||||
The
|
The
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm midicat
|
.Nm midicat
|
||||||
.Nd send to or receive from MIDI ports.
|
.Nd send to or receive from MIDI ports
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm midicat
|
.Nm midicat
|
||||||
.Bk -words
|
.Bk -words
|
||||||
|
@ -75,7 +75,7 @@ $ midicat -d -q rmidi/0 -o /dev/null
|
||||||
Send data from
|
Send data from
|
||||||
.Pa rmidi/0
|
.Pa rmidi/0
|
||||||
to
|
to
|
||||||
.Pa midithru/0:
|
.Pa midithru/0 :
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
$ midicat -q rmidi/0 -q midithru/0
|
$ midicat -q rmidi/0 -q midithru/0
|
||||||
.Ed
|
.Ed
|
||||||
|
|
Loading…
Reference in New Issue