[Scummvm-cvs-logs] scummvm master -> b8a118eb0c2fb6085a65e3796c3d3d05f73a5197

dhewg dhewg at wiibrew.org
Sun Mar 27 15:34:07 CEST 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:
b8a118eb0c ANDROID: Use the midi gain option for EAS


Commit: b8a118eb0c2fb6085a65e3796c3d3d05f73a5197
    https://github.com/scummvm/scummvm/commit/b8a118eb0c2fb6085a65e3796c3d3d05f73a5197
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-03-27T06:30:17-07:00

Commit Message:
ANDROID: Use the midi gain option for EAS

Changed paths:
    audio/softsynth/eas.cpp



diff --git a/audio/softsynth/eas.cpp b/audio/softsynth/eas.cpp
index 1a406ad..0339492 100644
--- a/audio/softsynth/eas.cpp
+++ b/audio/softsynth/eas.cpp
@@ -109,6 +109,7 @@ private:
 	typedef int32 (*ShutdownFunc)(EASDataHandle);
 	typedef int32 (*LoadDLSFunc)(EASDataHandle, EASHandle, EASFile *);
 	typedef int32 (*SetParameterFunc)(EASDataHandle, int32, int32, int32);
+	typedef int32 (*SetVolumeFunc)(EASDataHandle, EASHandle, int32);
 	typedef int32 (*OpenStreamFunc)(EASDataHandle, EASHandle *, EASHandle);
 	typedef int32 (*WriteStreamFunc)(EASDataHandle, EASHandle, byte *, int32);
 	typedef int32 (*CloseStreamFunc)(EASDataHandle, EASHandle);
@@ -138,6 +139,7 @@ private:
 	ShutdownFunc _shutdownFunc;
 	LoadDLSFunc _loadDLSFunc;
 	SetParameterFunc _setParameterFunc;
+	SetVolumeFunc _setVolumeFunc;
 	OpenStreamFunc _openStreamFunc;
 	WriteStreamFunc _writeStreamFunc;
 	CloseStreamFunc _closeStreamFunc;
@@ -164,6 +166,7 @@ MidiDriver_EAS::MidiDriver_EAS() :
 	_shutdownFunc(0),
 	_loadDLSFunc(0),
 	_setParameterFunc(0),
+	_setVolumeFunc(0),
 	_openStreamFunc(0),
 	_writeStreamFunc(0),
 	_closeStreamFunc(0),
@@ -228,6 +231,7 @@ int MidiDriver_EAS::open() {
 	sym(_shutdownFunc, "EAS_Shutdown");
 	sym(_loadDLSFunc, "EAS_LoadDLSCollection");
 	sym(_setParameterFunc, "EAS_SetParameter");
+	sym(_setVolumeFunc, "EAS_SetVolume");
 	sym(_openStreamFunc, "EAS_OpenMIDIStream");
 	sym(_writeStreamFunc, "EAS_WriteMIDIStream");
 	sym(_closeStreamFunc, "EAS_CloseMIDIStream");
@@ -247,15 +251,21 @@ int MidiDriver_EAS::open() {
 		return -1;
 	}
 
-	_setParameterFunc(_EASHandle, EAS_REVERB, EAS_REVERB_PRESET,
-						EAS_REVERB_CHAMBER);
+	res = _setParameterFunc(_EASHandle, EAS_REVERB, EAS_REVERB_PRESET,
+							EAS_REVERB_CHAMBER);
 	if (res)
 		warning("error setting reverb preset: %d", res);
 
-	_setParameterFunc(_EASHandle, EAS_REVERB, EAS_REVERB_BYPASS, 0);
+	res = _setParameterFunc(_EASHandle, EAS_REVERB, EAS_REVERB_BYPASS, 0);
 	if (res)
 		warning("error disabling reverb bypass: %d", res);
 
+	// 90 is EAS's default, max is 100
+	// so the option slider will only work from 0.1 to 1.1
+	res = _setVolumeFunc(_EASHandle, 0, ConfMan.getInt("midi_gain") - 10);
+	if (res)
+		warning("error setting EAS master volume: %d", res);
+
 	res = _openStreamFunc(_EASHandle, &_midiStream, 0);
 	if (res) {
 		close();






More information about the Scummvm-git-logs mailing list