csound: fix build with fluidsynth > 2.0.0

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
Andreas Müller
2018-10-10 21:13:46 +02:00
parent 163874742f
commit 6b6c5b58a5
2 changed files with 54 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ SRC_URI = " \
file://0005-InOut-pmidi.c-Fix-build-with-gcc8.patch \
file://0006-fixed-unsafe-use-of-strncpy.patch \
file://0007-util1-csd_util-cs.c-Fix-build-with-gcc8.patch \
file://0008-Fix-build-with-fluidsynth-version-2.0.0.patch \
"
SRCREV = "2905724262b516983e779ed8c589602da4bf3f7d"
S = "${WORKDIR}/git"

View File

@@ -0,0 +1,53 @@
From 281beca9614fa8b5c09527809a6810525faf2177 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Wed, 10 Oct 2018 20:47:04 +0200
Subject: [PATCH] Fix build with fluidsynth version >= 2.0.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Please not that the second change set at
Upstream-Status: Backport [1]
[1] https://github.com/csound/csound/pull/1046
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
Opcodes/fluidOpcodes/fluidOpcodes.cpp | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/Opcodes/fluidOpcodes/fluidOpcodes.cpp b/Opcodes/fluidOpcodes/fluidOpcodes.cpp
index d6f4da0fd..aa2b9d4b2 100644
--- a/Opcodes/fluidOpcodes/fluidOpcodes.cpp
+++ b/Opcodes/fluidOpcodes/fluidOpcodes.cpp
@@ -208,6 +208,7 @@ public:
} 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,18 @@ public:
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;
--
2.14.4