From 11b2806741da02dde2e2e4c1d5fa8ebb26d64233 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 15 Jul 2007 18:29:05 +0000 Subject: 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) svn-id: r28110 --- sound/flac.cpp | 22 ---------------------- sound/flac.h | 9 --------- sound/mp3.cpp | 17 ----------------- sound/mp3.h | 9 --------- sound/vorbis.cpp | 17 ----------------- sound/vorbis.h | 9 --------- 6 files changed, 83 deletions(-) (limited to 'sound') diff --git a/sound/flac.cpp b/sound/flac.cpp index 2093108fb8..6080509a0f 100644 --- a/sound/flac.cpp +++ b/sound/flac.cpp @@ -734,28 +734,6 @@ void FlacInputStream::callWrapError(const ::FLAC__SeekableStreamDecoder *decoder #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, diff --git a/sound/flac.h b/sound/flac.h index a949ffdf6a..b95f41d007 100644 --- a/sound/flac.h +++ b/sound/flac.h @@ -40,15 +40,6 @@ namespace Audio { 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), diff --git a/sound/mp3.cpp b/sound/mp3.cpp index 642c2ba90a..16ea2d2834 100644 --- a/sound/mp3.cpp +++ b/sound/mp3.cpp @@ -302,23 +302,6 @@ int MP3InputStream::readBuffer(int16 *buffer, const int numSamples) { #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, diff --git a/sound/mp3.h b/sound/mp3.h index 17c521ef37..ad66666b00 100644 --- a/sound/mp3.h +++ b/sound/mp3.h @@ -40,15 +40,6 @@ namespace Audio { 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), diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index be15039aca..668cdf4fc7 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -266,23 +266,6 @@ void VorbisInputStream::refill() { #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, diff --git a/sound/vorbis.h b/sound/vorbis.h index 03d2496fe8..98430e6aaa 100644 --- a/sound/vorbis.h +++ b/sound/vorbis.h @@ -40,15 +40,6 @@ namespace Audio { 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), -- cgit v1.2.3