[Scummvm-cvs-logs] SF.net SVN: scummvm:[47061] scummvm/trunk
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Wed Jan 6 00:59:28 CET 2010
Revision: 47061
http://scummvm.svn.sourceforge.net/scummvm/?rev=47061&view=rev
Author: lordhoto
Date: 2010-01-05 23:59:28 +0000 (Tue, 05 Jan 2010)
Log Message:
-----------
- Put the new factories for MP3, Vorbis and FLAC in place.
- Marked the loop factories with loop related parameters as deprecated.
Modified Paths:
--------------
scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.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/scumm/imuse_digi/dimuse_sndmgr.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp 2010-01-05 23:05:31 UTC (rev 47060)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp 2010-01-05 23:59:28 UTC (rev 47061)
@@ -704,15 +704,15 @@
assert(tmp);
#ifdef USE_FLAC
if (soundMode == 3)
- soundDesc->compressedStream = Audio::makeFlacStream(tmp, true, offsetMs);
+ soundDesc->compressedStream = Audio::makeFlacStream(tmp, true, offsetMs, 0, 1);
#endif
#ifdef USE_VORBIS
if (soundMode == 2)
- soundDesc->compressedStream = Audio::makeVorbisStream(tmp, true, offsetMs);
+ soundDesc->compressedStream = Audio::makeVorbisStream(tmp, true, offsetMs, 0, 1);
#endif
#ifdef USE_MAD
if (soundMode == 1)
- soundDesc->compressedStream = Audio::makeMP3Stream(tmp, true, offsetMs);
+ soundDesc->compressedStream = Audio::makeMP3Stream(tmp, true, offsetMs, 0, 1);
#endif
assert(soundDesc->compressedStream);
}
Modified: scummvm/trunk/sound/flac.cpp
===================================================================
--- scummvm/trunk/sound/flac.cpp 2010-01-05 23:05:31 UTC (rev 47060)
+++ scummvm/trunk/sound/flac.cpp 2010-01-05 23:59:28 UTC (rev 47061)
@@ -793,6 +793,12 @@
return input;
}
+SeekableAudioStream *makeFlacStream(
+ Common::SeekableReadStream *stream,
+ bool disposeAfterUse) {
+ return makeFlacStream(stream, disposeAfterUse, 0, 0, 1);
+}
+
} // End of namespace Audio
#endif // #ifdef USE_FLAC
Modified: scummvm/trunk/sound/flac.h
===================================================================
--- scummvm/trunk/sound/flac.h 2010-01-05 23:05:31 UTC (rev 47060)
+++ scummvm/trunk/sound/flac.h 2010-01-05 23:59:28 UTC (rev 47061)
@@ -54,6 +54,9 @@
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,10 +72,22 @@
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
#endif // #ifdef USE_FLAC
Modified: scummvm/trunk/sound/mp3.cpp
===================================================================
--- scummvm/trunk/sound/mp3.cpp 2010-01-05 23:05:31 UTC (rev 47060)
+++ scummvm/trunk/sound/mp3.cpp 2010-01-05 23:59:28 UTC (rev 47061)
@@ -425,6 +425,12 @@
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
Modified: scummvm/trunk/sound/mp3.h
===================================================================
--- scummvm/trunk/sound/mp3.h 2010-01-05 23:05:31 UTC (rev 47060)
+++ scummvm/trunk/sound/mp3.h 2010-01-05 23:59:28 UTC (rev 47061)
@@ -54,7 +54,10 @@
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,15 +67,27 @@
* @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
#endif // #ifdef USE_MAD
Modified: scummvm/trunk/sound/vorbis.cpp
===================================================================
--- scummvm/trunk/sound/vorbis.cpp 2010-01-05 23:05:31 UTC (rev 47060)
+++ scummvm/trunk/sound/vorbis.cpp 2010-01-05 23:59:28 UTC (rev 47061)
@@ -349,6 +349,11 @@
return input;
}
+SeekableAudioStream *makeVorbisStream(
+ Common::SeekableReadStream *stream,
+ bool disposeAfterUse) {
+ return makeVorbisStream(stream, disposeAfterUse, 0, 0, 1);
+}
} // End of namespace Audio
Modified: scummvm/trunk/sound/vorbis.h
===================================================================
--- scummvm/trunk/sound/vorbis.h 2010-01-05 23:05:31 UTC (rev 47060)
+++ scummvm/trunk/sound/vorbis.h 2010-01-05 23:59:28 UTC (rev 47061)
@@ -54,6 +54,9 @@
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,15 +67,27 @@
* @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
#endif // #ifdef USE_VORBIS
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