Merge branch 'master' into mixer

This commit is contained in:
Alexandre Ratchov 2019-02-22 11:11:15 +01:00
commit 33d512b797
6 changed files with 14 additions and 23 deletions

View File

@ -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)

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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