diff options
author | Johannes Schickel | 2010-01-07 16:18:03 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-07 16:18:03 +0000 |
commit | ca5e1379452f7777fd032baeb342ce88634d1836 (patch) | |
tree | f1433d6d557362f0dd2a79563f93b0ae35983fc4 /sound/audiostream.h | |
parent | 2e9bae44c5f80fe18aa0545b6c868682c380497c (diff) | |
download | scummvm-rg350-ca5e1379452f7777fd032baeb342ce88634d1836.tar.gz scummvm-rg350-ca5e1379452f7777fd032baeb342ce88634d1836.tar.bz2 scummvm-rg350-ca5e1379452f7777fd032baeb342ce88634d1836.zip |
Create a wrapper makeLoopingAudioStream to reduce code duplcation.
svn-id: r47128
Diffstat (limited to 'sound/audiostream.h')
-rw-r--r-- | sound/audiostream.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/audiostream.h b/sound/audiostream.h index 15dce74661..fbb84bcf53 100644 --- a/sound/audiostream.h +++ b/sound/audiostream.h @@ -125,6 +125,8 @@ public: /** * Creates a looping audio stream object. * + * @see makeLoopingAudioStream + * * @param stream Stream to loop * @param loops How often to loop (0 = infinite) * @param disposeAfteruse Destroy the stream after the LoopingAudioStream has finished playback. @@ -152,6 +154,20 @@ private: }; /** + * Wrapper functionallity to efficiently create a stream, which might be looped. + * + * Note that this function does not return a LoopingAudioStream, because it does + * not create one, when the loop count is "1". This allows to keep the runtime + * overhead down, when the code does not require any functionallity only offered + * by LoopingAudioStream. + * + * @param stream Stream to loop (will be automatically destroyed, when the looping is done) + * @param loops How often to loop (0 = infinite) + * @return A new AudioStream, which offers the desired functionallity. + */ +AudioStream *makeLoopingAudioStream(RewindableAudioStream *stream, uint loops); + +/** * A seekable audio stream. Subclasses of this class implement an * interface for seeking. The seeking itself is not required to be * working while the stream is being played by Mixer! |