Speaker Class. More...
#include <deSpeaker.h>
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 | |
| deResource * | GetParent () 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. | |
| deSound * | GetSound () const |
| Retrieves the sound or NULL if not set. | |
| void | SetSound (deSound *sound) |
| Sets the sound or NULL if not set. | |
| const decDVector & | GetPosition () const |
| Retrieves the position. | |
| void | SetPosition (const decDVector &position) |
| Sets the position. | |
| const decQuaternion & | GetOrientation () const |
| Retrieves the orientation. | |
| void | SetOrientation (const decQuaternion &orientation) |
| Sets the orientation. | |
| const decVector & | GetVelocity () 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. | |
| deBaseSoundDecoder * | GetDecoder () 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 | |
| deBaseAudioSpeaker * | GetAudioSpeaker () const |
| Retrieves the audio system peer object. | |
| void | SetAudioSpeaker (deBaseAudioSpeaker *audSpeaker) |
| Sets the audio system peer object. | |
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.
| deSpeaker::deSpeaker | ( | deSpeakerManager * | manager ) |
Creates a new speaker object.
| virtual deSpeaker::~deSpeaker | ( | ) | [virtual] |
Cleans up the speaker object.
| 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.
1.7.2