[Scummvm-cvs-logs] SF.net SVN: scummvm:[47736] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jan 31 03:11:44 CET 2010


Revision: 47736
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47736&view=rev
Author:   fingolfin
Date:     2010-01-31 02:11:41 +0000 (Sun, 31 Jan 2010)

Log Message:
-----------
Switch makeADPCMStream to DisposeAfterUse::Flag

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/sound.cpp
    scummvm/trunk/engines/mohawk/video/qt_player.cpp
    scummvm/trunk/engines/saga/sndres.cpp
    scummvm/trunk/engines/scumm/he/sound_he.cpp
    scummvm/trunk/engines/tinsel/music.cpp
    scummvm/trunk/sound/decoders/adpcm.cpp
    scummvm/trunk/sound/decoders/adpcm.h

Modified: scummvm/trunk/engines/mohawk/sound.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/sound.cpp	2010-01-31 01:26:06 UTC (rev 47735)
+++ scummvm/trunk/engines/mohawk/sound.cpp	2010-01-31 02:11:41 UTC (rev 47736)
@@ -465,7 +465,7 @@
 	} else if (data_chunk.encoding == kCodecADPCM) {
 		Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(data_chunk.audio_data, data_chunk.size, DisposeAfterUse::YES);
 		uint32 blockAlign = data_chunk.channels * data_chunk.bitsPerSample / 8;
-		return Audio::makeADPCMStream(dataStream, true, data_chunk.size, Audio::kADPCMIma, data_chunk.sample_rate, data_chunk.channels, blockAlign);
+		return Audio::makeADPCMStream(dataStream, DisposeAfterUse::YES, data_chunk.size, Audio::kADPCMIma, data_chunk.sample_rate, data_chunk.channels, blockAlign);
 	} else if (data_chunk.encoding == kCodecMPEG2) {
 #ifdef USE_MAD
 		Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(data_chunk.audio_data, data_chunk.size, DisposeAfterUse::YES);

Modified: scummvm/trunk/engines/mohawk/video/qt_player.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/video/qt_player.cpp	2010-01-31 01:26:06 UTC (rev 47735)
+++ scummvm/trunk/engines/mohawk/video/qt_player.cpp	2010-01-31 02:11:41 UTC (rev 47736)
@@ -1173,7 +1173,7 @@
 		return Audio::makeRawStream(data, dataSize, _streams[_audioStreamIndex]->sample_rate, flags);
 	} else if (_streams[_audioStreamIndex]->codec_tag == MKID_BE('ima4')) {
 		// Riven uses this codec (as do some Myst ME videos)
-		return Audio::makeADPCMStream(stream, true, stream->size(), Audio::kADPCMApple, _streams[_audioStreamIndex]->sample_rate, _streams[_audioStreamIndex]->channels, 34);
+		return Audio::makeADPCMStream(stream, DisposeAfterUse::YES, stream->size(), Audio::kADPCMApple, _streams[_audioStreamIndex]->sample_rate, _streams[_audioStreamIndex]->channels, 34);
 	} else if (_streams[_audioStreamIndex]->codec_tag == MKID_BE('QDM2')) {
 		// Several Myst ME videos use this codec
 		return new QDM2Stream(stream, _streams[_audioStreamIndex]->extradata);

Modified: scummvm/trunk/engines/saga/sndres.cpp
===================================================================
--- scummvm/trunk/engines/saga/sndres.cpp	2010-01-31 01:26:06 UTC (rev 47735)
+++ scummvm/trunk/engines/saga/sndres.cpp	2010-01-31 02:11:41 UTC (rev 47736)
@@ -306,7 +306,7 @@
 	case kSoundVOX:
 		buffer.size = soundResourceLength * 4;
 		if (!onlyHeader) {
-			voxStream = Audio::makeADPCMStream(&readS, false, soundResourceLength, Audio::kADPCMOki);
+			voxStream = Audio::makeADPCMStream(&readS, DisposeAfterUse::NO, soundResourceLength, Audio::kADPCMOki);
 			buffer.buffer = (byte *)malloc(buffer.size);
 			voxStream->readBuffer((int16*)buffer.buffer, soundResourceLength * 2);
 			delete voxStream;

Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp	2010-01-31 01:26:06 UTC (rev 47735)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp	2010-01-31 02:11:41 UTC (rev 47736)
@@ -643,7 +643,7 @@
 
 		_mixer->stopHandle(_heSoundChannels[heChannel]);
 		if (compType == 17) {
-			Audio::AudioStream *voxStream = Audio::makeADPCMStream(&memStream, false, size, Audio::kADPCMMSIma, rate, (flags & Audio::FLAG_STEREO) ? 2 : 1, blockAlign);
+			Audio::AudioStream *voxStream = Audio::makeADPCMStream(&memStream, DisposeAfterUse::NO, size, Audio::kADPCMMSIma, rate, (flags & Audio::FLAG_STEREO) ? 2 : 1, blockAlign);
 
 			// FIXME: Get rid of this crude hack to turn a ADPCM stream into a raw stream.
 			// It seems it is only there to allow looping -- if that is true, we certainly

Modified: scummvm/trunk/engines/tinsel/music.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/music.cpp	2010-01-31 01:26:06 UTC (rev 47735)
+++ scummvm/trunk/engines/tinsel/music.cpp	2010-01-31 02:11:41 UTC (rev 47736)
@@ -877,7 +877,7 @@
 		sampleStream = new Common::MemoryReadStream(buffer, sampleCLength, DisposeAfterUse::YES);
 
 		delete _curChunk;
-		_curChunk = makeADPCMStream(sampleStream, true, sampleCLength,
+		_curChunk = makeADPCMStream(sampleStream, DisposeAfterUse::YES, sampleCLength,
 				Audio::kADPCMTinsel8, 22050, 1, 32);
 
 		_state = S_MID;

Modified: scummvm/trunk/sound/decoders/adpcm.cpp
===================================================================
--- scummvm/trunk/sound/decoders/adpcm.cpp	2010-01-31 01:26:06 UTC (rev 47735)
+++ scummvm/trunk/sound/decoders/adpcm.cpp	2010-01-31 02:11:41 UTC (rev 47736)
@@ -34,7 +34,7 @@
 class ADPCMInputStream : public RewindableAudioStream {
 private:
 	Common::SeekableReadStream *_stream;
-	bool _disposeAfterUse;
+	DisposeAfterUse::Flag _disposeAfterUse;
 	int32 _startpos;
 	int32 _endpos;
 	int _channels;
@@ -82,7 +82,7 @@
 	int16 decodeTinsel(int16, double);
 
 public:
-	ADPCMInputStream(Common::SeekableReadStream *stream, bool disposeAfterUse, uint32 size, typesADPCM type, int rate, int channels, uint32 blockAlign);
+	ADPCMInputStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, typesADPCM type, int rate, int channels, uint32 blockAlign);
 	~ADPCMInputStream();
 
 	int readBuffer(int16 *buffer, const int numSamples);
@@ -114,7 +114,7 @@
 // In addition, also MS IMA ADPCM is supported. See
 //   <http://wiki.multimedia.cx/index.php?title=Microsoft_IMA_ADPCM>.
 
-ADPCMInputStream::ADPCMInputStream(Common::SeekableReadStream *stream, bool disposeAfterUse, uint32 size, typesADPCM type, int rate, int channels, uint32 blockAlign)
+ADPCMInputStream::ADPCMInputStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, typesADPCM type, int rate, int channels, uint32 blockAlign)
 	: _stream(stream), _disposeAfterUse(disposeAfterUse), _channels(channels), _type(type), _blockAlign(blockAlign), _rate(rate) {
 
 	if (type == kADPCMMSIma && blockAlign == 0)
@@ -142,7 +142,7 @@
 }
 
 ADPCMInputStream::~ADPCMInputStream() {
-	if (_disposeAfterUse)
+	if (_disposeAfterUse == DisposeAfterUse::YES)
 		delete _stream;
 }
 
@@ -626,7 +626,7 @@
 	return (int16) CLIP<double>(sample, -32768.0, 32767.0);
 }
 
-RewindableAudioStream *makeADPCMStream(Common::SeekableReadStream *stream, bool disposeAfterUse, uint32 size, typesADPCM type, int rate, int channels, uint32 blockAlign) {
+RewindableAudioStream *makeADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, typesADPCM type, int rate, int channels, uint32 blockAlign) {
 	return new ADPCMInputStream(stream, disposeAfterUse, size, type, rate, channels, blockAlign);
 }
 

Modified: scummvm/trunk/sound/decoders/adpcm.h
===================================================================
--- scummvm/trunk/sound/decoders/adpcm.h	2010-01-31 01:26:06 UTC (rev 47735)
+++ scummvm/trunk/sound/decoders/adpcm.h	2010-01-31 02:11:41 UTC (rev 47736)
@@ -75,7 +75,7 @@
  */
 RewindableAudioStream *makeADPCMStream(
     Common::SeekableReadStream *stream,
-    bool disposeAfterUse,
+    DisposeAfterUse::Flag disposeAfterUse,
     uint32 size, typesADPCM type,
     int rate = 22050,
     int channels = 2,


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