[Scummvm-cvs-logs] SF.net SVN: scummvm: [26804] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat May 12 14:56:36 CEST 2007


Revision: 26804
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26804&view=rev
Author:   peres001
Date:     2007-05-12 05:56:35 -0700 (Sat, 12 May 2007)

Log Message:
-----------
Added Audio debug level and fixed a bug when freeing music streams.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/sound.cpp

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-05-12 11:52:29 UTC (rev 26803)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-05-12 12:56:35 UTC (rev 26804)
@@ -120,6 +120,7 @@
 	Common::addSpecialDebugLevel(kDebugGraphics, "gfx", "Gfx debug level");
 	Common::addSpecialDebugLevel(kDebugJobs, "jobs", "Jobs debug level");
 	Common::addSpecialDebugLevel(kDebugInput, "input", "Input debug level");
+	Common::addSpecialDebugLevel(kDebugAudio, "audio", "Audio debug level");
 
 }
 

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-05-12 11:52:29 UTC (rev 26803)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-05-12 12:56:35 UTC (rev 26804)
@@ -51,7 +51,8 @@
 	kDebugDialogue = 1 << 3,
 	kDebugGraphics = 1 << 4,
 	kDebugJobs = 1 << 5,
-	kDebugInput = 1 << 6
+	kDebugInput = 1 << 6,
+	kDebugAudio = 1 << 7
 };
 
 enum {

Modified: scummvm/trunk/engines/parallaction/sound.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/sound.cpp	2007-05-12 11:52:29 UTC (rev 26803)
+++ scummvm/trunk/engines/parallaction/sound.cpp	2007-05-12 12:56:35 UTC (rev 26804)
@@ -231,10 +231,14 @@
 }
 
 DosSoundMan::~DosSoundMan() {
+	debugC(1, kDebugAudio, "DosSoundMan::playMusic()");
+
 	delete _midiPlayer;
 }
 
 void DosSoundMan::playMusic() {
+	debugC(1, kDebugAudio, "DosSoundMan::playMusic()");
+
 	_midiPlayer->play(_musicFile);
 }
 
@@ -313,6 +317,8 @@
 		return;
 	}
 
+	debugC(1, kDebugAudio, "AmigaSoundMan::playSfx(%s, %i)", filename, channel);
+
 	Channel *ch = &_channels[channel];
 	Common::ReadStream *stream = _vm->_disk->loadSound(filename);
 	Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize);
@@ -349,6 +355,8 @@
 		return;
 	}
 
+	debugC(1, kDebugAudio, "AmigaSoundMan::stopSfx(%i)", channel);
+
 	_mixer->stopHandle(_channels[channel].handle);
 	free(_channels[channel].data);
 	_channels[channel].data = 0;
@@ -357,16 +365,25 @@
 void AmigaSoundMan::playMusic() {
 	stopMusic();
 
+	debugC(1, kDebugAudio, "AmigaSoundMan::playMusic()");
+
 	Common::ReadStream *stream = _vm->_disk->loadMusic(_musicFile);
 	_musicStream = Audio::makeProtrackerStream(stream);
 	delete stream;
 
+	debugC(3, kDebugAudio, "AmigaSoundMan::playMusic(): created new music stream");
+
 	_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, _musicStream, -1, 255, 0, false, false);
 }
 
 void AmigaSoundMan::stopMusic() {
-	_mixer->stopHandle(_musicHandle);
-	delete _musicStream;
+	debugC(1, kDebugAudio, "AmigaSoundMan::stopMusic()");
+
+	if (_mixer->isSoundHandleActive(_musicHandle)) {
+		_mixer->stopHandle(_musicHandle);
+		delete _musicStream;
+		_musicStream = 0;
+	}
 }
 
 void AmigaSoundMan::playCharacterMusic(const char *character) {


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