muse: update to latest and 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-17 23:27:50 +02:00
parent af3219abea
commit 0fe318c6a6
2 changed files with 144 additions and 1 deletions

View File

@@ -0,0 +1,142 @@
From 6e352b874ddffc6185e499cda12c1731d14a3708 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Wed, 17 Oct 2018 23:17:31 +0200
Subject: [PATCH] fluidsynth: Follow API change introduced in fluidsynth 2.0.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
synti/fluidsynth/fluidsynti.cpp | 44 ++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/synti/fluidsynth/fluidsynti.cpp b/synti/fluidsynth/fluidsynti.cpp
index 11f51e57..75322d7e 100644
--- a/synti/fluidsynth/fluidsynti.cpp
+++ b/synti/fluidsynth/fluidsynti.cpp
@@ -155,16 +155,22 @@ FluidSynth::~FluidSynth()
std::cerr << DEBUG_ARGS << "Error unloading soundfont!" << fluid_synth_error(fluidsynth) << std::endl;
}
+#if FLUIDSYNTH_VERSION_MAJOR < 2
int err = delete_fluid_synth (fluidsynth);
+#else
+ delete_fluid_synth (fluidsynth);
+#endif
if(gui)
delete gui;
if (initBuffer)
delete [] initBuffer;
+#if FLUIDSYNTH_VERSION_MAJOR < 2
if (err == -1) {
std::cerr << DEBUG_ARGS << "error while destroying synth: " << fluid_synth_error(fluidsynth) << std::endl;
return;
- }
+ }
+#endif
}
bool FluidSynth::init(const char* name)
@@ -1368,7 +1374,11 @@ const char* FluidSynth::getPatchName(int i, int, bool /*drum*/) const
else {
fluid_preset_t *preset = fluid_synth_get_channel_preset(fluidsynth, i);
if (!preset) return "<unknown>";
+#if FLUIDSYNTH_VERSION_MAJOR < 2
return preset->get_name(preset);
+#else
+ return fluid_preset_get_name(preset);
+#endif
}
}
//---------------------------------------------------------
@@ -1414,12 +1424,20 @@ const MidiPatch* FluidSynth::getFirstPatch (int channel) const
if (!channels[channel].drumchannel) {
for (unsigned bank = 0; bank < 128; ++bank) {
for (unsigned patch = 0; patch < 128; ++patch) {
+#if FLUIDSYNTH_VERSION_MAJOR < 2
preset = sfont->get_preset (sfont, bank, patch);
+#else
+ preset = fluid_sfont_get_preset (sfont, bank, patch);
+#endif
if (preset) {
midiPatch.hbank = bank;
midiPatch.lbank = 0xff; // Off
midiPatch.prog = patch;
+#if FLUIDSYNTH_VERSION_MAJOR < 2
midiPatch.name = preset->get_name (preset);
+#else
+ midiPatch.name = fluid_preset_get_name (preset);
+#endif
return &midiPatch;
}
}
@@ -1429,12 +1447,20 @@ const MidiPatch* FluidSynth::getFirstPatch (int channel) const
else { //This is a drumchannel
int bank = 128;
for (unsigned patch = 0; patch < 128; ++patch) {
+#if FLUIDSYNTH_VERSION_MAJOR < 2
preset = sfont->get_preset (sfont, bank, patch);
+#else
+ preset = fluid_sfont_get_preset (sfont, bank, patch);
+#endif
if (preset) {
midiPatch.hbank = 0xff; // Off
midiPatch.lbank = 0xff; // Off
midiPatch.prog = patch;
+#if FLUIDSYNTH_VERSION_MAJOR < 2
midiPatch.name = preset->get_name(preset);
+#else
+ midiPatch.name = fluid_preset_get_name (preset);
+#endif
return &midiPatch;
}
}
@@ -1466,13 +1492,21 @@ const MidiPatch* FluidSynth::getNextPatch (int channel, const MidiPatch* patch)
for (unsigned bank = patch->hbank; bank < 128; ++bank) {
for ( ; prog < 128; ++prog) {
+#if FLUIDSYNTH_VERSION_MAJOR < 2
preset = sfont->get_preset (sfont, bank, prog);
+#else
+ preset = fluid_sfont_get_preset (sfont, bank, prog);
+#endif
if (preset) {
//printf("Preset info: bank: %d prog: %d name: %s\n", bank, prog, preset->get_name(preset));
midiPatch.hbank = bank;
midiPatch.lbank = 0xff; // Off
midiPatch.prog = prog;
+#if FLUIDSYNTH_VERSION_MAJOR < 2
midiPatch.name = preset->get_name (preset);
+#else
+ midiPatch.name = fluid_preset_get_name (preset);
+#endif
return &midiPatch;
}
}
@@ -1483,13 +1517,21 @@ const MidiPatch* FluidSynth::getNextPatch (int channel, const MidiPatch* patch)
unsigned bank = 128;
unsigned prog = patch->prog;
for (prog = patch->prog + 1; prog < 128; ++prog) {
+#if FLUIDSYNTH_VERSION_MAJOR < 2
preset = sfont->get_preset (sfont, bank, prog);
+#else
+ preset = fluid_sfont_get_preset (sfont, bank, prog);
+#endif
if (preset) {
//printf("Preset info: bank: %d prog: %d name: %s\n",bank, prog, preset->get_name(preset));
midiPatch.hbank = 0xff; // Off
midiPatch.lbank = 0xff; // Off
midiPatch.prog = prog;
+#if FLUIDSYNTH_VERSION_MAJOR < 2
midiPatch.name = preset->get_name (preset);
+#else
+ midiPatch.name = fluid_preset_get_name (preset);
+#endif
return &midiPatch;
}
}
--
2.14.4

View File

@@ -23,8 +23,9 @@ inherit cmake_qt5 pkgconfig gtk-icon-cache distro_features_check mime qt5-transl
SRC_URI = " \
git://github.com/muse-sequencer/muse.git \
file://0001-fluidsynth-Follow-API-change-introduced-in-fluidsynt.patch \
"
SRCREV = "02d9dc6abd757c3c1783fdd46dacd3c4ef2c0a6d"
SRCREV = "1fde7ca69b1b7988595f4cfb58eae5c566324cac"
PV = "3.0.2+git${SRCPV}"
S = "${WORKDIR}/git/muse3"