[Scummvm-cvs-logs] SF.net SVN: scummvm:[42620] scummvm/branches/gsoc2009-mods

nolange at users.sourceforge.net nolange at users.sourceforge.net
Sun Jul 19 18:11:05 CEST 2009


Revision: 42620
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42620&view=rev
Author:   nolange
Date:     2009-07-19 16:11:05 +0000 (Sun, 19 Jul 2009)

Log Message:
-----------
use own soundhandle as the ones in Kyra::Sound seem to be used for voices (and might get killed)

Modified Paths:
--------------
    scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp
    scummvm/branches/gsoc2009-mods/engines/kyra/sound_intern.h
    scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp

Modified: scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp
===================================================================
--- scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp	2009-07-19 16:10:55 UTC (rev 42619)
+++ scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp	2009-07-19 16:11:05 UTC (rev 42620)
@@ -40,8 +40,8 @@
 	{ "finalescr.mx", 0 }
 };
 
-SoundAmiga::SoundAmiga(KyraEngine_v1 *vm, Audio::Mixer *mixer) :
-	Sound(vm, mixer), _driver(0), _fileLoaded(kFileNone) {
+SoundAmiga::SoundAmiga(KyraEngine_v1 *vm, Audio::Mixer *mixer)
+	: Sound(vm, mixer), _driver(0), _musicHandle(), _fileLoaded(kFileNone) {
 }
 
 SoundAmiga::~SoundAmiga() {
@@ -96,8 +96,8 @@
 		if (_driver->playSong(track)) {
 			_driver->setVolume(0x40);
 			_driver->setTempo(tempoIntro[track] << 4);
-			if (!_mixer->isSoundHandleActive(_soundChannels[0]))
-				_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundChannels[0], _driver);
+			if (!_mixer->isSoundHandleActive(_musicHandle))
+				_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_musicHandle, _driver, -1, Audio::Mixer::kMaxChannelVolume, 0, false);
 		}
 	} else if (track == 0){
 		_driver->stopMusic();
@@ -113,8 +113,8 @@
 				_driver->setVolume(0x40);
 			
 				_driver->setTempo(tempoIngame[track] << 4);
-				if (!_mixer->isSoundHandleActive(_soundChannels[0]))
-					_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundChannels[0], _driver);
+				if (!_mixer->isSoundHandleActive(_musicHandle))
+					_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_musicHandle, _driver, -1, Audio::Mixer::kMaxChannelVolume, 0, false);
 			}
 		} else if (track == 0){
 			_driver->stopMusic();
@@ -146,8 +146,8 @@
 	assert(track < ARRAYSIZE(tableEffectsIntro));
 	const EffectEntry &entry = tableEffectsIntro[track];
 	bool success = _driver->playNote(entry.note, entry.patch, entry.duration, entry.volume, entry.pan != 0) >= 0;
-	if (!_mixer->isSoundHandleActive(_soundChannels[0]))
-		_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundChannels[0], _driver);
+	if (!_mixer->isSoundHandleActive(_musicHandle))
+		_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_musicHandle, _driver, -1, Audio::Mixer::kMaxChannelVolume, 0, false);
 
 
 	// ingame
@@ -162,8 +162,8 @@
 	if (extVar2 && entry.note) {
 		byte pan = (entry.pan == 2) ? 0 : entry.pan;
 		_driver->playNote(entry.note, entry.patch, entry.duration, entry.volume, pan != 0);
-		if (!_mixer->isSoundHandleActive(_soundChannels[0]))
-			_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundChannels[0], _driver);
+		if (!_mixer->isSoundHandleActive(_musicHandle))
+			_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_musicHandle, _driver, -1, Audio::Mixer::kMaxChannelVolume, 0, false);
 	}
 	}
 }

Modified: scummvm/branches/gsoc2009-mods/engines/kyra/sound_intern.h
===================================================================
--- scummvm/branches/gsoc2009-mods/engines/kyra/sound_intern.h	2009-07-19 16:10:55 UTC (rev 42619)
+++ scummvm/branches/gsoc2009-mods/engines/kyra/sound_intern.h	2009-07-19 16:11:05 UTC (rev 42620)
@@ -307,6 +307,7 @@
 
 protected:
 	Audio::MaxTrax *_driver;
+	Audio::SoundHandle _musicHandle;
 	enum FileType { kFileNone = -1, kFileIntro = 0, kFileGame = 1, kFileFinal = 2 } _fileLoaded;
 
 	static const char *const kFilenameTable[3][2];

Modified: scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp
===================================================================
--- scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp	2009-07-19 16:10:55 UTC (rev 42619)
+++ scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp	2009-07-19 16:11:05 UTC (rev 42620)
@@ -339,7 +339,7 @@
 	// Songs are special markers in the score
 	for (; advance > 0; --advance) {
 		// TODO - check for boundaries 
-		for(; cev->command != 0xFF && (cev->command != 0xA0 || (cev->stopTime >> 8) != 0x00); ++cev)
+		for (; cev->command != 0xFF && (cev->command != 0xA0 || (cev->stopTime >> 8) != 0x00); ++cev)
 			; // no end_command or special_command + end
 	}
 	_playerCtx.nextEvent = cev;


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