[Scummvm-cvs-logs] scummvm master -> 153e67b37c6b510e975e16bf6ccc591fdc60838f

dhewg dhewg at wiibrew.org
Sat Mar 26 11:55:32 CET 2011


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

Summary:
153e67b37c ANDROID: Maybe working support for EAS DLS soundfonts


Commit: 153e67b37c6b510e975e16bf6ccc591fdc60838f
    https://github.com/scummvm/scummvm/commit/153e67b37c6b510e975e16bf6ccc591fdc60838f
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-03-26T03:54:17-07:00

Commit Message:
ANDROID: Maybe working support for EAS DLS soundfonts

Changed paths:
    audio/softsynth/eas.cpp



diff --git a/audio/softsynth/eas.cpp b/audio/softsynth/eas.cpp
index 5b6bdad..1a406ad 100644
--- a/audio/softsynth/eas.cpp
+++ b/audio/softsynth/eas.cpp
@@ -94,12 +94,20 @@ private:
 		char *GUID;
 	};
 
+	struct EASFile {
+		const char *path;
+		int fd;
+		long long offset;
+		long long length;
+	};
+
 	typedef void * EASDataHandle;
 	typedef void * EASHandle;
 
 	typedef EASLibConfig *(*ConfigFunc)();
 	typedef int32 (*InitFunc)(EASDataHandle *);
 	typedef int32 (*ShutdownFunc)(EASDataHandle);
+	typedef int32 (*LoadDLSFunc)(EASDataHandle, EASHandle, EASFile *);
 	typedef int32 (*SetParameterFunc)(EASDataHandle, int32, int32, int32);
 	typedef int32 (*OpenStreamFunc)(EASDataHandle, EASHandle *, EASHandle);
 	typedef int32 (*WriteStreamFunc)(EASDataHandle, EASHandle, byte *, int32);
@@ -128,6 +136,7 @@ private:
 	ConfigFunc _configFunc;
 	InitFunc _initFunc;
 	ShutdownFunc _shutdownFunc;
+	LoadDLSFunc _loadDLSFunc;
 	SetParameterFunc _setParameterFunc;
 	OpenStreamFunc _openStreamFunc;
 	WriteStreamFunc _writeStreamFunc;
@@ -153,6 +162,7 @@ MidiDriver_EAS::MidiDriver_EAS() :
 	_configFunc(0),
 	_initFunc(0),
 	_shutdownFunc(0),
+	_loadDLSFunc(0),
 	_setParameterFunc(0),
 	_openStreamFunc(0),
 	_writeStreamFunc(0),
@@ -216,13 +226,14 @@ int MidiDriver_EAS::open() {
 
 	sym(_initFunc, "EAS_Init");
 	sym(_shutdownFunc, "EAS_Shutdown");
+	sym(_loadDLSFunc, "EAS_LoadDLSCollection");
 	sym(_setParameterFunc, "EAS_SetParameter");
 	sym(_openStreamFunc, "EAS_OpenMIDIStream");
 	sym(_writeStreamFunc, "EAS_WriteMIDIStream");
 	sym(_closeStreamFunc, "EAS_CloseMIDIStream");
 	sym(_renderFunc, "EAS_Render");
 
-	if (!_initFunc || !_shutdownFunc || !_setParameterFunc ||
+	if (!_initFunc || !_shutdownFunc || !_loadDLSFunc || !_setParameterFunc ||
 			!_openStreamFunc || !_writeStreamFunc || !_closeStreamFunc ||
 			!_renderFunc) {
 		close();
@@ -262,6 +273,23 @@ int MidiDriver_EAS::open() {
 			"tempo:%u rounds:%u", _config->voices, _config->channels,
 			_config->rate, _config->bufSize, _baseTempo, _rounds);
 
+	// TODO doesn't seem to work with midi streams?
+	if (ConfMan.hasKey("soundfont")) {
+		const Common::String dls = ConfMan.get("soundfont");
+
+		debug("loading DLS file '%s'", dls.c_str());
+
+		EASFile f;
+		memset(&f, 0, sizeof(EASFile));
+		f.path = dls.c_str();
+
+		res = _loadDLSFunc(_EASHandle, 0, &f);
+		if (res)
+			warning("error loading DLS file '%s': %d", dls.c_str(), res);
+		else
+			debug("DLS file loaded");
+	}
+
 #ifdef EAS_DUMPSTREAM
 	if (!_dump.open("/sdcard/eas.dump"))
 		warning("error opening EAS dump file");






More information about the Scummvm-git-logs mailing list