aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidioutfluid.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2021-11-07 16:57:57 -0500
committerGravatar Chris Xiong <chirs241097@gmail.com> 2021-11-07 16:57:57 -0500
commita42be43a3aa5e1494267f3ae93d70a37afe48673 (patch)
tree73f37a5d4a1029eabcbbf0b8637bda91b1d08e1b /core/qmpmidioutfluid.cpp
parent9bb221706e9a45343eeb69401b9f50605aab5c1a (diff)
downloadQMidiPlayer-a42be43a3aa5e1494267f3ae93d70a37afe48673.tar.xz
Stop using MIDI messages for selecting presets used by fluidsynth.
Diffstat (limited to 'core/qmpmidioutfluid.cpp')
-rw-r--r--core/qmpmidioutfluid.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/qmpmidioutfluid.cpp b/core/qmpmidioutfluid.cpp
index 2abdc5c..a0586ae 100644
--- a/core/qmpmidioutfluid.cpp
+++ b/core/qmpmidioutfluid.cpp
@@ -206,6 +206,14 @@ void qmpMidiOutFluid::onMapped(uint8_t, int)
void qmpMidiOutFluid::onUnmapped(uint8_t, int)
{
}
+
+bool qmpMidiOutFluid::selectPreset(uint8_t ch, uint16_t bank, uint8_t prog)
+{
+ fluid_synth_set_channel_type(synth, ch, bank == 128 ? CHANNEL_TYPE_DRUM : CHANNEL_TYPE_MELODIC);
+ fluid_synth_bank_select(synth, ch, bank);
+ fluid_synth_program_change(synth, ch, prog);
+ return true;
+}
std::vector<std::pair<uint16_t, std::string>> qmpMidiOutFluid::getBankList()
{
return bnk;