Torque3D Documentation / _generateds / SFXInternal::SFXWrapAroundBuffer

SFXInternal::SFXWrapAroundBuffer

Engine/source/sfx/sfxInternal.h

Buffer that uses wrap-around packet buffering.

More...

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

bool
_copyData(U32 offset, const U8 * data, U32 length)

Copy "length" bytes from "data" into the device at "offset".

Flush all queue state for this buffer on the device.

getSamplePos(U32 bufferOffset)
write(SFXStreamPacket *const * packets, U32 num)

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)

return:

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