SFXXAudioVoice Class Reference

#include <sfxXAudioVoice.h>

Inheritance diagram for SFXXAudioVoice:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~SFXXAudioVoice ()
void setPosition (U32 pos)
 Sets the playback sample position.
void setMinMaxDistance (F32 min, F32 max)
 Sets the minimum and maximum distances for 3d falloff.
void play (bool looping)
 Starts playback from the current position.
void pause ()
 Pauses playback.
void stop ()
 Stops playback and moves the position to the start.
SFXStatus getStatus () const
void setVelocity (const VectorF &velocity)
 Sets the velocity for a 3d voice.
void setTransform (const MatrixF &transform)
 Sets the position and orientation for a 3d voice.
void setVolume (F32 volume)
 Sets the volume.
void setPitch (F32 pitch)
 Sets the pitch scale.
void setCone (F32 innerAngle, F32 outerAngle, F32 outerVolume)
 Set sound cone of a 3D sound.
bool is3D () const
 Is this a 3D positional voice.
const X3DAUDIO_EMITTER & getEmitter () const

Static Public Member Functions

static SFXXAudioVoicecreate (IXAudio2 *xaudio, bool is3D, SFXXAudioBuffer *buffer)

Protected Member Functions

 SFXXAudioVoice ()
 This constructor does not create a valid voice.
void STDMETHODCALLTYPE OnStreamEnd ()
void STDMETHODCALLTYPE OnVoiceProcessingPassStart (UINT32 BytesRequired)
void STDMETHODCALLTYPE OnVoiceProcessingPassEnd ()
void STDMETHODCALLTYPE OnBufferEnd (void *bufferContext)
void STDMETHODCALLTYPE OnBufferStart (void *bufferContext)
void STDMETHODCALLTYPE OnLoopEnd (void *bufferContext)
void STDMETHODCALLTYPE OnVoiceError (void *bufferContext, HRESULT error)
void STDMETHODCALLTYPE OnVoiceProcessingPassStart ()

Protected Attributes

SFXXAudioDevicemDevice
 The device that created us.
IXAudio2SourceVoice * mVoice
 The XAudio voice.
SFXXAudioBuffermBuffer
 The buffer we're currently playing.
bool mIs3D
 Used to know what sounds need positional updates.
F32 mPitch
 Since 3D sounds are pitch shifted for doppler effect we need to track the users base pitch.
SFXStatus mStatus
 This is how we track our status.
HANDLE mStopEvent
 This event is tripped by the XAudio thread callback when a source finishes playback.
X3DAUDIO_EMITTER mEmitter
 The cached X3DAudio emitter data.

Friends

class SFXXAudioDevice

Constructor & Destructor Documentation

SFXXAudioVoice::SFXXAudioVoice (  )  [protected]

This constructor does not create a valid voice.

See also:
SFXXAudioVoice::create

virtual SFXXAudioVoice::~SFXXAudioVoice (  )  [virtual]


Member Function Documentation

void STDMETHODCALLTYPE SFXXAudioVoice::OnStreamEnd (  )  [protected]

void STDMETHODCALLTYPE SFXXAudioVoice::OnVoiceProcessingPassStart ( UINT32  BytesRequired  )  [inline, protected]

void STDMETHODCALLTYPE SFXXAudioVoice::OnVoiceProcessingPassEnd (  )  [inline, protected]

void STDMETHODCALLTYPE SFXXAudioVoice::OnBufferEnd ( void bufferContext  )  [inline, protected]

void STDMETHODCALLTYPE SFXXAudioVoice::OnBufferStart ( void bufferContext  )  [inline, protected]

void STDMETHODCALLTYPE SFXXAudioVoice::OnLoopEnd ( void bufferContext  )  [inline, protected]

void STDMETHODCALLTYPE SFXXAudioVoice::OnVoiceError ( void bufferContext,
HRESULT  error 
) [inline, protected]

void STDMETHODCALLTYPE SFXXAudioVoice::OnVoiceProcessingPassStart (  )  [inline, protected]

static SFXXAudioVoice* SFXXAudioVoice::create ( IXAudio2 *  xaudio,
bool  is3D,
SFXXAudioBuffer buffer 
) [static]

void SFXXAudioVoice::setPosition ( U32  pos  )  [virtual]

Sets the playback sample position.

Implements SFXVoice.

void SFXXAudioVoice::setMinMaxDistance ( F32  min,
F32  max 
) [virtual]

Sets the minimum and maximum distances for 3d falloff.

Implements SFXVoice.

void SFXXAudioVoice::play ( bool  looping  )  [virtual]

Starts playback from the current position.

Implements SFXVoice.

void SFXXAudioVoice::pause (  )  [virtual]

Pauses playback.

Implements SFXVoice.

void SFXXAudioVoice::stop (  )  [virtual]

Stops playback and moves the position to the start.

Implements SFXVoice.

SFXStatus SFXXAudioVoice::getStatus (  )  const [virtual]

Implements SFXVoice.

void SFXXAudioVoice::setVelocity ( const VectorF velocity  )  [virtual]

Sets the velocity for a 3d voice.

Implements SFXVoice.

void SFXXAudioVoice::setTransform ( const MatrixF transform  )  [virtual]

Sets the position and orientation for a 3d voice.

Implements SFXVoice.

void SFXXAudioVoice::setVolume ( F32  volume  )  [virtual]

Sets the volume.

Implements SFXVoice.

void SFXXAudioVoice::setPitch ( F32  pitch  )  [virtual]

Sets the pitch scale.

Implements SFXVoice.

void SFXXAudioVoice::setCone ( F32  innerAngle,
F32  outerAngle,
F32  outerVolume 
) [virtual]

Set sound cone of a 3D sound.

Implements SFXVoice.

bool SFXXAudioVoice::is3D (  )  const [inline]

Is this a 3D positional voice.

const X3DAUDIO_EMITTER& SFXXAudioVoice::getEmitter (  )  const [inline]


Friends And Related Function Documentation

friend class SFXXAudioDevice [friend]


Member Data Documentation

The device that created us.

IXAudio2SourceVoice* SFXXAudioVoice::mVoice [protected]

The XAudio voice.

The buffer we're currently playing.

Used to know what sounds need positional updates.

Since 3D sounds are pitch shifted for doppler effect we need to track the users base pitch.

SFXStatus SFXXAudioVoice::mStatus [mutable, protected]

This is how we track our status.

HANDLE SFXXAudioVoice::mStopEvent [protected]

This event is tripped by the XAudio thread callback when a source finishes playback.

X3DAUDIO_EMITTER SFXXAudioVoice::mEmitter [protected]

The cached X3DAudio emitter data.