diff options
author | Robin Gareus <robin@gareus.org> | 2017-09-10 16:06:16 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-09-10 16:06:16 +0200 |
commit | fdbe22d00544cfc96a16a39200ce980a721ba841 (patch) | |
tree | 4120799849ec787acefb35739e329c0ac9329fcc /libs/plugins | |
parent | 057fd9259e35335d5e38e17d29f96dea27c17851 (diff) |
a-fluidsynth: query current bank/program after loading .sf2
Diffstat (limited to 'libs/plugins')
-rw-r--r-- | libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc | 10 |
1 files changed, 10 insertions, 0 deletions
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; } |