SFXXAudioDevice Class Reference

#include <sfxXAudioDevice.h>

Inheritance diagram for SFXXAudioDevice:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 SFXXAudioDevice (SFXProvider *provider, const char *name, IXAudio2 *xaudio, U32 deviceIndex, U32 speakerChannelMask, U32 maxBuffers)
virtual ~SFXXAudioDevice ()
const char * getName () const
 Returns the name of this device.
SFXBuffercreateBuffer (SFXProfile *profile)
 Tries to create a new sound buffer.
SFXVoicecreateVoice (bool is3D, SFXBuffer *buffer)
void deleteVoice (SFXVoice *buffer)
U32 getVoiceCount () const
void update (const SFXListener &listener)
 Called from SFXSystem to do any updates the device may need to make.
void _setOutputMatrix (SFXXAudioVoice *voice)
 Called from the voice when its about to start playback.

Protected Attributes

const StringTableEntry mName
IXAudio2 * mXAudio
 The XAudio engine interface passed on creation from the provider.
X3DAUDIO_HANDLE mX3DAudio
 The X3DAudio instance.
IXAudio2MasteringVoice * mMasterVoice
 The one and only mastering voice.
XAUDIO2_VOICE_DETAILS mMasterVoiceDetails
 The details of the master voice.
X3DAUDIO_LISTENER mListener
 The one listener.
SFXXAudioVoiceVector mVoices
 All the currently allocated voices.
SFXXAudioBufferVector mBuffers
 All the current audio buffers.

Private Types

typedef SFXDevice Parent

Member Typedef Documentation


Constructor & Destructor Documentation

SFXXAudioDevice::SFXXAudioDevice ( SFXProvider provider,
const char *  name,
IXAudio2 *  xaudio,
U32  deviceIndex,
U32  speakerChannelMask,
U32  maxBuffers 
)

virtual SFXXAudioDevice::~SFXXAudioDevice (  )  [virtual]


Member Function Documentation

const char* SFXXAudioDevice::getName (  )  const [inline, virtual]

Returns the name of this device.

Implements SFXDevice.

SFXBuffer* SFXXAudioDevice::createBuffer ( SFXProfile profile  )  [virtual]

Tries to create a new sound buffer.

If creation fails freeing another buffer will usually allow a new one to be created.

Parameters:
is3d True if a 3D sound buffer is desired.
channels The number of sound channels... typically 1 or 2.
frequency The number of samples per second ( a sample includes all channels ).
bitsPerSample The number of bits per sample ( a sample includes all channels ).
dataSize The total size of the buffer in bytes.
Returns:
Returns a new buffer or NULL if one cannot be created.

Implements SFXDevice.

SFXVoice* SFXXAudioDevice::createVoice ( bool  is3D,
SFXBuffer buffer 
) [virtual]

Implements SFXDevice.

void SFXXAudioDevice::deleteVoice ( SFXVoice buffer  )  [virtual]

Implements SFXDevice.

U32 SFXXAudioDevice::getVoiceCount (  )  const [inline, virtual]

Implements SFXDevice.

void SFXXAudioDevice::update ( const SFXListener listener  )  [virtual]

Called from SFXSystem to do any updates the device may need to make.

Implements SFXDevice.

void SFXXAudioDevice::_setOutputMatrix ( SFXXAudioVoice voice  ) 

Called from the voice when its about to start playback.


Member Data Documentation

IXAudio2* SFXXAudioDevice::mXAudio [protected]

The XAudio engine interface passed on creation from the provider.

X3DAUDIO_HANDLE SFXXAudioDevice::mX3DAudio [protected]

The X3DAudio instance.

IXAudio2MasteringVoice* SFXXAudioDevice::mMasterVoice [protected]

The one and only mastering voice.

XAUDIO2_VOICE_DETAILS SFXXAudioDevice::mMasterVoiceDetails [protected]

The details of the master voice.

X3DAUDIO_LISTENER SFXXAudioDevice::mListener [protected]

The one listener.

All the currently allocated voices.

All the current audio buffers.