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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
port_close(struct port *c)
|
port_exitall(struct port *c)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct midi *ep;
|
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
|
#ifdef DEBUG
|
||||||
if (c->state == PORT_CFG) {
|
if (c->state == PORT_CFG) {
|
||||||
port_log(c);
|
port_log(c);
|
||||||
|
@ -545,12 +557,7 @@ port_close(struct port *c)
|
||||||
c->state = PORT_CFG;
|
c->state = PORT_CFG;
|
||||||
port_mio_close(c);
|
port_mio_close(c);
|
||||||
|
|
||||||
for (i = 0; i < MIDI_NEP; i++) {
|
port_exitall(c);
|
||||||
ep = midi_ep + i;
|
|
||||||
if ((ep->txmask & c->midi->self) ||
|
|
||||||
(c->midi->txmask & ep->self))
|
|
||||||
ep->ops->exit(ep->arg);
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue