diff --git a/sound/decoders/raw.cpp b/sound/decoders/raw.cpp index 5279653db81..addad0a2535 100644 --- a/sound/decoders/raw.cpp +++ b/sound/decoders/raw.cpp @@ -42,7 +42,7 @@ namespace Audio { #pragma mark - -#pragma mark --- RawAudioStream --- +#pragma mark --- RawStream --- #pragma mark - /** @@ -50,7 +50,7 @@ namespace Audio { * It also features playback of multiple blocks from a given stream. */ template -class RawAudioStream : public SeekableAudioStream { +class RawStream : public SeekableAudioStream { // Allow backends to override buffer size #ifdef CUSTOM_AUDIO_BUFFER_SIZE @@ -69,12 +69,12 @@ protected: int32 _filePos; ///< Current position in stream int32 _diskLeft; ///< Samples left in stream in current block not yet read to buffer int32 _bufferLeft; ///< Samples left in buffer in current block - const DisposeAfterUse::Flag _disposeAfterUse; ///< Indicates whether the stream object should be deleted when this RawAudioStream is destructed + const DisposeAfterUse::Flag _disposeAfterUse; ///< Indicates whether the stream object should be deleted when this RawStream is destructed const RawStreamBlockList _blocks; ///< Audio block list RawStreamBlockList::const_iterator _curBlock; ///< Current audio block number public: - RawAudioStream(int rate, DisposeAfterUse::Flag disposeStream, Common::SeekableReadStream *stream, const RawStreamBlockList &blocks) + RawStream(int rate, DisposeAfterUse::Flag disposeStream, Common::SeekableReadStream *stream, const RawStreamBlockList &blocks) : _rate(rate), _playtime(0, rate), _stream(stream), _disposeAfterUse(disposeStream), _blocks(blocks), _curBlock(_blocks.begin()) { assert(_blocks.size() > 0); @@ -103,7 +103,7 @@ public: } - virtual ~RawAudioStream() { + virtual ~RawStream() { if (_disposeAfterUse == DisposeAfterUse::YES) delete _stream; @@ -122,7 +122,7 @@ public: }; template -int RawAudioStream::readBuffer(int16 *buffer, const int numSamples) { +int RawStream::readBuffer(int16 *buffer, const int numSamples) { int oldPos = _stream->pos(); bool restoreFilePosition = false; @@ -184,7 +184,7 @@ int RawAudioStream::readBuffer(int16 *buffer, } template -bool RawAudioStream::seek(const Timestamp &where) { +bool RawStream::seek(const Timestamp &where) { const uint32 seekSample = convertTimeToStreamPos(where, getRate(), isStereo()).totalNumberOfFrames(); uint32 curSample = 0; @@ -230,11 +230,11 @@ bool RawAudioStream::seek(const Timestamp &wh #define MAKE_LINEAR_DISK(STEREO, UNSIGNED) \ if (is16Bit) { \ if (isLE) \ - return new RawAudioStream(rate, disposeAfterUse, stream, blockList); \ + return new RawStream(rate, disposeAfterUse, stream, blockList); \ else \ - return new RawAudioStream(rate, disposeAfterUse, stream, blockList); \ + return new RawStream(rate, disposeAfterUse, stream, blockList); \ } else \ - return new RawAudioStream(rate, disposeAfterUse, stream, blockList) + return new RawStream(rate, disposeAfterUse, stream, blockList) SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream, const RawStreamBlockList &blockList, @@ -272,7 +272,7 @@ SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream, int rate, byte flags, DisposeAfterUse::Flag disposeAfterUse) { RawStreamBlockList blocks; - RawAudioStreamBlock block; + RawStreamBlock block; block.pos = 0; const bool isStereo = (flags & Audio::FLAG_STEREO) != 0; @@ -292,8 +292,8 @@ SeekableAudioStream *makeRawStream(const byte *buffer, uint32 size, return makeRawStream(new Common::MemoryReadStream(buffer, size, disposeAfterUse), rate, flags, DisposeAfterUse::YES); } -SeekableAudioStream *makeRawDiskStream_OLD(Common::SeekableReadStream *stream, RawAudioStreamBlock *block, int numBlocks, - int rate, byte flags, DisposeAfterUse::Flag disposeStream) { +SeekableAudioStream *makeRawDiskStream_OLD(Common::SeekableReadStream *stream, RawStreamBlock *block, int numBlocks, + int rate, byte flags, DisposeAfterUse::Flag disposeStream) { assert(numBlocks > 0); RawStreamBlockList blocks; for (int i = 0; i < numBlocks; ++i) diff --git a/sound/decoders/raw.h b/sound/decoders/raw.h index 5ef3204392a..edbb108de7c 100644 --- a/sound/decoders/raw.h +++ b/sound/decoders/raw.h @@ -65,18 +65,18 @@ enum RawFlags { /** - * Struct used to define the audio data to be played by a RawAudioStream. + * Struct used to define the audio data to be played by a RawStream. */ -struct RawAudioStreamBlock { +struct RawStreamBlock { int32 pos; ///< Position in stream of the block (in bytes of course!) int32 len; ///< Length of the block (in sample (pairs)) }; /** * List containing all blocks of a raw stream. - * @see RawAudioStreamBlock + * @see RawStreamBlock */ -typedef Common::List RawStreamBlockList; +typedef Common::List RawStreamBlockList; /** * Creates an audio stream, which plays from the given buffer. @@ -133,8 +133,8 @@ SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream, * Creates a audio stream, which plays from given stream. * * @param stream Stream to play from - * @param block Pointer to an RawAudioStreamBlock array - * @see RawAudioStreamBlock + * @param block Pointer to an RawStreamBlock array + * @see RawStreamBlock * @param numBlocks Number of blocks. * @param rate The rate * @param flags Flags combination. @@ -143,7 +143,7 @@ SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream, * @return The new SeekableAudioStream (or 0 on failure). */ SeekableAudioStream *makeRawDiskStream_OLD(Common::SeekableReadStream *stream, - RawAudioStreamBlock *block, int numBlocks, + RawStreamBlock *block, int numBlocks, int rate, byte flags, DisposeAfterUse::Flag disposeStream); diff --git a/sound/decoders/voc.cpp b/sound/decoders/voc.cpp index 65d594d96ff..9acc4430d9f 100644 --- a/sound/decoders/voc.cpp +++ b/sound/decoders/voc.cpp @@ -180,7 +180,7 @@ byte *loadVOCFromStream(Common::ReadStream &stream, int &size, int &rate) { #ifdef STREAM_AUDIO_FROM_DISK -int parseVOCFormat(Common::SeekableReadStream& stream, RawDiskStreamAudioBlock* block, int &rate, int &loops, int &begin_loop, int &end_loop) { +int parseVOCFormat(Common::SeekableReadStream& stream, RawStreamBlock* block, int &rate, int &loops, int &begin_loop, int &end_loop) { VocFileHeader fileHeader; int currentBlock = 0; int size = 0; @@ -302,7 +302,7 @@ int parseVOCFormat(Common::SeekableReadStream& stream, RawDiskStreamAudioBlock* AudioStream *makeVOCDiskStream(Common::SeekableReadStream &stream, byte flags, DisposeAfterUse::Flag takeOwnership) { const int MAX_AUDIO_BLOCKS = 256; - RawDiskStreamAudioBlock *block = new RawDiskStreamAudioBlock[MAX_AUDIO_BLOCKS]; + RawStreamBlock *block = new RawStreamBlock[MAX_AUDIO_BLOCKS]; int rate, loops, begin_loop, end_loop; int numBlocks = parseVOCFormat(stream, block, rate, loops, begin_loop, end_loop); @@ -322,7 +322,7 @@ AudioStream *makeVOCDiskStream(Common::SeekableReadStream &stream, byte flags, D SeekableAudioStream *makeVOCDiskStreamNoLoop(Common::SeekableReadStream &stream, byte flags, DisposeAfterUse::Flag takeOwnership) { const int MAX_AUDIO_BLOCKS = 256; - RawDiskStreamAudioBlock *block = new RawDiskStreamAudioBlock[MAX_AUDIO_BLOCKS]; + RawStreamBlock *block = new RawStreamBlock[MAX_AUDIO_BLOCKS]; int rate, loops, begin_loop, end_loop; int numBlocks = parseVOCFormat(stream, block, rate, loops, begin_loop, end_loop);