SFXSound

Engine/source/sfx/sfxSound.h

A scriptable controller playing a specific single sound file.

More...

Private Types

Parent 

Public Friends

class

Protected Attributes

The reference counted device specific buffer used by the voice for playback.

The duration of the sound cached from the buffer in _initBuffer() used for managing virtual sources.

Used for setPosition (time in miliseconds)

The device specific voice which is used during playback.

Protected Static Functions

_create(SFXDevice * device, const ThreadSafeRef< SFXStream > & stream, SFXDescription * description)
_create(SFXDevice * device, SFXProfile * profile)

Used by SFXSystem to create sources.

Protected Functions

SFXSound(SFXProfile * profile, SFXDescription * description)

Internal constructor used for sources.

bool

Create a new voice for this source.

Pause playback.

Start playback.

bool

Release the voice if the source has one.

Reload the sound buffer. Temporarily goes to virtualized playback when necessary.

_setCone(F32 innerAngle, F32 outerAngle, F32 outerVolume)

Set 3D cone without affecting CustomConeFlag.

Set 3D min/max distance without affecting CustomRadiusFlag.

Stop playback.

Update the effective pitch of the source.

Update the effective priority of the source.

Update the playback status of the source.

Update the effective volume of the source.

Public Functions

The default constructor is only here to satisfy the construction needs of IMPLEMENT_CONOBJECT.

Returns the source's total playback time in milliseconds.

Return the elapsed play time of the current loop cycle so far in seconds.

Return the current playback position in milliseconds.

Return the SFXProfile datablock attached to this sound.

Return the total play time of the source in seconds.

bool

This is normally called from the system to detect if this source has been assigned a voice for playback.

bool

Return true if the sound stream tied to the source is currently in a buffer underrun situation.

bool

Returns true if the source's associated data is ready for playback.

bool

Returns true if this is a continuously streaming source.

bool

Returns true if the source is currently being virtualized.

Called when a SimObject is deleted.

Called when the object is removed from the sim.

Set the current playback position in milliseconds.

setTransform(const MatrixF & transform)

Sets the position and orientation for a 3d buffer.

Sets the velocity for a 3d buffer.

Public Static Functions

qsortCompare(const void * item1, const void * item2)

Used to sort sources by attenuated volume and channel priority.

Detailed Description

A scriptable controller playing a specific single sound file.

Private Types

typedef SFXSource Parent 

Public Friends

Protected Attributes

StrongWeakRefPtr< SFXBuffer > mBuffer 

The reference counted device specific buffer used by the voice for playback.

U32 mDuration 

The duration of the sound cached from the buffer in _initBuffer() used for managing virtual sources.

U32 mSetPositionValue 

Used for setPosition (time in miliseconds)

StrongWeakRefPtr< SFXVoice > mVoice 

The device specific voice which is used during playback.

By making it a SafePtr it will NULL automatically when the device is deleted.

Protected Static Functions

_create(SFXDevice * device, const ThreadSafeRef< SFXStream > & stream, SFXDescription * description)

_create(SFXDevice * device, SFXProfile * profile)

Used by SFXSystem to create sources.

Protected Functions

SFXSound(SFXProfile * profile, SFXDescription * description)

Internal constructor used for sources.

_allocVoice(SFXDevice * device)

Create a new voice for this source.

_onParameterEvent(SFXParameter * parameter, SFXParameterEvent event)

Reimplemented from: SFXSource

_onProfileChanged(SFXProfile * profile)

_pause()

Reimplemented from: SFXSource

_play()

Reimplemented from: SFXSource

_releaseVoice()

Release the voice if the source has one.

_reloadBuffer()

Reload the sound buffer. Temporarily goes to virtualized playback when necessary.

_setBuffer(SFXBuffer * buffer)

_setCone(F32 innerAngle, F32 outerAngle, F32 outerVolume)

Reimplemented from: SFXSource

_setMinMaxDistance(F32 min, F32 max)

Reimplemented from: SFXSource

_stop()

Reimplemented from: SFXSource

_updatePitch()

Reimplemented from: SFXSource

_updatePriority()

Reimplemented from: SFXSource

_updateStatus()

Reimplemented from: SFXSource

_updateVolume(const MatrixF & listener)

Reimplemented from: SFXSource

Public Functions

SFXSound()

The default constructor is only here to satisfy the construction needs of IMPLEMENT_CONOBJECT.

It does not create a valid source!

DECLARE_CONOBJECT(SFXSound )

getDuration()

Returns the source's total playback time in milliseconds.

getElapsedPlayTimeCurrentCycle()

Reimplemented from: SFXSource

getPosition()

Reimplemented from: IPositionable

getProfile()

Return the SFXProfile datablock attached to this sound.

getTotalPlayTime()

Reimplemented from: SFXSource

hasVoice()

This is normally called from the system to detect if this source has been assigned a voice for playback.

isBlocked()

Return true if the sound stream tied to the source is currently in a buffer underrun situation.

isReady()

Returns true if the source's associated data is ready for playback.

isStreaming()

Returns true if this is a continuously streaming source.

isVirtualized()

Reimplemented from: SFXSource

onDeleteNotify(SimObject * object)

Reimplemented from: SFXSource

onRemove()

Reimplemented from: SFXSource

setPosition(U32 ms)

Reimplemented from: IPositionable

setTransform(const MatrixF & transform)

Reimplemented from: SFXSource

setVelocity(const VectorF & velocity)

Reimplemented from: SFXSource

Public Static Functions

qsortCompare(const void * item1, const void * item2)

Used to sort sources by attenuated volume and channel priority.