diff options
author | Johannes Schickel | 2010-01-07 17:14:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-07 17:14:44 +0000 |
commit | aa2f55ddc6730e8c3afce61efa241d5f1b1e6b34 (patch) | |
tree | f11f10e485a11cce728854376b92a3ec3b926b3d | |
parent | b47725540f53694ce8d261a2b7b132aff6c6eb74 (diff) | |
download | scummvm-rg350-aa2f55ddc6730e8c3afce61efa241d5f1b1e6b34.tar.gz scummvm-rg350-aa2f55ddc6730e8c3afce61efa241d5f1b1e6b34.tar.bz2 scummvm-rg350-aa2f55ddc6730e8c3afce61efa241d5f1b1e6b34.zip |
Remove the deprecated FLAC, Vorbis and MP3 factories.
svn-id: r47134
-rw-r--r-- | engines/mohawk/sound.cpp | 2 | ||||
-rw-r--r-- | engines/sword1/music.cpp | 8 | ||||
-rw-r--r-- | sound/flac.cpp | 24 | ||||
-rw-r--r-- | sound/flac.h | 23 | ||||
-rw-r--r-- | sound/mp3.cpp | 23 | ||||
-rw-r--r-- | sound/mp3.h | 23 | ||||
-rw-r--r-- | sound/vorbis.cpp | 24 | ||||
-rw-r--r-- | sound/vorbis.h | 23 |
8 files changed, 5 insertions, 145 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index 59dc6c1151..b3a7f8fc21 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -448,7 +448,7 @@ Audio::AudioStream *Sound::makeMohawkWaveStream(Common::SeekableReadStream *stre } else if (data_chunk.encoding == kCodecMPEG2) { #ifdef USE_MAD Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(data_chunk.audio_data, data_chunk.size, Common::DisposeAfterUse::YES); - return Audio::makeMP3Stream(dataStream, true, 0, 0, !loop); + return Audio::makeLoopingAudioStream(Audio::makeMP3Stream(dataStream, true), loop ? 0 : 1); #else warning ("MAD library not included - unable to play MP2 audio"); #endif diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index 783900c598..dd86f27f43 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -177,7 +177,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) { if (!_audioSource) { sprintf(fileName, "%s.flac", fileBase); if (_file.open(fileName)) { - _audioSource = Audio::makeFlacStream(&_file, false, 0, 0, loop ? 0 : 1); + _audioSource = Audio::makeLoopingAudioStream(Audio::makeFlacStream(&_file, false), loop ? 0 : 1); if (!_audioSource) _file.close(); } @@ -186,7 +186,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) { if (!_audioSource) { sprintf(fileName, "%s.fla", fileBase); if (_file.open(fileName)) { - _audioSource = Audio::makeFlacStream(&_file, false, 0, 0, loop ? 0 : 1); + _audioSource = Audio::makeLoopingAudioStream(Audio::makeFlacStream(&_file, false), loop ? 0 : 1); if (!_audioSource) _file.close(); } @@ -196,7 +196,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) { if (!_audioSource) { sprintf(fileName, "%s.ogg", fileBase); if (_file.open(fileName)) { - _audioSource = Audio::makeVorbisStream(&_file, false, 0, 0, loop ? 0 : 1); + _audioSource = Audio::makeLoopingAudioStream(Audio::makeVorbisStream(&_file, false), loop ? 0 : 1); if (!_audioSource) _file.close(); } @@ -206,7 +206,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) { if (!_audioSource) { sprintf(fileName, "%s.mp3", fileBase); if (_file.open(fileName)) { - _audioSource = Audio::makeMP3Stream(&_file, false, 0, 0, loop ? 0 : 1); + _audioSource = Audio::makeLoopingAudioStream(Audio::makeMP3Stream(&_file, false), loop ? 0 : 1); if (!_audioSource) _file.close(); } diff --git a/sound/flac.cpp b/sound/flac.cpp index d225822889..1c7f03b9d1 100644 --- a/sound/flac.cpp +++ b/sound/flac.cpp @@ -724,30 +724,6 @@ void FlacInputStream::callWrapError(const ::FLAC__SeekableStreamDecoder *decoder #pragma mark --- Flac factory functions --- #pragma mark - - -AudioStream *makeFlacStream( - Common::SeekableReadStream *stream, - bool disposeAfterUse, - uint32 startTime, - uint32 duration, - uint numLoops) { - - SeekableAudioStream *input = new FlacInputStream(stream, disposeAfterUse); - assert(input); - - if (startTime || duration) { - Timestamp start(startTime, 1000), end(startTime + duration, 1000); - - if (!duration) - end = input->getLength(); - - input = new SubSeekableAudioStream(input, start, end); - assert(input); - } - - return makeLoopingAudioStream(input, numLoops); -} - SeekableAudioStream *makeFlacStream( Common::SeekableReadStream *stream, bool disposeAfterUse) { diff --git a/sound/flac.h b/sound/flac.h index 5b8acf1154..7c891d41d8 100644 --- a/sound/flac.h +++ b/sound/flac.h @@ -55,29 +55,6 @@ class AudioStream; class SeekableAudioStream; /** - * TODO: This is an deprecated interface, it is only for the transition to - * SeekableAudioStream in the engines. - * - * 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 - * on time offsets. - * - * @param stream the SeekableReadStream from which to read the FLAC data - * @param disposeAfterUse whether to delete the stream after use - * @param startTime the (optional) time offset in milliseconds from which to start playback - * @param duration the (optional) time in milliseconds specifying how long to play - * @param numLoops how often the data shall be looped (0 = infinite) - * @return a new AudioStream, or NULL, if an error occured - */ -AudioStream *makeFlacStream( - Common::SeekableReadStream *stream, - bool disposeAfterUse, - uint32 startTime, - uint32 duration, - uint numLoops); - -/** * Create a new SeekableAudioStream from the FLAC data in the given stream. * Allows for seeking (which is why we require a SeekableReadStream). * diff --git a/sound/mp3.cpp b/sound/mp3.cpp index f5b6420c4f..98144621c8 100644 --- a/sound/mp3.cpp +++ b/sound/mp3.cpp @@ -338,29 +338,6 @@ int MP3InputStream::readBuffer(int16 *buffer, const int numSamples) { #pragma mark --- MP3 factory functions --- #pragma mark - -AudioStream *makeMP3Stream( - Common::SeekableReadStream *stream, - bool disposeAfterUse, - uint32 startTime, - uint32 duration, - uint numLoops) { - - SeekableAudioStream *mp3 = new MP3InputStream(stream, disposeAfterUse); - assert(mp3); - - if (startTime || duration) { - Timestamp start(startTime, 1000), end(startTime + duration, 1000); - - if (!duration) - end = mp3->getLength(); - - mp3 = new SubSeekableAudioStream(mp3, start, end); - assert(mp3); - } - - return makeLoopingAudioStream(mp3, numLoops); -} - SeekableAudioStream *makeMP3Stream( Common::SeekableReadStream *stream, bool disposeAfterUse) { diff --git a/sound/mp3.h b/sound/mp3.h index 9eb62e10e7..ca5a65ee00 100644 --- a/sound/mp3.h +++ b/sound/mp3.h @@ -55,29 +55,6 @@ class AudioStream; class SeekableAudioStream; /** - * TODO: This is an deprecated interface, it is only for the transition to - * SeekableAudioStream in the engines. - * - * Create a new SeekableAudioStream 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 - * on time offsets. - * - * @param stream the SeekableReadStream from which to read the MP3 data - * @param disposeAfterUse whether to delete the stream after use - * @param startTime the (optional) time offset in milliseconds from which to start playback - * @param duration the (optional) time in milliseconds specifying how long to play - * @param numLoops how often the data shall be looped (0 = infinite) - * @return a new SeekableAudioStream, or NULL, if an error occured - */ -AudioStream *makeMP3Stream( - Common::SeekableReadStream *stream, - bool disposeAfterUse, - uint32 startTime, - uint32 duration, - uint numLoops); - -/** * Create a new SeekableAudioStream from the MP3 data in the given stream. * Allows for seeking (which is why we require a SeekableReadStream). * diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index 54d9042cf8..70201cb23d 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -239,30 +239,6 @@ bool VorbisInputStream::refill() { #pragma mark --- Ogg Vorbis factory functions --- #pragma mark - - -AudioStream *makeVorbisStream( - Common::SeekableReadStream *stream, - bool disposeAfterUse, - uint32 startTime, - uint32 duration, - uint numLoops) { - - SeekableAudioStream *input = new VorbisInputStream(stream, disposeAfterUse); - assert(input); - - if (startTime || duration) { - Timestamp start(startTime, 1000), end(startTime + duration, 1000); - - if (!duration) - end = input->getLength(); - - input = new SubSeekableAudioStream(input, start, end); - assert(input); - } - - return makeLoopingAudioStream(input, numLoops); -} - SeekableAudioStream *makeVorbisStream( Common::SeekableReadStream *stream, bool disposeAfterUse) { diff --git a/sound/vorbis.h b/sound/vorbis.h index e0c6f07b58..9e49eead55 100644 --- a/sound/vorbis.h +++ b/sound/vorbis.h @@ -55,29 +55,6 @@ class AudioStream; class SeekableAudioStream; /** - * TODO: This is an deprecated interface, it is only for the transition to - * SeekableAudioStream in the engines. - * - * 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 - * on time offsets. - * - * @param stream the SeekableReadStream from which to read the Ogg Vorbis data - * @param disposeAfterUse whether to delete the stream after use - * @param startTime the (optional) time offset in milliseconds from which to start playback - * @param duration the (optional) time in milliseconds specifying how long to play - * @param numLoops how often the data shall be looped (0 = infinite) - * @return a new SeekableAudioStream, or NULL, if an error occured - */ -AudioStream *makeVorbisStream( - Common::SeekableReadStream *stream, - bool disposeAfterUse, - uint32 startTime, - uint32 duration, - uint numLoops); - -/** * Create a new SeekableAudioStream from the Ogg Vorbis data in the given stream. * Allows for seeking (which is why we require a SeekableReadStream). * |