[Scummvm-cvs-logs] SF.net SVN: scummvm:[50056] scummvm/trunk/engines/sci/sound

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Jun 19 21:06:58 CEST 2010


Revision: 50056
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50056&view=rev
Author:   m_kiewitz
Date:     2010-06-19 19:06:58 +0000 (Sat, 19 Jun 2010)

Log Message:
-----------
SCI: make channel remapping stop using channel 0 for mt32 - fixes playback accordingly (like lsl1 at the start)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sound/drivers/midi.cpp
    scummvm/trunk/engines/sci/sound/drivers/mididriver.h
    scummvm/trunk/engines/sci/sound/music.cpp
    scummvm/trunk/engines/sci/sound/music.h

Modified: scummvm/trunk/engines/sci/sound/drivers/midi.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/drivers/midi.cpp	2010-06-19 19:04:35 UTC (rev 50055)
+++ scummvm/trunk/engines/sci/sound/drivers/midi.cpp	2010-06-19 19:06:58 UTC (rev 50056)
@@ -55,6 +55,7 @@
 	bool hasRhythmChannel() const { return true; }
 	byte getPlayId();
 	int getPolyphony() const { return kVoices; }
+	int getFirstChannel();
 	void setVolume(byte volume);
 	int getVolume();
 	void setReverb(byte reverb);
@@ -317,6 +318,13 @@
 	}
 }
 
+// We return 1 for mt32, because if we remap channels to 0 for mt32, those won't get played at all
+int MidiPlayer_Midi::getFirstChannel() {
+	if (_isMt32)
+		return 1;
+	return 0;
+}
+
 void MidiPlayer_Midi::setVolume(byte volume) {
 	_masterVolume = volume;
 

Modified: scummvm/trunk/engines/sci/sound/drivers/mididriver.h
===================================================================
--- scummvm/trunk/engines/sci/sound/drivers/mididriver.h	2010-06-19 19:04:35 UTC (rev 50055)
+++ scummvm/trunk/engines/sci/sound/drivers/mididriver.h	2010-06-19 19:06:58 UTC (rev 50056)
@@ -86,6 +86,7 @@
 
 	virtual byte getPlayId() = 0;
 	virtual int getPolyphony() const = 0;
+	virtual int getFirstChannel() { return 0; };
 
 	virtual void setVolume(byte volume) {
 		if(_driver)

Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp	2010-06-19 19:04:35 UTC (rev 50055)
+++ scummvm/trunk/engines/sci/sound/music.cpp	2010-06-19 19:06:58 UTC (rev 50056)
@@ -103,6 +103,9 @@
 	}
 
 	_bMultiMidi = ConfMan.getBool("multi_midi");
+
+	// Find out what the first possible channel is (used, when doing channel remapping)
+	_driverFirstChannel = _pMidiDrv->getFirstChannel();
 }
 
 void SciMusic::clearPlayList() {
@@ -241,7 +244,7 @@
 		return bestChannel;
 	}
 	// otherwise look for unused channel
-	for (int channelNr = 0; channelNr < 15; channelNr++) {
+	for (int channelNr = _driverFirstChannel; channelNr < 15; channelNr++) {
 		if (!_usedChannel[channelNr]) {
 			_usedChannel[channelNr] = caller;
 			return channelNr;

Modified: scummvm/trunk/engines/sci/sound/music.h
===================================================================
--- scummvm/trunk/engines/sci/sound/music.h	2010-06-19 19:04:35 UTC (rev 50055)
+++ scummvm/trunk/engines/sci/sound/music.h	2010-06-19 19:06:58 UTC (rev 50056)
@@ -216,6 +216,8 @@
 	bool _soundOn;
 	byte _masterVolume;
 	MusicEntry *_usedChannel[16];
+
+	int _driverFirstChannel;
 };
 
 } // End of namespace Sci


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