| 606 | } |
| 607 | |
| 608 | void MidiDevice::processProgramChanged(int channel, quint8 preset) |
| 609 | { |
| 610 | // Compute the corresponding bank for the current channel |
| 611 | quint16 bankNumber = 256 * _midiStates[channel + 1]._controllerValues[32] + |
| 612 | _midiStates[channel + 1]._controllerValues[0]; |
| 613 | |
| 614 | bool consumed = false; |
| 615 | for (int i = 0; i < _listeners.size(); ++i) |
| 616 | consumed |= _listeners[i]->processProgramChanged(channel, bankNumber, preset); |
| 617 | |
| 618 | // And possibly update channel -1 if the change has not been consumed |
| 619 | if (channel != -1 && !consumed) |
| 620 | processProgramChanged(-1, preset); |
| 621 | } |
| 622 | |
| 623 | void MidiDevice::stopAll() |
| 624 | { |