Drag[en]gine Game Engine  1.0
deSpeaker Class Reference

Speaker resource. More...

#include <deSpeaker.h>

Inheritance diagram for deSpeaker:
deResource deObject

Public Types

enum  ePlayStates { epsStopped, epsPlaying, epsPaused }
 Play states. More...
 
enum  eSpeakerType { estPoint, estDirected }
 Speaker type. More...
 

Public Member Functions

Management
eSpeakerType GetType () const
 Type. More...
 
void SetType (eSpeakerType type)
 Set type. More...
 
deSoundGetSound () const
 Sound or NULL if not set. More...
 
void SetSound (deSound *sound)
 Set sound or NULL if not set. More...
 
deSynthesizerInstanceGetSynthesizer () const
 Synthesizer or NULL if not set. More...
 
void SetSynthesizer (deSynthesizerInstance *synthesizer)
 Set synthesizer or NULL if not set. More...
 
const decDVectorGetPosition () const
 Position. More...
 
void SetPosition (const decDVector &position)
 Set position. More...
 
const decQuaternionGetOrientation () const
 Orientation. More...
 
void SetOrientation (const decQuaternion &orientation)
 Set orientation. More...
 
const decVectorGetVelocity () const
 Velocity in m/s. More...
 
void SetVelocity (const decVector &velocity)
 Set velocity in m/s. More...
 
bool GetMuted () const
 Speaker is muted. More...
 
void SetMuted (bool muted)
 Set if speaker is muted. More...
 
bool GetLooping () const
 Speaker is playing once or is looping. More...
 
void SetLooping (bool looping)
 Set if speaker is playing once or is looping. More...
 
int GetPlayFrom () const
 Start play position in samples. More...
 
int GetPlayTo () const
 End play position in samples. More...
 
void SetPlayPosition (int playFrom, int playTo)
 Set play position in samples. More...
 
float GetPlaySpeed () const
 Play speed. More...
 
void SetPlaySpeed (float playSpeed)
 Set play speed. More...
 
float GetVolume () const
 Volume. More...
 
void SetVolume (float volume)
 Set volume. More...
 
float GetRange () const
 Range beyond which the sound is inaudible. More...
 
void SetRange (float range)
 Set range beyond which the sound is inaudible. More...
 
float GetHalfVolumeDistance () const
 Half volume distance relative to the range. More...
 
void SetHalfVolumeDistance (float halfVolumeDistance)
 Set half volume distance relative to the range. More...
 
ePlayStates GetPlayState () const
 Play state. More...
 
bool GetPlaying () const
 Speaker is playing. More...
 
bool GetPaused () const
 Speaker is paused. More...
 
bool GetStopped () const
 Speaker is stopped. More...
 
void SetPlayState (ePlayStates playState)
 Set play state. More...
 
void Play ()
 Start playing. More...
 
void Stop ()
 Stop playing. More...
 
void Pause ()
 Pause playing. More...
 
deBaseSoundDecoderGetDecoder () const
 Sound decoder or NULL if non-streaming. More...
 
System Peers
deBaseAudioSpeakerGetAudioSpeaker () const
 Audio system peer or NULL if not set. More...
 
void SetAudioSpeaker (deBaseAudioSpeaker *audSpeaker)
 Set audio system peer or NULL if not set. More...
 
Linked list world
deWorldGetParentWorld () const
 Parent world or NULL. More...
 
void SetParentWorld (deWorld *world)
 Set parent world or NULL. More...
 
deSpeakerGetLLWorldPrev () const
 Previous speaker in the parent world linked list. More...
 
void SetLLWorldPrev (deSpeaker *speaker)
 Set next speaker in the parent world linked list. More...
 
deSpeakerGetLLWorldNext () const
 Next speaker in the parent world linked list. More...
 
void SetLLWorldNext (deSpeaker *speaker)
 Set next speaker in the parent world linked list. More...
 
Linked list microphone
deMicrophoneGetParentMicrophone () const
 Parent microphone or NULL. More...
 
void SetParentMicrophone (deMicrophone *microphone)
 Set parent microphone or NULL. More...
 
deSpeakerGetLLMicrophonePrev () const
 Previous speaker in the parent microphone linked list. More...
 
void SetLLMicrophonePrev (deSpeaker *speaker)
 Set next speaker in the parent microphone linked list. More...
 
deSpeakerGetLLMicrophoneNext () const
 Next speaker in the parent microphone linked list. More...
 
void SetLLMicrophoneNext (deSpeaker *speaker)
 Set next speaker in the parent microphone linked list. More...
 
- Public Member Functions inherited from deResource
deResourceManagerGetResourceManager () const
 Resource manager or NULL if resource is leaking. More...
 
deEngineGetEngine () const
 Game engine object from resource manager. More...
 
deResourceGetLLManagerPrev () const
 Previous resource in the resource manager linked list. More...
 
void SetLLManagerPrev (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
deResourceGetLLManagerNext () const
 Next resource in the resource manager linked list. More...
 
void SetLLManagerNext (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
void MarkLeaking ()
 Marks the resource leaking. More...
 
 deResource (deResourceManager *resourceManager)
 Create resource. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Constructors and Destructors

 deSpeaker (deSpeakerManager *manager)
 Create speaker. More...
 
virtual ~deSpeaker ()
 Clean up speaker object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deResource
virtual ~deResource ()
 Clean up resource. More...
 
- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Speaker resource.

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

◆ ePlayStates

Play states.

Enumerator
epsStopped 

Speaker is not playing back.

epsPlaying 

Speaker is playing back.

epsPaused 

Playback is paused.

◆ eSpeakerType

Speaker type.

Enumerator
estPoint 

Speaker emits equally in all directions.

estDirected 

Speaker emits conically along Z axis.

Constructor & Destructor Documentation

◆ deSpeaker()

deSpeaker::deSpeaker ( deSpeakerManager manager)

Create speaker.

◆ ~deSpeaker()

virtual deSpeaker::~deSpeaker ( )
protectedvirtual

Clean up speaker object.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ GetAudioSpeaker()

deBaseAudioSpeaker* deSpeaker::GetAudioSpeaker ( ) const
inline

Audio system peer or NULL if not set.

References SetAudioSpeaker().

◆ GetDecoder()

deBaseSoundDecoder* deSpeaker::GetDecoder ( ) const
inline

Sound decoder or NULL if non-streaming.

◆ GetHalfVolumeDistance()

float deSpeaker::GetHalfVolumeDistance ( ) const
inline

Half volume distance relative to the range.

References SetHalfVolumeDistance().

◆ GetLLMicrophoneNext()

deSpeaker* deSpeaker::GetLLMicrophoneNext ( ) const
inline

Next speaker in the parent microphone linked list.

References SetLLMicrophoneNext().

◆ GetLLMicrophonePrev()

deSpeaker* deSpeaker::GetLLMicrophonePrev ( ) const
inline

Previous speaker in the parent microphone linked list.

References SetLLMicrophonePrev().

◆ GetLLWorldNext()

deSpeaker* deSpeaker::GetLLWorldNext ( ) const
inline

Next speaker in the parent world linked list.

References SetLLWorldNext().

◆ GetLLWorldPrev()

deSpeaker* deSpeaker::GetLLWorldPrev ( ) const
inline

Previous speaker in the parent world linked list.

References SetLLWorldPrev().

◆ GetLooping()

bool deSpeaker::GetLooping ( ) const
inline

Speaker is playing once or is looping.

References SetLooping().

◆ GetMuted()

bool deSpeaker::GetMuted ( ) const
inline

Speaker is muted.

References SetMuted().

◆ GetOrientation()

const decQuaternion& deSpeaker::GetOrientation ( ) const
inline

Orientation.

References SetOrientation().

◆ GetParentMicrophone()

deMicrophone* deSpeaker::GetParentMicrophone ( ) const
inline

Parent microphone or NULL.

References SetParentMicrophone().

◆ GetParentWorld()

deWorld* deSpeaker::GetParentWorld ( ) const
inline

Parent world or NULL.

References SetParentWorld().

◆ GetPaused()

bool deSpeaker::GetPaused ( ) const
inline

Speaker is paused.

References epsPaused.

◆ GetPlayFrom()

int deSpeaker::GetPlayFrom ( ) const
inline

Start play position in samples.

◆ GetPlaying()

bool deSpeaker::GetPlaying ( ) const
inline

Speaker is playing.

References epsPlaying.

◆ GetPlaySpeed()

float deSpeaker::GetPlaySpeed ( ) const
inline

Play speed.

References SetPlaySpeed().

◆ GetPlayState()

ePlayStates deSpeaker::GetPlayState ( ) const
inline

Play state.

◆ GetPlayTo()

int deSpeaker::GetPlayTo ( ) const
inline

End play position in samples.

References SetPlayPosition().

◆ GetPosition()

const decDVector& deSpeaker::GetPosition ( ) const
inline

Position.

References SetPosition().

◆ GetRange()

float deSpeaker::GetRange ( ) const
inline

Range beyond which the sound is inaudible.

References SetRange().

◆ GetSound()

deSound* deSpeaker::GetSound ( ) const
inline

Sound or NULL if not set.

References SetSound().

◆ GetStopped()

bool deSpeaker::GetStopped ( ) const
inline

Speaker is stopped.

References epsStopped, Pause(), Play(), SetPlayState(), and Stop().

◆ GetSynthesizer()

deSynthesizerInstance* deSpeaker::GetSynthesizer ( ) const
inline

Synthesizer or NULL if not set.

References SetSynthesizer().

◆ GetType()

eSpeakerType deSpeaker::GetType ( ) const
inline

Type.

References SetType().

◆ GetVelocity()

const decVector& deSpeaker::GetVelocity ( ) const
inline

Velocity in m/s.

References SetVelocity().

◆ GetVolume()

float deSpeaker::GetVolume ( ) const
inline

Volume.

References SetVolume().

◆ Pause()

void deSpeaker::Pause ( )

Pause playing.

Referenced by GetStopped().

◆ Play()

void deSpeaker::Play ( )

Start playing.

Referenced by GetStopped().

◆ SetAudioSpeaker()

void deSpeaker::SetAudioSpeaker ( deBaseAudioSpeaker audSpeaker)

Set audio system peer or NULL if not set.

Referenced by GetAudioSpeaker().

◆ SetHalfVolumeDistance()

void deSpeaker::SetHalfVolumeDistance ( float  halfVolumeDistance)

Set half volume distance relative to the range.

Referenced by GetHalfVolumeDistance().

◆ SetLLMicrophoneNext()

void deSpeaker::SetLLMicrophoneNext ( deSpeaker speaker)

Set next speaker in the parent microphone linked list.

Referenced by GetLLMicrophoneNext().

◆ SetLLMicrophonePrev()

void deSpeaker::SetLLMicrophonePrev ( deSpeaker speaker)

Set next speaker in the parent microphone linked list.

Referenced by GetLLMicrophonePrev().

◆ SetLLWorldNext()

void deSpeaker::SetLLWorldNext ( deSpeaker speaker)

Set next speaker in the parent world linked list.

Referenced by GetLLWorldNext().

◆ SetLLWorldPrev()

void deSpeaker::SetLLWorldPrev ( deSpeaker speaker)

Set next speaker in the parent world linked list.

Referenced by GetLLWorldPrev().

◆ SetLooping()

void deSpeaker::SetLooping ( bool  looping)

Set if speaker is playing once or is looping.

Referenced by GetLooping().

◆ SetMuted()

void deSpeaker::SetMuted ( bool  muted)

Set if speaker is muted.

Referenced by GetMuted().

◆ SetOrientation()

void deSpeaker::SetOrientation ( const decQuaternion orientation)

Set orientation.

Referenced by GetOrientation().

◆ SetParentMicrophone()

void deSpeaker::SetParentMicrophone ( deMicrophone microphone)

Set parent microphone or NULL.

Referenced by GetParentMicrophone().

◆ SetParentWorld()

void deSpeaker::SetParentWorld ( deWorld world)

Set parent world or NULL.

Referenced by GetParentWorld().

◆ SetPlayPosition()

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

Set play position in samples.

Referenced by GetPlayTo().

◆ SetPlaySpeed()

void deSpeaker::SetPlaySpeed ( float  playSpeed)

Set play speed.

Referenced by GetPlaySpeed().

◆ SetPlayState()

void deSpeaker::SetPlayState ( ePlayStates  playState)

Set play state.

Referenced by GetStopped().

◆ SetPosition()

void deSpeaker::SetPosition ( const decDVector position)

Set position.

Referenced by GetPosition().

◆ SetRange()

void deSpeaker::SetRange ( float  range)

Set range beyond which the sound is inaudible.

Referenced by GetRange().

◆ SetSound()

void deSpeaker::SetSound ( deSound sound)

Set sound or NULL if not set.

Referenced by GetSound().

◆ SetSynthesizer()

void deSpeaker::SetSynthesizer ( deSynthesizerInstance synthesizer)

Set synthesizer or NULL if not set.

Referenced by GetSynthesizer().

◆ SetType()

void deSpeaker::SetType ( eSpeakerType  type)

Set type.

Referenced by GetType().

◆ SetVelocity()

void deSpeaker::SetVelocity ( const decVector velocity)

Set velocity in m/s.

Referenced by GetVelocity().

◆ SetVolume()

void deSpeaker::SetVolume ( float  volume)

Set volume.

Referenced by GetVolume().

◆ Stop()

void deSpeaker::Stop ( )

Stop playing.

Referenced by GetStopped().


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