[Scummvm-git-logs] scummvm master -> 21d65cedf231cb03cd2e63863bd6d9d6bc70ed1d

criezy criezy at scummvm.org
Mon Mar 8 22:04:05 UTC 2021


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
08b54f489b FLUIDSYNTH: Make FluidSynth logging less noisy by default
21d65cedf2 FLUIDSYNTH: Swapped debug levels for FLUID_WARN and FLUID_INFO


Commit: 08b54f489b663793168764986c1d1a834c33add3
    https://github.com/scummvm/scummvm/commit/08b54f489b663793168764986c1d1a834c33add3
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-03-08T22:04:02Z

Commit Message:
FLUIDSYNTH: Make FluidSynth logging less noisy by default

Changed paths:
    audio/softsynth/fluidsynth.cpp


diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index e0d7c4e3df..fe2b0689c2 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -46,6 +46,29 @@
 #include "backends/platform/ios7/ios7_common.h"
 #endif
 
+static void logHandler(int level, const char *message, void *data) {
+	switch (level) {
+	case FLUID_PANIC:
+		error("FluidSynth: %s", message);
+		break;
+	case FLUID_ERR:
+		warning("FluidSynth: %s", message);
+		break;
+	case FLUID_WARN:
+		debug(2, "FluidSynth: %s", message);
+		break;
+	case FLUID_INFO:
+		debug(1, "FluidSynth: %s", message);
+		break;
+	case FLUID_DBG:
+		debug(3, "FluidSynth: %s", message);
+		break;
+	default:
+		fluid_default_log_function(level, message, data);
+		break;
+	}
+}
+
 class MidiDriver_FluidSynth : public MidiDriver_Emulated {
 private:
 	MidiChannel_MPU401 _midiChannels[16];
@@ -166,6 +189,12 @@ int MidiDriver_FluidSynth::open() {
 	if (_isOpen)
 		return MERR_ALREADY_OPEN;
 
+	fluid_set_log_function(FLUID_PANIC, logHandler, NULL);
+	fluid_set_log_function(FLUID_ERR, logHandler, NULL);
+	fluid_set_log_function(FLUID_WARN, logHandler, NULL);
+	fluid_set_log_function(FLUID_INFO, logHandler, NULL);
+	fluid_set_log_function(FLUID_DBG, logHandler, NULL);
+
 #if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1
 	// When provided with in-memory SoundFont data, only use the configured
 	// SoundFont instead if it's explicitly configured on the current game.


Commit: 21d65cedf231cb03cd2e63863bd6d9d6bc70ed1d
    https://github.com/scummvm/scummvm/commit/21d65cedf231cb03cd2e63863bd6d9d6bc70ed1d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-03-08T22:04:02Z

Commit Message:
FLUIDSYNTH: Swapped debug levels for FLUID_WARN and FLUID_INFO

If FLUID_INFO is "verbose informational messages", perhaps they should
be better hidden from the average user than warnings. Particularly since
warnings are the only kind I've actually seen in the wild. (Change
suggested by criezy.)

Changed paths:
    audio/softsynth/fluidsynth.cpp


diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index fe2b0689c2..e41a7515b2 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -55,10 +55,10 @@ static void logHandler(int level, const char *message, void *data) {
 		warning("FluidSynth: %s", message);
 		break;
 	case FLUID_WARN:
-		debug(2, "FluidSynth: %s", message);
+		debug(1, "FluidSynth: %s", message);
 		break;
 	case FLUID_INFO:
-		debug(1, "FluidSynth: %s", message);
+		debug(2, "FluidSynth: %s", message);
 		break;
 	case FLUID_DBG:
 		debug(3, "FluidSynth: %s", message);




More information about the Scummvm-git-logs mailing list