[Scummvm-cvs-logs] scummvm master -> 93e817fc6351c2d9216a1a328979c0742b9a90d6

lordhoto lordhoto at gmail.com
Sun Dec 11 05:05:10 CET 2011


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

Summary:
c48af08a0b CINE: Implement MT-32 output driver.
42fd697544 CINE: Make findNote behave a bit more like the original.
6ba090b45a CINE: Make PC sound code thread safe, since the MIDI output might run the callback in an extra thread.
93e817fc63 NEWS: Mention Roland MT-32 support in Cine.


Commit: c48af08a0b4ba7d813260c4c94132057f4a39e93
    https://github.com/scummvm/scummvm/commit/c48af08a0b4ba7d813260c4c94132057f4a39e93
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-12-10T20:03:57-08:00

Commit Message:
CINE: Implement MT-32 output driver.

The driver is based on Future Wars. I do not own Operation Stealth, thus I do
not know whether it works fine for it.

Changed paths:
    engines/cine/detection.cpp
    engines/cine/detection_tables.h
    engines/cine/sound.cpp



diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index a64272d..ed65668 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -65,7 +65,7 @@ class CineMetaEngine : public AdvancedMetaEngine {
 public:
 	CineMetaEngine() : AdvancedMetaEngine(Cine::gameDescriptions, sizeof(Cine::CINEGameDescription), cineGames) {
 		_singleid = "cine";
-		_guioptions = GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI);
+		_guioptions = GUIO1(GUIO_NOSPEECH);
 	}
 
 	virtual GameDescriptor findGame(const char *gameid) const {
diff --git a/engines/cine/detection_tables.h b/engines/cine/detection_tables.h
index ddb63c9..0ec2768 100644
--- a/engines/cine/detection_tables.h
+++ b/engines/cine/detection_tables.h
@@ -122,7 +122,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_FW,
 		0,
@@ -136,7 +136,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::EN_USA,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_FW,
 		0,
@@ -150,7 +150,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::DE_DEU,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_FW,
 		GF_ALT_FONT,
@@ -164,7 +164,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::ES_ESP,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_FW,
 		0,
@@ -178,7 +178,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::FR_FRA,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_FW,
 		0,
@@ -192,7 +192,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::IT_ITA,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_FW,
 		0,
@@ -210,7 +210,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformAmiga,
 			ADGF_DEMO,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_FW,
 		0,
@@ -224,7 +224,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformAtariST,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_FW,
 		0,
@@ -238,7 +238,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::FR_FRA,
 			Common::kPlatformAtariST,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_FW,
 		0,
@@ -384,7 +384,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::EN_GRB,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_OS,
 		0,
@@ -398,7 +398,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::EN_GRB,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_OS,
 		0,
@@ -412,7 +412,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::EN_USA,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_OS,
 		0,
@@ -426,7 +426,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::DE_DEU,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_OS,
 		0,
@@ -440,7 +440,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::ES_ESP,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_OS,
 		0,
@@ -454,7 +454,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::FR_FRA,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_OS,
 		0,
@@ -468,7 +468,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::EN_GRB,
 			Common::kPlatformAmiga,
 			ADGF_DEMO,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_OS,
 		GF_DEMO,
@@ -482,7 +482,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::EN_GRB,
 			Common::kPlatformAtariST,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_OS,
 		0,
@@ -496,7 +496,7 @@ static const CINEGameDescription gameDescriptions[] = {
 			Common::FR_FRA,
 			Common::kPlatformAtariST,
 			ADGF_NO_FLAGS,
-			GUIO0()
+			GUIO1(GUIO_NOMIDI)
 		},
 		GType_OS,
 		0,
diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp
index 48c5e3d..d882809 100644
--- a/engines/cine/sound.cpp
+++ b/engines/cine/sound.cpp
@@ -25,12 +25,14 @@
 #include "common/memstream.h"
 #include "common/system.h"
 #include "common/textconsole.h"
+#include "common/timer.h"
 
 #include "cine/cine.h"
 #include "cine/sound.h"
 
 #include "audio/audiostream.h"
 #include "audio/fmopl.h"
+#include "audio/mididrv.h"
 #include "audio/decoders/raw.h"
 #include "audio/mods/soundfx.h"
 
@@ -48,14 +50,13 @@ public:
 	virtual void playSample(const byte *data, int size, int channel, int volume) = 0;
 	virtual void stopAll() = 0;
 	virtual const char *getInstrumentExtension() const { return ""; }
+	virtual void notifyInstrumentLoad(const byte *data, int size, int channel) {}
 
-	void setUpdateCallback(UpdateCallback upCb, void *ref);
+	virtual void setUpdateCallback(UpdateCallback upCb, void *ref) = 0;
 	void resetChannel(int channel);
 	void findNote(int freq, int *note, int *oct) const;
 
 protected:
-	UpdateCallback _upCb;
-	void *_upRef;
 
 	static const int _noteTable[];
 	static const int _noteTableCount;
@@ -104,6 +105,7 @@ public:
 	virtual ~AdLibSoundDriver();
 
 	// PCSoundDriver interface
+	virtual void setUpdateCallback(UpdateCallback upCb, void *ref);
 	virtual void setupChannel(int channel, const byte *data, int instrument, int volume);
 	virtual void stopChannel(int channel);
 	virtual void stopAll();
@@ -121,6 +123,9 @@ public:
 	virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi) = 0;
 
 protected:
+	UpdateCallback _upCb;
+	void *_upRef;
+
 	FM_OPL *_opl;
 	int _sampleRate;
 	Audio::Mixer *_mixer;
@@ -177,6 +182,29 @@ public:
 	virtual void playSample(const byte *data, int size, int channel, int volume);
 };
 
+// (Future Wars) MIDI driver
+class MidiSoundDriverH32 : public PCSoundDriver {
+public:
+	MidiSoundDriverH32(MidiDriver *output);
+	~MidiSoundDriverH32();
+
+	virtual void setUpdateCallback(UpdateCallback upCb, void *ref);
+	virtual void setupChannel(int channel, const byte *data, int instrument, int volume);
+	virtual void setChannelFrequency(int channel, int frequency);
+	virtual void stopChannel(int channel);
+	virtual void playSample(const byte *data, int size, int channel, int volume);
+	virtual void stopAll() {}
+	virtual const char *getInstrumentExtension() const { return ".H32"; }
+	virtual void notifyInstrumentLoad(const byte *data, int size, int channel);
+
+private:
+	MidiDriver *_output;
+	UpdateCallback _callback;
+
+	void writeInstrument(int offset, const byte *data, int size);
+	void selectInstrument(int channel, int unk, int instrument, int volume);
+};
+
 class PCSoundFxPlayer {
 public:
 
@@ -216,11 +244,6 @@ private:
 };
 
 
-void PCSoundDriver::setUpdateCallback(UpdateCallback upCb, void *ref) {
-	_upCb = upCb;
-	_upRef = ref;
-}
-
 void PCSoundDriver::findNote(int freq, int *note, int *oct) const {
 	*note = _noteTableCount - 1;
 	for (int i = 0; i < _noteTableCount; ++i) {
@@ -252,6 +275,11 @@ AdLibSoundDriver::~AdLibSoundDriver() {
 	OPLDestroy(_opl);
 }
 
+void AdLibSoundDriver::setUpdateCallback(UpdateCallback upCb, void *ref) {
+	_upCb = upCb;
+	_upRef = ref;
+}
+
 void AdLibSoundDriver::setupChannel(int channel, const byte *data, int instrument, int volume) {
 	assert(channel < 4);
 	if (data) {
@@ -564,6 +592,133 @@ void AdLibSoundDriverADL::playSample(const byte *data, int size, int channel, in
 	}
 }
 
+MidiSoundDriverH32::MidiSoundDriverH32(MidiDriver *output)
+    : _output(output), _callback(0) {
+}
+
+MidiSoundDriverH32::~MidiSoundDriverH32() {
+	if (_callback)
+		g_system->getTimerManager()->removeTimerProc(_callback);
+
+	_output->close();
+	delete _output;
+}
+
+void MidiSoundDriverH32::setUpdateCallback(UpdateCallback upCb, void *ref) {
+	Common::TimerManager *timer = g_system->getTimerManager();
+	assert(timer);
+
+	if (_callback)
+		timer->removeTimerProc(_callback);
+
+	_callback = upCb;
+	if (_callback)
+		timer->installTimerProc(_callback, 1000000 / 50, ref, "MidiSoundDriverH32");
+}
+
+void MidiSoundDriverH32::setupChannel(int channel, const byte *data, int instrument, int volume) {
+	if (volume < 0 ||  volume > 100)
+		volume = 0;
+
+	if (!data)
+		selectInstrument(channel, 0, 0, volume);
+	else if (data[0] < 0x80)
+		selectInstrument(channel, data[0] / 0x40, data[0] % 0x40, volume);
+	else
+		selectInstrument(channel, 2, instrument, volume);
+}
+
+void MidiSoundDriverH32::setChannelFrequency(int channel, int frequency) {
+	int note, oct;
+	findNote(frequency, &note, &oct);
+	note %= 12;
+	note = oct * 12 + note + 12;
+
+	_output->send(0x91 + channel, note, 0x7F);
+}
+
+void MidiSoundDriverH32::stopChannel(int channel) {
+	_output->send(0xB1 + channel, 0x7B, 0x00);
+}
+
+void MidiSoundDriverH32::playSample(const byte *data, int size, int channel, int volume) {
+	stopChannel(channel);
+
+	volume = volume * 8 / 5;
+
+	if (data[0] < 0x80) {
+		selectInstrument(channel, data[0] / 0x40, data[0] % 0x40, volume);
+	} else {
+		writeInstrument(channel * 512 + 0x80000, data + 1, 256);
+		selectInstrument(channel, 2, channel, volume);
+	}
+
+	_output->send(0x91 + channel, 12, 0x7F);
+}
+
+void MidiSoundDriverH32::notifyInstrumentLoad(const byte *data, int size, int channel) {
+	if (data[0] < 0x80 || data[0] > 0xC0)
+		return;
+
+	writeInstrument(channel * 512 + 0x80000, data + 1, size - 1);
+}
+
+void MidiSoundDriverH32::writeInstrument(int offset, const byte *data, int size) {
+	byte sysEx[254];
+
+	sysEx[0] = 0x41;
+	sysEx[1] = 0x10;
+	sysEx[2] = 0x16;
+	sysEx[3] = 0x12;
+	sysEx[4] = (offset >> 16) & 0xFF;
+	sysEx[5] = (offset >>  8) & 0xFF;
+	sysEx[6] = (offset >>  0) & 0xFF;
+	int copySize = MIN(246, size);
+	memcpy(&sysEx[7], data, copySize);
+
+	byte checkSum = 0;
+	for (int i = 0; i < copySize + 3; ++i)
+		checkSum += sysEx[4 + i];
+	sysEx[7 + copySize] = 0x80 - (checkSum & 0x7F);
+
+	_output->sysEx(sysEx, copySize + 8);
+}
+
+void MidiSoundDriverH32::selectInstrument(int channel, int unk, int instrument, int volume) {
+	const int offset = channel * 16 + 0x30000;
+
+	byte sysEx[24] = {
+		0x41, 0x10, 0x16, 0x12,
+		0x00, 0x00, 0x00,       // offset
+		0x00,                   // unk
+		0x00,                   // instrument
+		0x18, 0x32, 0x0C, 0x03, 0x01, 0x00,
+		0x00,                   // volume
+		0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00                    // checksum
+	};
+
+
+	sysEx[4] = (offset >> 16) & 0xFF;
+	sysEx[5] = (offset >>  8) & 0xFF;
+	sysEx[6] = (offset >>  0) & 0xFF;
+
+	sysEx[7] = unk;
+
+	sysEx[8] = instrument;
+
+	sysEx[15] = volume;
+
+	byte checkSum = 0;
+
+	for (int i = 4; i < 23; ++i)
+		checkSum += sysEx[i];
+
+	sysEx[23] = 0x80 - (checkSum & 0x7F);
+
+	_output->sysEx(sysEx, 24);
+}
+
 PCSoundFxPlayer::PCSoundFxPlayer(PCSoundDriver *driver)
 	: _playing(false), _driver(driver) {
 	memset(_instrumentsData, 0, sizeof(_instrumentsData));
@@ -608,9 +763,12 @@ bool PCSoundFxPlayer::load(const char *song) {
 				*dot = '\0';
 			}
 			strcat(instrument, _driver->getInstrumentExtension());
-			_instrumentsData[i] = readBundleSoundFile(instrument);
+			uint32 instrumentSize;
+			_instrumentsData[i] = readBundleSoundFile(instrument, &instrumentSize);
 			if (!_instrumentsData[i]) {
 				warning("Unable to load soundfx instrument '%s'", instrument);
+			} else {
+				_driver->notifyInstrumentLoad(_instrumentsData[i], instrumentSize, i);
 			}
 		}
 	}
@@ -718,11 +876,27 @@ void PCSoundFxPlayer::unload() {
 
 PCSound::PCSound(Audio::Mixer *mixer, CineEngine *vm)
 	: Sound(mixer, vm) {
-	if (_vm->getGameType() == GType_FW) {
-		_soundDriver = new AdLibSoundDriverINS(_mixer);
-	} else {
-		_soundDriver = new AdLibSoundDriverADL(_mixer);
+
+	const MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB);
+	const MusicType musicType = MidiDriver::getMusicType(dev);
+	if (musicType == MT_MT32 || musicType == MT_GM) {
+		MidiDriver *driver = MidiDriver::createMidi(dev);
+		if (driver && driver->open() == 0) {
+			driver->sendMT32Reset();
+			_soundDriver = new MidiSoundDriverH32(driver);
+		} else {
+			warning("Could not create MIDI output falling back to AdLib");
+		}
 	}
+
+	if (!_soundDriver) {
+		if (_vm->getGameType() == GType_FW) {
+			_soundDriver = new AdLibSoundDriverINS(_mixer);
+		} else {
+			_soundDriver = new AdLibSoundDriverADL(_mixer);
+		}
+	}
+
 	_player = new PCSoundFxPlayer(_soundDriver);
 }
 


Commit: 42fd6975447b99f4a66ec411a62def2b3b49c5d6
    https://github.com/scummvm/scummvm/commit/42fd6975447b99f4a66ec411a62def2b3b49c5d6
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-12-10T20:04:04-08:00

Commit Message:
CINE: Make findNote behave a bit more like the original.

Changed paths:
    engines/cine/sound.cpp



diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp
index d882809..c909474 100644
--- a/engines/cine/sound.cpp
+++ b/engines/cine/sound.cpp
@@ -246,7 +246,9 @@ private:
 
 void PCSoundDriver::findNote(int freq, int *note, int *oct) const {
 	*note = _noteTableCount - 1;
-	for (int i = 0; i < _noteTableCount; ++i) {
+	// It might seem odd that we start with 1 here, but the original has the
+	// same behavior.
+	for (int i = 1; i < _noteTableCount; ++i) {
 		if (_noteTable[i] <= freq) {
 			*note = i;
 			break;


Commit: 6ba090b45aee2b39851c97ea3424a85f27d84138
    https://github.com/scummvm/scummvm/commit/6ba090b45aee2b39851c97ea3424a85f27d84138
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-12-10T20:04:08-08:00

Commit Message:
CINE: Make PC sound code thread safe, since the MIDI output might run the callback in an extra thread.

Changed paths:
    engines/cine/sound.cpp



diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp
index c909474..1fb18a9 100644
--- a/engines/cine/sound.cpp
+++ b/engines/cine/sound.cpp
@@ -26,6 +26,7 @@
 #include "common/system.h"
 #include "common/textconsole.h"
 #include "common/timer.h"
+#include "common/mutex.h"
 
 #include "cine/cine.h"
 #include "cine/sound.h"
@@ -200,6 +201,7 @@ public:
 private:
 	MidiDriver *_output;
 	UpdateCallback _callback;
+	Common::Mutex _mutex;
 
 	void writeInstrument(int offset, const byte *data, int size);
 	void selectInstrument(int channel, int unk, int instrument, int volume);
@@ -241,6 +243,7 @@ private:
 	byte *_sfxData;
 	byte *_instrumentsData[NUM_INSTRUMENTS];
 	PCSoundDriver *_driver;
+	Common::Mutex _mutex;
 };
 
 
@@ -595,7 +598,7 @@ void AdLibSoundDriverADL::playSample(const byte *data, int size, int channel, in
 }
 
 MidiSoundDriverH32::MidiSoundDriverH32(MidiDriver *output)
-    : _output(output), _callback(0) {
+    : _output(output), _callback(0), _mutex() {
 }
 
 MidiSoundDriverH32::~MidiSoundDriverH32() {
@@ -607,6 +610,8 @@ MidiSoundDriverH32::~MidiSoundDriverH32() {
 }
 
 void MidiSoundDriverH32::setUpdateCallback(UpdateCallback upCb, void *ref) {
+	Common::StackLock lock(_mutex);
+
 	Common::TimerManager *timer = g_system->getTimerManager();
 	assert(timer);
 
@@ -619,6 +624,8 @@ void MidiSoundDriverH32::setUpdateCallback(UpdateCallback upCb, void *ref) {
 }
 
 void MidiSoundDriverH32::setupChannel(int channel, const byte *data, int instrument, int volume) {
+	Common::StackLock lock(_mutex);
+
 	if (volume < 0 ||  volume > 100)
 		volume = 0;
 
@@ -631,6 +638,8 @@ void MidiSoundDriverH32::setupChannel(int channel, const byte *data, int instrum
 }
 
 void MidiSoundDriverH32::setChannelFrequency(int channel, int frequency) {
+	Common::StackLock lock(_mutex);
+
 	int note, oct;
 	findNote(frequency, &note, &oct);
 	note %= 12;
@@ -640,10 +649,14 @@ void MidiSoundDriverH32::setChannelFrequency(int channel, int frequency) {
 }
 
 void MidiSoundDriverH32::stopChannel(int channel) {
+	Common::StackLock lock(_mutex);
+
 	_output->send(0xB1 + channel, 0x7B, 0x00);
 }
 
 void MidiSoundDriverH32::playSample(const byte *data, int size, int channel, int volume) {
+	Common::StackLock lock(_mutex);
+
 	stopChannel(channel);
 
 	volume = volume * 8 / 5;
@@ -659,6 +672,8 @@ void MidiSoundDriverH32::playSample(const byte *data, int size, int channel, int
 }
 
 void MidiSoundDriverH32::notifyInstrumentLoad(const byte *data, int size, int channel) {
+	Common::StackLock lock(_mutex);
+
 	if (data[0] < 0x80 || data[0] > 0xC0)
 		return;
 
@@ -722,7 +737,7 @@ void MidiSoundDriverH32::selectInstrument(int channel, int unk, int instrument,
 }
 
 PCSoundFxPlayer::PCSoundFxPlayer(PCSoundDriver *driver)
-	: _playing(false), _driver(driver) {
+	: _playing(false), _driver(driver), _mutex() {
 	memset(_instrumentsData, 0, sizeof(_instrumentsData));
 	_sfxData = NULL;
 	_fadeOutCounter = 0;
@@ -730,12 +745,15 @@ PCSoundFxPlayer::PCSoundFxPlayer(PCSoundDriver *driver)
 }
 
 PCSoundFxPlayer::~PCSoundFxPlayer() {
+	Common::StackLock lock(_mutex);
+
 	_driver->setUpdateCallback(NULL, NULL);
 	stop();
 }
 
 bool PCSoundFxPlayer::load(const char *song) {
 	debug(9, "PCSoundFxPlayer::load('%s')", song);
+	Common::StackLock lock(_mutex);
 
 	/* stop (w/ fade out) the previous song */
 	while (_fadeOutCounter != 0 && _fadeOutCounter < 100) {
@@ -779,6 +797,7 @@ bool PCSoundFxPlayer::load(const char *song) {
 
 void PCSoundFxPlayer::play() {
 	debug(9, "PCSoundFxPlayer::play()");
+	Common::StackLock lock(_mutex);
 	if (_sfxData) {
 		for (int i = 0; i < NUM_CHANNELS; ++i) {
 			_instrumentsChannelTable[i] = -1;
@@ -793,6 +812,7 @@ void PCSoundFxPlayer::play() {
 }
 
 void PCSoundFxPlayer::stop() {
+	Common::StackLock lock(_mutex);
 	if (_playing || _fadeOutCounter != 0) {
 		_fadeOutCounter = 0;
 		_playing = false;
@@ -805,6 +825,7 @@ void PCSoundFxPlayer::stop() {
 }
 
 void PCSoundFxPlayer::fadeOut() {
+	Common::StackLock lock(_mutex);
 	if (_playing) {
 		_fadeOutCounter = 1;
 		_playing = false;
@@ -816,6 +837,7 @@ void PCSoundFxPlayer::updateCallback(void *ref) {
 }
 
 void PCSoundFxPlayer::update() {
+	Common::StackLock lock(_mutex);
 	if (_playing || (_fadeOutCounter != 0 && _fadeOutCounter < 100)) {
 		++_updateTicksCounter;
 		if (_updateTicksCounter > _eventsDelay) {


Commit: 93e817fc6351c2d9216a1a328979c0742b9a90d6
    https://github.com/scummvm/scummvm/commit/93e817fc6351c2d9216a1a328979c0742b9a90d6
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-12-10T20:04:11-08:00

Commit Message:
NEWS: Mention Roland MT-32 support in Cine.

Changed paths:
    NEWS



diff --git a/NEWS b/NEWS
index 2f4d1f3..ab2c28d 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,9 @@ For a more comprehensive changelog of the latest experimental code, see:
  Broken Sword 1:
    - Fixed incorrect sound effects in the DOS/Windows demo.
 
+ Cine:
+   - Implemented Roland MT-32 output driver.
+
  SCUMM:
    - Added support for the Macintosh version of SPY Fox in Hold the Mustard.
 






More information about the Scummvm-git-logs mailing list