SFXInternal::SFXWrapAroundBuffer
Engine/source/sfx/sfxInternal.h
Buffer that uses wrap-around packet buffering.
Public Types
Parent
Protected Attributes
Size of the device buffer in bytes.
Absolute byte offset into the sound stream that the next packet write will occur at.
Protected Functions
Public Functions
SFXWrapAroundBuffer(const ThreadSafeRef< SFXStream > & stream, SFXDescription * description)
SFXWrapAroundBuffer(SFXDescription * description)
Detailed Description
Buffer that uses wrap-around packet buffering.
This class automatically coordinates retrieval and submitting of sound packets and also protects against play cursors running beyond the last packet by making sure some silence is submitted after the last packet (does not count towards playback time).
note:Note that the reaction times of this class depend on the SFXDevice triggering timely SFXBuffer:update() calls.
Public Types
typedef SFXBuffer Parent
Protected Attributes
U32 mBufferSize
Size of the device buffer in bytes.
U32 mWriteOffset
Absolute byte offset into the sound stream that the next packet write will occur at.
This is not an offset into the device buffer in order to allow us to track how far in the source stream we are.
Protected Functions
_copyData(U32 offset, const U8 * data, U32 length)
Copy "length" bytes from "data" into the device at "offset".
Reimplemented by: SFXDSBuffer, SFXFMODBuffer
_flush()
Reimplemented from: SFXBuffer
Reimplemented by: SFXDSBuffer, SFXFMODBuffer
getSamplePos(U32 bufferOffset)
the sample position in the sound stream as determined from the given buffer offset.
write(SFXStreamPacket *const * packets, U32 num)
Public Functions
SFXWrapAroundBuffer(const ThreadSafeRef< SFXStream > & stream, SFXDescription * description)
SFXWrapAroundBuffer(SFXDescription * description)
getMemoryUsed()
Reimplemented from: SFXBuffer
Reimplemented by: SFXFMODBuffer