mirror of https://github.com/ericonr/sndio.git
Move code to disconnect all MIDI clients to its own routine.
This commit is contained in:
parent
db1e20ae8f
commit
6ee8e730f4
|
@ -530,11 +530,23 @@ port_open(struct port *c)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
port_close(struct port *c)
|
||||
void
|
||||
port_exitall(struct port *c)
|
||||
{
|
||||
int i;
|
||||
struct midi *ep;
|
||||
|
||||
for (i = 0; i < MIDI_NEP; i++) {
|
||||
ep = midi_ep + i;
|
||||
if ((ep->txmask & c->midi->self) ||
|
||||
(c->midi->txmask & ep->self))
|
||||
ep->ops->exit(ep->arg);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
port_close(struct port *c)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if (c->state == PORT_CFG) {
|
||||
port_log(c);
|
||||
|
@ -545,12 +557,7 @@ port_close(struct port *c)
|
|||
c->state = PORT_CFG;
|
||||
port_mio_close(c);
|
||||
|
||||
for (i = 0; i < MIDI_NEP; i++) {
|
||||
ep = midi_ep + i;
|
||||
if ((ep->txmask & c->midi->self) ||
|
||||
(c->midi->txmask & ep->self))
|
||||
ep->ops->exit(ep->arg);
|
||||
}
|
||||
port_exitall(c);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue