[Scummvm-cvs-logs] SF.net SVN: scummvm:[52013] scummvm/trunk/sound/softsynth/fmtowns_pc98/ towns_audio.cpp

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Thu Aug 12 00:50:13 CEST 2010


Revision: 52013
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52013&view=rev
Author:   athrxx
Date:     2010-08-11 22:50:13 +0000 (Wed, 11 Aug 2010)

Log Message:
-----------
FMTOWNS AUDIO: fix cda volume and balance control

Modified Paths:
--------------
    scummvm/trunk/sound/softsynth/fmtowns_pc98/towns_audio.cpp

Modified: scummvm/trunk/sound/softsynth/fmtowns_pc98/towns_audio.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/fmtowns_pc98/towns_audio.cpp	2010-08-11 22:37:16 UTC (rev 52012)
+++ scummvm/trunk/sound/softsynth/fmtowns_pc98/towns_audio.cpp	2010-08-11 22:50:13 UTC (rev 52013)
@@ -360,7 +360,6 @@
 }
 
 int TownsAudioInterface::intf_reset(va_list &args) {
-	Common::StackLock lock(_mutex);
 	fmReset();
 	pcmReset();
 	callback(68);
@@ -1393,12 +1392,9 @@
 	// balance values for our -128 to 127 volume range
 	
 	// CD-AUDIO
-	int vl = (int)(((float)_outputLevel[12] * 127.0f) / 63.0f);
-	int vr = (int)(((float)_outputLevel[13] * 127.0f) / 63.0f);
-	int8 balance = vr - vl;
-	vl = (int)(((float)_outputLevel[12] * 255.0f) / 63.0f);
-	vr = (int)(((float)_outputLevel[13] * 255.0f) / 63.0f);
-	AudioCD.setVolume((vl + vr) >> 1);
+	int volume = (int)(((float)MAX(_outputLevel[12], _outputLevel[13]) * 255.0f) / 63.0f);
+	int balance = (int)((float)((_outputLevel[13] - _outputLevel[12]) * 127.0f) / (float)MAX(_outputLevel[12], _outputLevel[13]));
+	AudioCD.setVolume(volume);
 	AudioCD.setBalance(balance);
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list