Public Types

deSpeaker Class Reference

Speaker Class. More...

#include <deSpeaker.h>

Inheritance diagram for deSpeaker:
deResource deObject

List of all members.

Public Types

enum  eSpeakerType { estPoint, estDirected }
enum  pPlayState { epsStopped, epsPlaying, epsPaused }

Public Member Functions

Constructors and Destructors
 deSpeaker (deSpeakerManager *manager)
 Creates a new speaker object.
virtual ~deSpeaker ()
 Cleans up the speaker object.
Management
deResourceGetParent () const
 Retrieves the parent resource.
void SetParent (deResource *parent)
 Sets the parent resource.
int GetType () const
 Retrieves the type of the speaker.
void SetType (int type)
 Sets the type of the speaker.
deSoundGetSound () const
 Retrieves the sound or NULL if not set.
void SetSound (deSound *sound)
 Sets the sound or NULL if not set.
const decDVectorGetPosition () const
 Retrieves the position.
void SetPosition (const decDVector &position)
 Sets the position.
const decQuaternionGetOrientation () const
 Retrieves the orientation.
void SetOrientation (const decQuaternion &orientation)
 Sets the orientation.
const decVectorGetVelocity () const
 Retrieves the velocity in m/s.
void SetVelocity (const decVector &velocity)
 Sets the velocity in m/s.
bool GetMuted () const
 Determines if the speaker is muted.
void SetMuted (bool muted)
 Sets if the speaker is muted.
bool GetLooping () const
 Determines if the speaker is playing once or is looping.
void SetLooping (bool looping)
 Sets if the speaker is playing once or is looping.
float GetPlayFrom () const
 Retrieves the start play position.
float GetPlayTo () const
 Retrieves the end play position.
void SetPlayPosition (float playFrom, float playTo)
 Sets the play position.
float GetPlaySpeed () const
 Retrieves the play speed.
void SetPlaySpeed (float playSpeed)
 Sets the play speed.
float GetVolume () const
 Retrieves the volume.
void SetVolume (float volume)
 Sets the volume.
int GetPlayState () const
 Retrieves the play state.
bool GetPlaying () const
 Determines if the speaker is playing.
bool GetPaused () const
 Determines if the speaker is paused.
bool GetStopped () const
 Determines if the speaker is stopped.
void SetPlayState (int playState)
 Sets if the play state.
void Play ()
 Starts playing.
void Stop ()
 Stops playing.
void Pause ()
 Pauses playing.
deBaseSoundDecoderGetDecoder () const
 Retrieves the sound decoder or NULL if non-streaming.
bool IsValidParent (deResource *parent) const
 Determines if the given resource is a valid parent.
System Peers
deBaseAudioSpeakerGetAudioSpeaker () const
 Retrieves the audio system peer object.
void SetAudioSpeaker (deBaseAudioSpeaker *audSpeaker)
 Sets the audio system peer object.

Detailed Description

Speaker Class.

Defines a sound or music emmiting source in a world similar to a speaker. Every speaker can play a sound file once or in a loop multiple times as well as music. To avoid a lot of adding and removing of speakers they can be muted individually preventing them from emitting sound or music without removing them. Speakers usually act like a point source emitting sound in all directions. Optionally the speaker can be set to be directed like a spot light emitting sound only in one direction.

Sound sources can be of streaming or non-streaming type. If a non-streaming sound is attached the data is taken from the shared buffer inside the sound object. If the sound is a streaming sound a Sound Decoder is created to retrieve sound samples from the file. The Sound Decoder operates on the file specified in the sound object.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Member Enumeration Documentation

Enumerator:
estPoint 
estDirected 
Enumerator:
epsStopped 
epsPlaying 
epsPaused 

Constructor & Destructor Documentation

deSpeaker::deSpeaker ( deSpeakerManager manager )

Creates a new speaker object.

virtual deSpeaker::~deSpeaker (  ) [virtual]

Cleans up the speaker object.


Member Function Documentation

deBaseAudioSpeaker* deSpeaker::GetAudioSpeaker (  ) const [inline]

Retrieves the audio system peer object.

deBaseSoundDecoder* deSpeaker::GetDecoder (  ) const [inline]

Retrieves the sound decoder or NULL if non-streaming.

bool deSpeaker::GetLooping (  ) const [inline]

Determines if the speaker is playing once or is looping.

bool deSpeaker::GetMuted (  ) const [inline]

Determines if the speaker is muted.

const decQuaternion& deSpeaker::GetOrientation (  ) const [inline]

Retrieves the orientation.

deResource* deSpeaker::GetParent (  ) const [inline]

Retrieves the parent resource.

bool deSpeaker::GetPaused (  ) const [inline]

Determines if the speaker is paused.

References epsPaused.

float deSpeaker::GetPlayFrom (  ) const [inline]

Retrieves the start play position.

bool deSpeaker::GetPlaying (  ) const [inline]

Determines if the speaker is playing.

References epsPlaying.

float deSpeaker::GetPlaySpeed (  ) const [inline]

Retrieves the play speed.

int deSpeaker::GetPlayState (  ) const [inline]

Retrieves the play state.

float deSpeaker::GetPlayTo (  ) const [inline]

Retrieves the end play position.

const decDVector& deSpeaker::GetPosition (  ) const [inline]

Retrieves the position.

deSound* deSpeaker::GetSound (  ) const [inline]

Retrieves the sound or NULL if not set.

bool deSpeaker::GetStopped (  ) const [inline]

Determines if the speaker is stopped.

References epsStopped.

int deSpeaker::GetType (  ) const [inline]

Retrieves the type of the speaker.

const decVector& deSpeaker::GetVelocity (  ) const [inline]

Retrieves the velocity in m/s.

float deSpeaker::GetVolume (  ) const [inline]

Retrieves the volume.

bool deSpeaker::IsValidParent ( deResource parent ) const

Determines if the given resource is a valid parent.

void deSpeaker::Pause (  )

Pauses playing.

void deSpeaker::Play (  )

Starts playing.

void deSpeaker::SetAudioSpeaker ( deBaseAudioSpeaker audSpeaker )

Sets the audio system peer object.

void deSpeaker::SetLooping ( bool  looping )

Sets if the speaker is playing once or is looping.

void deSpeaker::SetMuted ( bool  muted )

Sets if the speaker is muted.

void deSpeaker::SetOrientation ( const decQuaternion orientation )

Sets the orientation.

void deSpeaker::SetParent ( deResource parent )

Sets the parent resource.

void deSpeaker::SetPlayPosition ( float  playFrom,
float  playTo 
)

Sets the play position.

void deSpeaker::SetPlaySpeed ( float  playSpeed )

Sets the play speed.

void deSpeaker::SetPlayState ( int  playState )

Sets if the play state.

void deSpeaker::SetPosition ( const decDVector position )

Sets the position.

void deSpeaker::SetSound ( deSound sound )

Sets the sound or NULL if not set.

void deSpeaker::SetType ( int  type )

Sets the type of the speaker.

void deSpeaker::SetVelocity ( const decVector velocity )

Sets the velocity in m/s.

void deSpeaker::SetVolume ( float  volume )

Sets the volume.

void deSpeaker::Stop (  )

Stops playing.


The documentation for this class was generated from the following file: