diff options
author | Johannes Schickel | 2010-01-05 23:59:28 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-05 23:59:28 +0000 |
commit | 81a94a06444fcefa8645b26ba34a5ee0e45851db (patch) | |
tree | c2f503610043b07fa001dcad2963fa058f6909a3 /sound | |
parent | 79ee2b0895b4b64fab878f1f3c028e9bfdf5fcf3 (diff) | |
download | scummvm-rg350-81a94a06444fcefa8645b26ba34a5ee0e45851db.tar.gz scummvm-rg350-81a94a06444fcefa8645b26ba34a5ee0e45851db.tar.bz2 scummvm-rg350-81a94a06444fcefa8645b26ba34a5ee0e45851db.zip |
- Put the new factories for MP3, Vorbis and FLAC in place.
- Marked the loop factories with loop related parameters as deprecated.
svn-id: r47061
Diffstat (limited to 'sound')
-rw-r--r-- | sound/flac.cpp | 6 | ||||
-rw-r--r-- | sound/flac.h | 21 | ||||
-rw-r--r-- | sound/mp3.cpp | 6 | ||||
-rw-r--r-- | sound/mp3.h | 25 | ||||
-rw-r--r-- | sound/vorbis.cpp | 5 | ||||
-rw-r--r-- | sound/vorbis.h | 23 |
6 files changed, 74 insertions, 12 deletions
diff --git a/sound/flac.cpp b/sound/flac.cpp index 0310754374..28db39f9f3 100644 --- a/sound/flac.cpp +++ b/sound/flac.cpp @@ -793,6 +793,12 @@ SeekableAudioStream *makeFlacStream( return input; } +SeekableAudioStream *makeFlacStream( + Common::SeekableReadStream *stream, + bool disposeAfterUse) { + return makeFlacStream(stream, disposeAfterUse, 0, 0, 1); +} + } // End of namespace Audio #endif // #ifdef USE_FLAC diff --git a/sound/flac.h b/sound/flac.h index 1eab47d015..dd1c5dd770 100644 --- a/sound/flac.h +++ b/sound/flac.h @@ -54,6 +54,9 @@ namespace Audio { 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 @@ -69,9 +72,21 @@ class SeekableAudioStream; SeekableAudioStream *makeFlacStream( Common::SeekableReadStream *stream, bool disposeAfterUse, - uint32 startTime = 0, - uint32 duration = 0, - uint numLoops = 1); + 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). + * + * @param stream the SeekableReadStream from which to read the FLAC data + * @param disposeAfterUse whether to delete the stream after use + * @return a new SeekableAudioStream, or NULL, if an error occured + */ +SeekableAudioStream *makeFlacStream( + Common::SeekableReadStream *stream, + bool disposeAfterUse); } // End of namespace Audio diff --git a/sound/mp3.cpp b/sound/mp3.cpp index faebf347e1..7c590b0ef9 100644 --- a/sound/mp3.cpp +++ b/sound/mp3.cpp @@ -425,6 +425,12 @@ SeekableAudioStream *makeMP3Stream( return new MP3InputStream(stream, disposeAfterUse, start, end, numLoops); } +SeekableAudioStream *makeMP3Stream( + Common::SeekableReadStream *stream, + bool disposeAfterUse) { + return makeMP3Stream(stream, disposeAfterUse, 0, 0, 1); +} + } // End of namespace Audio #endif // #ifdef USE_MAD diff --git a/sound/mp3.h b/sound/mp3.h index 544f4861ba..c0245636a3 100644 --- a/sound/mp3.h +++ b/sound/mp3.h @@ -54,7 +54,10 @@ namespace Audio { class SeekableAudioStream; /** - * Create a new AudioStream from the MP3 data in the given stream. + * 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. @@ -64,14 +67,26 @@ class SeekableAudioStream; * @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 + * @return a new SeekableAudioStream, or NULL, if an error occured */ SeekableAudioStream *makeMP3Stream( Common::SeekableReadStream *stream, bool disposeAfterUse, - uint32 startTime = 0, - uint32 duration = 0, - uint numLoops = 1); + 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). + * + * @param stream the SeekableReadStream from which to read the MP3 data + * @param disposeAfterUse whether to delete the stream after use + * @return a new SeekableAudioStream, or NULL, if an error occured + */ +SeekableAudioStream *makeMP3Stream( + Common::SeekableReadStream *stream, + bool disposeAfterUse); } // End of namespace Audio diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index 629c36b3db..2fd7c978be 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -349,6 +349,11 @@ SeekableAudioStream *makeVorbisStream( return input; } +SeekableAudioStream *makeVorbisStream( + Common::SeekableReadStream *stream, + bool disposeAfterUse) { + return makeVorbisStream(stream, disposeAfterUse, 0, 0, 1); +} } // End of namespace Audio diff --git a/sound/vorbis.h b/sound/vorbis.h index 369cd14d01..8ac7354f1f 100644 --- a/sound/vorbis.h +++ b/sound/vorbis.h @@ -54,6 +54,9 @@ namespace Audio { 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 @@ -64,14 +67,26 @@ class SeekableAudioStream; * @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 + * @return a new SeekableAudioStream, or NULL, if an error occured */ SeekableAudioStream *makeVorbisStream( Common::SeekableReadStream *stream, bool disposeAfterUse, - uint32 startTime = 0, - uint32 duration = 0, - uint numLoops = 1); + 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). + * + * @param stream the SeekableReadStream from which to read the Ogg Vorbis data + * @param disposeAfterUse whether to delete the stream after use + * @return a new SeekableAudioStream, or NULL, if an error occured + */ +SeekableAudioStream *makeVorbisStream( + Common::SeekableReadStream *stream, + bool disposeAfterUse); } // End of namespace Audio |