diff options
author | Chris Xiong <chirs241097@gmail.com> | 2021-11-07 16:57:57 -0500 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2021-11-07 16:57:57 -0500 |
commit | a42be43a3aa5e1494267f3ae93d70a37afe48673 (patch) | |
tree | 73f37a5d4a1029eabcbbf0b8637bda91b1d08e1b /core/qmpmidiplay.cpp | |
parent | 9bb221706e9a45343eeb69401b9f50605aab5c1a (diff) | |
download | QMidiPlayer-a42be43a3aa5e1494267f3ae93d70a37afe48673.tar.xz |
Stop using MIDI messages for selecting presets used by fluidsynth.
Diffstat (limited to 'core/qmpmidiplay.cpp')
-rw-r--r-- | core/qmpmidiplay.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp index 2693307..c3c52ca 100644 --- a/core/qmpmidiplay.cpp +++ b/core/qmpmidiplay.cpp @@ -387,8 +387,11 @@ void CMidiPlayer::playerPanic(bool reset) for (auto &i : mididev) if (i.refcnt) { - for (uint8_t j = 0; j < 16; ++j) - reset ? i.dev->reset(j) : i.dev->panic(j); + if (reset) + i.dev->reset(0xff); + else + for (uint8_t j = 0; j < 16; ++j) + i.dev->panic(j); } } bool CMidiPlayer::playerLoadFile(const char *fn) @@ -596,9 +599,12 @@ void CMidiPlayer::setChannelPreset(int ch, int b, int p) chstatus[ch][0] = b >> 7; chstatus[ch][32] = b & 0x7F; qmpMidiOutDevice *d = mididev[mappedoutput[ch]].dev; - d->basicMessage(0xB0 | ch, 0x00, b >> 7); - d->basicMessage(0xB0 | ch, 0x20, b & 0x7F); - d->basicMessage(0xC0 | ch, p, 0); + if (!d->selectPreset(ch, b, p)) + { + d->basicMessage(0xB0 | ch, 0x00, b >> 7); + d->basicMessage(0xB0 | ch, 0x20, b & 0x7F); + d->basicMessage(0xC0 | ch, p, 0); + } } void CMidiPlayer::dumpFile() { |