aboutsummaryrefslogtreecommitdiff
path: root/audio/decoders/raw.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2015-08-11 22:33:54 -0400
committerMatthew Hoops2015-08-30 19:53:54 -0400
commit3aa9e2c5816aad20aa18e04d3a6644a8f79a4e29 (patch)
tree9e5452066adffd15e60849ff534cb4d048d793d0 /audio/decoders/raw.cpp
parenta64aff02878eaaeda3a014cbfc71daf760000136 (diff)
downloadscummvm-rg350-3aa9e2c5816aad20aa18e04d3a6644a8f79a4e29.tar.gz
scummvm-rg350-3aa9e2c5816aad20aa18e04d3a6644a8f79a4e29.tar.bz2
scummvm-rg350-3aa9e2c5816aad20aa18e04d3a6644a8f79a4e29.zip
AUDIO: Add a packetized version of the PCM stream
Diffstat (limited to 'audio/decoders/raw.cpp')
-rw-r--r--audio/decoders/raw.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/audio/decoders/raw.cpp b/audio/decoders/raw.cpp
index 9a9f79092a..477a8e7967 100644
--- a/audio/decoders/raw.cpp
+++ b/audio/decoders/raw.cpp
@@ -221,4 +221,24 @@ SeekableAudioStream *makeRawStream(const byte *buffer, uint32 size,
return makeRawStream(new Common::MemoryReadStream(buffer, size, disposeAfterUse), rate, flags, DisposeAfterUse::YES);
}
+class PacketizedRawStream : public StatelessPacketizedAudioStream {
+public:
+ PacketizedRawStream(int rate, byte flags) :
+ StatelessPacketizedAudioStream(rate, ((flags & FLAG_STEREO) != 0) ? 2 : 1), _flags(flags) {}
+
+protected:
+ AudioStream *makeStream(Common::SeekableReadStream *data);
+
+private:
+ byte _flags;
+};
+
+AudioStream *PacketizedRawStream::makeStream(Common::SeekableReadStream *data) {
+ return makeRawStream(data, getRate(), _flags);
+}
+
+PacketizedAudioStream *makePacketizedRawStream(int rate, byte flags) {
+ return new PacketizedRawStream(rate, flags);
+}
+
} // End of namespace Audio