aboutsummaryrefslogtreecommitdiff
path: root/sound/decoders/raw.h
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-30 15:17:57 +0000
committerJohannes Schickel2010-01-30 15:17:57 +0000
commitec3f58e626a0645c21bc76fbc7cbd2a58eeee43e (patch)
treeeef0ab4cdc802643b252caa4fe9fab697890098c /sound/decoders/raw.h
parent17cebab3549bac2ae57d0550d477c6cafbee70c5 (diff)
downloadscummvm-rg350-ec3f58e626a0645c21bc76fbc7cbd2a58eeee43e.tar.gz
scummvm-rg350-ec3f58e626a0645c21bc76fbc7cbd2a58eeee43e.tar.bz2
scummvm-rg350-ec3f58e626a0645c21bc76fbc7cbd2a58eeee43e.zip
- Mark makeRawDiskStream factory as deprecated.
- Introduce two new makeRawStream factories, one is using RawStreamBlockList instead of an RawDiskStreamAudioBlock array. svn-id: r47713
Diffstat (limited to 'sound/decoders/raw.h')
-rw-r--r--sound/decoders/raw.h46
1 files changed, 42 insertions, 4 deletions
diff --git a/sound/decoders/raw.h b/sound/decoders/raw.h
index 4136c9953e..c3be9f16a1 100644
--- a/sound/decoders/raw.h
+++ b/sound/decoders/raw.h
@@ -76,7 +76,7 @@ enum RawFlags {
* @param len length of the buffer in bytes
* @param rate sample rate of the data
* @param flags audio format flags combination
- * @see Mixer::RawFlags
+ * @see RawFlags
* @param autofreeBuffer whether the data buffer should be destroyed after playback
* @return The new SeekableAudioStream (or 0 on failure).
*/
@@ -108,15 +108,53 @@ AudioStream *makeRawMemoryStream_OLD(const byte *ptr, uint32 len,
*/
struct RawDiskStreamAudioBlock {
int32 pos; ///< Position in stream of the block (in bytes of course!)
- int32 len; ///< Length of the block (in samples)
+ int32 len; ///< Length of the block (in sample (pairs))
};
/**
* List containing all blocks of a raw stream.
+ * @see RawDiskStreamAudioBlock
*/
typedef Common::List<RawDiskStreamAudioBlock> RawStreamBlockList;
/**
+ * Creates an audio stream, which plays from the given stream.
+ *
+ * @param stream Stream object to play from.
+ * @param size Size of the buffer.
+ * @param rate Rate of the sound data.
+ * @param flags Audio flags combination.
+ * @see RawFlags
+ * @param disposeAfterUse Whether to delete the stream after use.
+ * @return The new SeekableAudioStream (or 0 on failure).
+ */
+SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream,
+ int rate, byte flags,
+ DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
+
+/**
+ * Creates an audio stream, which plays from the given stream.
+ *
+ * @param stream Stream object to play from.
+ * @param blockList List of blocks to play.
+ * @see RawDiskStreamAudioBlock
+ * @see RawStreamBlockList
+ * @param rate Rate of the sound data.
+ * @param flags Audio flags combination.
+ * @see RawFlags
+ * @param disposeAfterUse Whether to delete the stream after use.
+ * @return The new SeekableAudioStream (or 0 on failure).
+ */
+SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream,
+ const RawStreamBlockList &blockList,
+ int rate,
+ byte flags,
+ DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
+
+/**
+ * NOTE:
+ * This API is considered deprecated.
+ *
* Creates a audio stream, which plays from given stream.
*
* @param stream Stream to play from
@@ -125,11 +163,11 @@ typedef Common::List<RawDiskStreamAudioBlock> RawStreamBlockList;
* @param numBlocks Number of blocks.
* @param rate The rate
* @param flags Flags combination.
- * @see Mixer::RawFlags
+ * @see RawFlags
* @param disposeStream Whether the "stream" object should be destroyed after playback.
* @return The new SeekableAudioStream (or 0 on failure).
*/
-SeekableAudioStream *makeRawDiskStream(Common::SeekableReadStream *stream,
+SeekableAudioStream *makeRawDiskStream_OLD(Common::SeekableReadStream *stream,
RawDiskStreamAudioBlock *block, int numBlocks,
int rate, byte flags,
DisposeAfterUse::Flag disposeStream);