From fdbe22d00544cfc96a16a39200ce980a721ba841 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 10 Sep 2017 16:06:16 +0200 Subject: [PATCH] a-fluidsynth: query current bank/program after loading .sf2 --- libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc index 0a7b501c04..14e1ae4610 100644 --- a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc +++ b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc @@ -218,6 +218,16 @@ load_sf2 (AFluidSynth* self, const char* fn) self->program_state[chn].bank, self->program_state[chn].program); } + for (chn = 0; chn < 16; ++chn) { + unsigned int sfid = 0; + unsigned int bank = 0; + unsigned int program = -1; + if (FLUID_OK == fluid_synth_get_program (self->synth, chn, &sfid, &bank, &program)) { + self->program_state[chn].bank = bank; + self->program_state[chn].program = program; + } + } + return true; }