Merge pull request #59 from schnitzeltony/prepare-fluidsynth-2.2.0

scummvm: Fix uncommitted changes on patches
This commit is contained in:
Marko Lindqvist
2021-04-08 10:40:39 +03:00
committed by GitHub
2 changed files with 16 additions and 15 deletions

View File

@@ -3,19 +3,19 @@ From: Le Philousophe <lephilousophe@users.noreply.github.com>
Date: Mon, 5 Apr 2021 12:22:51 +0200
Subject: [PATCH 1/2] FLUIDSYNTH: Simplify FluidSynth version check
Upstream-Status: Pending [https://github.com/scummvm/scummvm/pull/2915]
---
audio/softsynth/fluidsynth.cpp | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
audio/softsynth/fluidsynth.cpp | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index 3b9f553464..e770fb6854 100644
index e0d7c4e..e07852f 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -46,7 +46,15 @@
@@ -46,6 +46,14 @@
#include "backends/platform/ios7/ios7_common.h"
#endif
-#if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1
+// We assume here Fluidsynth minor will never be above 255 and
+// that micro versions won't break API compatibility
+#if defined(FLUIDSYNTH_VERSION_MAJOR) && defined(FLUIDSYNTH_VERSION_MINOR)
@@ -24,11 +24,10 @@ index 3b9f553464..e770fb6854 100644
+#define FS_API_VERSION 0
+#endif
+
+#if FS_API_VERSION >= 0x0200
static void logHandler(int level, const char *message, void *data)
#else
static void logHandler(int level, char *message, void *data)
@@ -103,7 +111,7 @@ public:
class MidiDriver_FluidSynth : public MidiDriver_Emulated {
private:
MidiChannel_MPU401 _midiChannels[16];
@@ -75,7 +83,7 @@ public:
void setEngineSoundFont(Common::SeekableReadStream *soundFontData) override;
bool acceptsSoundFontData() override {
@@ -37,7 +36,7 @@ index 3b9f553464..e770fb6854 100644
return true;
#else
return false;
@@ -162,7 +170,7 @@ void MidiDriver_FluidSynth::setStr(const char *name, const char *val) {
@@ -134,7 +142,7 @@ void MidiDriver_FluidSynth::setStr(const char *name, const char *val) {
// Soundfont memory loader callback functions.
@@ -46,16 +45,16 @@ index 3b9f553464..e770fb6854 100644
static void *SoundFontMemLoader_open(const char *filename) {
void *p;
if (filename[0] != '&') {
@@ -200,7 +208,7 @@ int MidiDriver_FluidSynth::open() {
fluid_set_log_function(FLUID_INFO, logHandler, NULL);
fluid_set_log_function(FLUID_DBG, logHandler, NULL);
@@ -166,7 +174,7 @@ int MidiDriver_FluidSynth::open() {
if (_isOpen)
return MERR_ALREADY_OPEN;
-#if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1
+#if FS_API_VERSION >= 0x0200
// When provided with in-memory SoundFont data, only use the configured
// SoundFont instead if it's explicitly configured on the current game.
bool isUsingInMemorySoundFontData = _engineSoundFontData && !ConfMan.getActiveDomain()->contains("soundfont");
@@ -280,7 +288,7 @@ int MidiDriver_FluidSynth::open() {
@@ -246,7 +254,7 @@ int MidiDriver_FluidSynth::open() {
const char *soundfont = !isUsingInMemorySoundFontData ?
ConfMan.get("soundfont").c_str() : Common::String::format("&%p", (void *)_engineSoundFontData).c_str();

View File

@@ -4,6 +4,8 @@ Date: Mon, 5 Apr 2021 12:23:26 +0200
Subject: [PATCH 2/2] FLUIDSYNTH: Fix compilation with Fluidsynth 2.2
We replace deprecated functions as well
Upstream-Status: Pending [https://github.com/scummvm/scummvm/pull/2915]
---
audio/softsynth/fluidsynth.cpp | 43 ++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)