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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jul 15 20:29:05 CEST 2007


Revision: 28110
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28110&view=rev
Author:   fingolfin
Date:     2007-07-15 11:29:05 -0700 (Sun, 15 Jul 2007)

Log Message:
-----------
Removed the old (obsolete) audiostream factories for MP3/Vorbis/FLAC data which took a File pointer and a size (these were only implemented as brain-dead wrapper around the newer factory methods anyway)

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/sound.cpp
    scummvm/trunk/engines/kyra/sound.h
    scummvm/trunk/engines/touche/resource.cpp
    scummvm/trunk/sound/flac.cpp
    scummvm/trunk/sound/flac.h
    scummvm/trunk/sound/mp3.cpp
    scummvm/trunk/sound/mp3.h
    scummvm/trunk/sound/vorbis.cpp
    scummvm/trunk/sound/vorbis.h

Modified: scummvm/trunk/engines/kyra/sound.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound.cpp	2007-07-15 18:26:45 UTC (rev 28109)
+++ scummvm/trunk/engines/kyra/sound.cpp	2007-07-15 18:29:05 UTC (rev 28110)
@@ -61,7 +61,9 @@
 		if (!_compressHandle.isOpen())
 			continue;
 		
-		_currentVocFile = _supportedCodes[i].streamFunc(&_compressHandle, fileSize);
+		Common::MemoryReadStream *tmp = _compressHandle.readStream(fileSize);
+		assert(tmp);
+		_currentVocFile = _supportedCodes[i].streamFunc(tmp, true, 0, 0, 1);
 		found = true;
 		break;
 	}

Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h	2007-07-15 18:26:45 UTC (rev 28109)
+++ scummvm/trunk/engines/kyra/sound.h	2007-07-15 18:29:05 UTC (rev 28110)
@@ -109,7 +109,12 @@
 
 	struct SpeechCodecs {
 		const char *fileext;
-		Audio::AudioStream *(*streamFunc)(Common::File*, uint32);
+		Audio::AudioStream *(*streamFunc)(
+			Common::SeekableReadStream *stream,
+			bool disposeAfterUse,
+			uint32 startTime,
+			uint32 duration,
+			uint numLoops);
 	};
 
 	static const SpeechCodecs _supportedCodes[];

Modified: scummvm/trunk/engines/touche/resource.cpp
===================================================================
--- scummvm/trunk/engines/touche/resource.cpp	2007-07-15 18:26:45 UTC (rev 28109)
+++ scummvm/trunk/engines/touche/resource.cpp	2007-07-15 18:29:05 UTC (rev 28110)
@@ -44,7 +44,12 @@
 
 struct CompressedSpeechFile {
 	const char *filename;
-	Audio::AudioStream *(*makeStream)(Common::File *file, uint32 size);
+	Audio::AudioStream *(*makeStream)(
+			Common::SeekableReadStream *stream,
+			bool disposeAfterUse,
+			uint32 startTime,
+			uint32 duration,
+			uint numLoops);
 };
 
 static const CompressedSpeechFile compressedSpeechFilesTable[] = {
@@ -656,7 +661,9 @@
 				return;
 			}
 			_fSpeech[0].seek(offs);
-			stream = (compressedSpeechFilesTable[_compressedSpeechData].makeStream)(&_fSpeech[0], size);
+			Common::MemoryReadStream *tmp = _fSpeech[0].readStream(size);
+			assert(tmp);
+			stream = (compressedSpeechFilesTable[_compressedSpeechData].makeStream)(tmp, true, 0, 0, 1);
 		}
 		if (stream) {
 			_speechPlaying = true;

Modified: scummvm/trunk/sound/flac.cpp
===================================================================
--- scummvm/trunk/sound/flac.cpp	2007-07-15 18:26:45 UTC (rev 28109)
+++ scummvm/trunk/sound/flac.cpp	2007-07-15 18:29:05 UTC (rev 28110)
@@ -734,28 +734,6 @@
 #pragma mark -
 
 
-AudioStream *makeFlacStream(File *file, uint32 size) {
-	assert(file);
-
-	// FIXME: For now, just read the whole data into memory, and be done
-	// with it. Of course this is in general *not* a nice thing to do...
-
-	// If no size was specified, read the whole remainder of the file
-	if (!size)
-		size = file->size() - file->pos();
-
-	// Read 'size' bytes of data into a MemoryReadStream
-	Common::MemoryReadStream *stream = file->readStream(size);
-
-	// .. and create an MP3InputStream from all this
-	FlacInputStream *input = new FlacInputStream(stream, true);
-	if (!input->isStreamDecoderReady()) {
-		delete input;
-		return 0;
-	}
-	return input;
-}
-
 AudioStream *makeFlacStream(
 	Common::SeekableReadStream *stream,
 	bool disposeAfterUse,

Modified: scummvm/trunk/sound/flac.h
===================================================================
--- scummvm/trunk/sound/flac.h	2007-07-15 18:26:45 UTC (rev 28109)
+++ scummvm/trunk/sound/flac.h	2007-07-15 18:29:05 UTC (rev 28110)
@@ -41,15 +41,6 @@
 class AudioStream;
 
 /**
- * Create a new AudioStream from the FLAC data in the given
- * file. If you only want to play part of that file, then seek
- * to the start position in file before passing it to this
- * factory function, and specify the appropriate size.
- */
-AudioStream *makeFlacStream(Common::File *file, uint32 size);
-
-
-/**
  * Create a new AudioStream from the FLAC data in the given stream.
  * Allows for looping (which is why we require a SeekableReadStream),
  * and specifying only a portion of the data to be played, based 

Modified: scummvm/trunk/sound/mp3.cpp
===================================================================
--- scummvm/trunk/sound/mp3.cpp	2007-07-15 18:26:45 UTC (rev 28109)
+++ scummvm/trunk/sound/mp3.cpp	2007-07-15 18:29:05 UTC (rev 28110)
@@ -302,23 +302,6 @@
 #pragma mark -
 
 
-AudioStream *makeMP3Stream(Common::File *file, uint32 size) {
-	assert(file);
-
-	// FIXME: For now, just read the whole data into memory, and be done
-	// with it. Of course this is in general *not* a nice thing to do...
-
-	// If no size was specified, read the whole remainder of the file
-	if (!size)
-		size = file->size() - file->pos();
-
-	// Read 'size' bytes of data into a MemoryReadStream
-	Common::MemoryReadStream *stream = file->readStream(size);
-
-	// .. and create an MP3InputStream from all this
-	return new MP3InputStream(stream, true);
-}
-
 AudioStream *makeMP3Stream(
 	Common::SeekableReadStream *stream,
 	bool disposeAfterUse,

Modified: scummvm/trunk/sound/mp3.h
===================================================================
--- scummvm/trunk/sound/mp3.h	2007-07-15 18:26:45 UTC (rev 28109)
+++ scummvm/trunk/sound/mp3.h	2007-07-15 18:29:05 UTC (rev 28110)
@@ -41,15 +41,6 @@
 class AudioStream;
 
 /**
- * Create a new AudioStream from the MP3 data in the given
- * file. If you only want to play part of that file, then seek
- * to the start position in file before passing it to this
- * factory function, and specify the appropriate size.
- */
-AudioStream *makeMP3Stream(Common::File *file, uint32 size);
-
-
-/**
  * Create a new AudioStream from the MP3 data in the given stream.
  * Allows for looping (which is why we require a SeekableReadStream),
  * and specifying only a portion of the data to be played, based 

Modified: scummvm/trunk/sound/vorbis.cpp
===================================================================
--- scummvm/trunk/sound/vorbis.cpp	2007-07-15 18:26:45 UTC (rev 28109)
+++ scummvm/trunk/sound/vorbis.cpp	2007-07-15 18:29:05 UTC (rev 28110)
@@ -266,23 +266,6 @@
 #pragma mark -
 
 
-AudioStream *makeVorbisStream(Common::File *file, uint32 size) {
-	assert(file);
-
-	// FIXME: For now, just read the whole data into memory, and be done
-	// with it. Of course this is in general *not* a nice thing to do...
-
-	// If no size was specified, read the whole remainder of the file
-	if (!size)
-		size = file->size() - file->pos();
-
-	// Read 'size' bytes of data into a MemoryReadStream
-	Common::MemoryReadStream *stream = file->readStream(size);
-
-	// .. and create a VorbisInputStream from all this
-	return new VorbisInputStream(stream, true);
-}
-
 AudioStream *makeVorbisStream(
 	Common::SeekableReadStream *stream,
 	bool disposeAfterUse,

Modified: scummvm/trunk/sound/vorbis.h
===================================================================
--- scummvm/trunk/sound/vorbis.h	2007-07-15 18:26:45 UTC (rev 28109)
+++ scummvm/trunk/sound/vorbis.h	2007-07-15 18:29:05 UTC (rev 28110)
@@ -41,15 +41,6 @@
 class AudioStream;
 
 /**
- * Create a new AudioStream from the Ogg Vorbis data in the given
- * file. If you only want to play part of that file, then seek
- * to the start position in file before passing it to this
- * factory function, and specify the appropriate size.
- */
-AudioStream *makeVorbisStream(Common::File *file, uint32 size);
-
-
-/**
  * Create a new AudioStream from the Ogg Vorbis data in the given stream.
  * Allows for looping (which is why we require a SeekableReadStream),
  * and specifying only a portion of the data to be played, based 


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