Upon "master volume change" message, send feedback to other clients

only. Fixes the master volume slider stuttering in MIDI programs. Found
by armani@
This commit is contained in:
Alexandre Ratchov 2012-09-26 00:08:55 +02:00
parent 832cb8bbe7
commit 16fa47c430
2 changed files with 4 additions and 5 deletions

View File

@ -1728,8 +1728,4 @@ dev_master(struct dev *d, unsigned int master)
d->mix->u.mix.master = MIDI_TO_ADATA(master);
mix_setmaster(d->mix);
}
if (APROC_OK(d->midi)) {
midi_send_master(d->midi);
midi_flush(d->midi);
}
}

View File

@ -421,6 +421,7 @@ midi_onvoice(struct aproc *p, struct abuf *ibuf)
#endif
if ((ibuf->r.midi.msg[0] & MIDI_CMDMASK) == MIDI_CTL &&
(ibuf->r.midi.msg[1] == MIDI_CTLVOL)) {
midi_send(p, ibuf, ibuf->r.midi.msg, 3);
chan = ibuf->r.midi.msg[0] & MIDI_CHANMASK;
if (chan >= CTL_NSLOT)
return;
@ -462,8 +463,10 @@ midi_onsysex(struct aproc *p, struct abuf *ibuf)
switch (x->type) {
case SYSEX_TYPE_RT:
if (x->id0 == SYSEX_CONTROL && x->id1 == SYSEX_MASTER) {
if (len == SYSEX_SIZE(master))
if (len == SYSEX_SIZE(master)) {
dev_master(p->u.midi.dev, x->u.master.coarse);
midi_send(p, ibuf, (unsigned char *)x, len);
}
return;
}
if (x->id0 != SYSEX_MMC)