PKGBUILDs/community/csound/fluidsynth2.patch
2019-02-18 15:14:45 +00:00

59 lines
2.3 KiB
Diff

diff -ruN a/Opcodes/fluidOpcodes/fluidOpcodes.cpp b/Opcodes/fluidOpcodes/fluidOpcodes.cpp
--- a/Opcodes/fluidOpcodes/fluidOpcodes.cpp 2018-11-07 15:05:23.000000000 +0100
+++ b/Opcodes/fluidOpcodes/fluidOpcodes.cpp 2019-01-25 17:59:40.572147743 +0100
@@ -208,6 +208,7 @@
} else if (listPresets) {
fluid_sfont_t *fluidSoundfont =
fluid_synth_get_sfont_by_id(fluidSynth, soundFontId);
+#if FLUIDSYNTH_VERSION_MAJOR < 2
fluid_preset_t fluidPreset;
fluidSoundfont->iteration_start(fluidSoundfont);
OPARMS oparms;
@@ -218,6 +219,19 @@
soundFontId, fluidPreset.get_banknum(&fluidPreset),
fluidPreset.get_num(&fluidPreset),
fluidPreset.get_name(&fluidPreset));
+#else
+ fluid_preset_t *fluidPreset;
+ fluid_sfont_iteration_start(fluidSoundfont);
+ OPARMS oparms;
+ csound->GetOParms(csound, &oparms);
+ if (oparms.msglevel & 0x7)
+ while (fluidPreset = fluid_sfont_iteration_next(fluidSoundfont))
+ {
+ log(csound, "SoundFont: %3d Bank: %3d Preset: %3d %s\n",
+ soundFontId, fluid_preset_get_banknum(fluidPreset),
+ fluid_preset_get_num(fluidPreset),
+ fluid_preset_get_name(fluidPreset));
+#endif
}
}
return result;
@@ -279,6 +293,7 @@
toa(iFluidSynth, fluidSynth);
fluid_sfont_t *fluidSoundfont =
fluid_synth_get_sfont(fluidSynth, 0);
+#if FLUIDSYNTH_VERSION_MAJOR < 2
fluid_preset_t fluidPreset;
fluidSoundfont->iteration_start(fluidSoundfont);
OPARMS oparms;
@@ -290,6 +305,19 @@
ss << "Bank: " << fluidPreset.get_banknum(&fluidPreset) <<
" Preset: " << fluidPreset.get_num(&fluidPreset) <<
" Name: " << fluidPreset.get_name(&fluidPreset);
+#else
+ fluid_preset_t *fluidPreset;
+ fluid_sfont_iteration_start(fluidSoundfont);
+ OPARMS oparms;
+ csound->GetOParms(csound, &oparms);
+ if (oparms.msglevel & 0x7)
+ while (fluidPreset = fluid_sfont_iteration_next(fluidSoundfont))
+ {
+ std::stringstream ss;
+ ss << "Bank: " << fluid_preset_get_banknum(fluidPreset) <<
+ " Preset: " << fluid_preset_get_num(fluidPreset) <<
+ " Name: " << fluid_preset_get_name(fluidPreset);
+#endif
programs.push_back(ss.str());
}