SoundSourceComponent Class Reference

Component wrapper of SFML's sf::Sound and sf::Music. More...

Inheritance diagram for SoundSourceComponent:

Inheritance graph
[legend]
Collaboration diagram for SoundSourceComponent:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SoundSourceComponent (Entity *parent)
 Constructor.
 ~SoundSourceComponent ()
 Deconstructor.
sf::Sound * getSound ()
 Returns a direct pointer to the sf::Sound object in this component.
sf::Music * getMusic ()
 Returns a direct pointer to the sf::Music object in this component.
bool loadMusic (const std::string &fileName)
 Loads the sound data as a music (streaming) object.
bool loadSoundBuffer (const std::string &bufferName)
 Loads the sound data from a sound buffer.
void unloadData ()
 Unloads previously loaded data.
void play ()
 Plays the associated sound.
void pause ()
 Pauses the associated sound.
void stop ()
 Stops the associated sound.
f32 getAttenuation () const
 Gets the attenuation of the sound.
bool getIsPaused () const
 Returns whether the sound is paused.
bool getIsPlaying () const
 Returns whether the sound is playing.
bool getIsStopped () const
 Returns whether the sound has been stopped.
bool getLoop () const
 Gets the loop state of the sound.
f32 getMinDistance () const
 Gets the minimum distance.
f32 getOffset () const
 Gets the current playing position of the sound.
f32 getPitch () const
 Gets the pitch of the sound.
f32 getVolume () const
 Gets the volume of the sound.
void setAttenuation (f32 attenuation)
 Sets the attenuation factor. The higher the attenuation, the more the sound will be attenuated with distance from listener.
void setLoop (bool value)
 Sets the sound loop state.
void setMinDistance (f32 minDistance)
 Sets the minimum distance. Closer than this distance, the listener will hear the sound at its maximum volume.
void setOffset (f32 offset)
 Sets the current playing position of the sound.
void setPitch (f32 pitch)
 Sets the sound pitch.
void setVolume (f32 volume)
 Sets the sound volume.
void onPositionChange (void *p)
 Updates the position of the component after its parent has been updated.
void onPause (void *p)
 Pauses the component if the parent is paused.
void onUnPause (void *p)
 Unpauses the component if the parent is unpaused.

Static Public Member Functions

static SoundSourceComponentrefFactory (Entity *parent)
 Will be used to instanciate objects of this class.


Detailed Description

Component wrapper of SFML's sf::Sound and sf::Music.

Definition at line 26 of file SoundSourceComponent.h.


Constructor & Destructor Documentation

SoundSourceComponent::SoundSourceComponent ( Entity parent  ) 

Constructor.

Parameters:
parent The parent entity to which the component should be added.

Definition at line 23 of file SoundSourceComponent.cpp.

SoundSourceComponent::~SoundSourceComponent (  ) 

Deconstructor.

Definition at line 43 of file SoundSourceComponent.cpp.


Member Function Documentation

f32 SoundSourceComponent::getAttenuation (  )  const

Gets the attenuation of the sound.

Definition at line 193 of file SoundSourceComponent.cpp.

bool SoundSourceComponent::getIsPaused (  )  const

Returns whether the sound is paused.

Definition at line 199 of file SoundSourceComponent.cpp.

bool SoundSourceComponent::getIsPlaying (  )  const

Returns whether the sound is playing.

Definition at line 217 of file SoundSourceComponent.cpp.

bool SoundSourceComponent::getIsStopped (  )  const

Returns whether the sound has been stopped.

Definition at line 235 of file SoundSourceComponent.cpp.

bool SoundSourceComponent::getLoop (  )  const

Gets the loop state of the sound.

Definition at line 253 of file SoundSourceComponent.cpp.

f32 SoundSourceComponent::getMinDistance (  )  const

Gets the minimum distance.

Definition at line 259 of file SoundSourceComponent.cpp.

sf::Music * SoundSourceComponent::getMusic (  ) 

Returns a direct pointer to the sf::Music object in this component.

Note:
Not available in AngelScript.

Definition at line 68 of file SoundSourceComponent.cpp.

f32 SoundSourceComponent::getOffset (  )  const

Gets the current playing position of the sound.

Note:
Only works when a sound buffer is loaded.

Definition at line 266 of file SoundSourceComponent.cpp.

f32 SoundSourceComponent::getPitch (  )  const

Gets the pitch of the sound.

Definition at line 275 of file SoundSourceComponent.cpp.

sf::Sound * SoundSourceComponent::getSound (  ) 

Returns a direct pointer to the sf::Sound object in this component.

Note:
Not available in AngelScript.

Definition at line 62 of file SoundSourceComponent.cpp.

f32 SoundSourceComponent::getVolume (  )  const

Gets the volume of the sound.

Definition at line 281 of file SoundSourceComponent.cpp.

bool SoundSourceComponent::loadMusic ( const std::string &  fileName  ) 

Loads the sound data as a music (streaming) object.

Parameters:
fileName Filename of the music object to load.

Definition at line 74 of file SoundSourceComponent.cpp.

bool SoundSourceComponent::loadSoundBuffer ( const std::string &  bufferName  ) 

Loads the sound data from a sound buffer.

Parameters:
bufferName Name of the buffer to load.
See also:
SoundManager

Definition at line 110 of file SoundSourceComponent.cpp.

void SoundSourceComponent::onPause ( void *  p  ) 

Pauses the component if the parent is paused.

Note:
For internal use only!

Definition at line 370 of file SoundSourceComponent.cpp.

void SoundSourceComponent::onPositionChange ( void *  p  ) 

Updates the position of the component after its parent has been updated.

Note:
For internal use only!

Definition at line 358 of file SoundSourceComponent.cpp.

void SoundSourceComponent::onUnPause ( void *  p  ) 

Unpauses the component if the parent is unpaused.

Note:
For internal use only!

Definition at line 377 of file SoundSourceComponent.cpp.

void SoundSourceComponent::pause (  ) 

Pauses the associated sound.

Definition at line 173 of file SoundSourceComponent.cpp.

void SoundSourceComponent::play (  ) 

Plays the associated sound.

Definition at line 163 of file SoundSourceComponent.cpp.

SoundSourceComponent * SoundSourceComponent::refFactory ( Entity parent  )  [static]

Will be used to instanciate objects of this class.

Note:
For internal use only!

Reimplemented from EntityComponent.

Definition at line 56 of file SoundSourceComponent.cpp.

void SoundSourceComponent::setAttenuation ( f32  attenuation  ) 

Sets the attenuation factor. The higher the attenuation, the more the sound will be attenuated with distance from listener.

Parameters:
attenuation New attenuation factor.

Definition at line 288 of file SoundSourceComponent.cpp.

void SoundSourceComponent::setLoop ( bool  value  ) 

Sets the sound loop state.

Parameters:
value If true, the sound loops. Else the sound doesn't loop.

Definition at line 300 of file SoundSourceComponent.cpp.

void SoundSourceComponent::setMinDistance ( f32  minDistance  ) 

Sets the minimum distance. Closer than this distance, the listener will hear the sound at its maximum volume.

Definition at line 313 of file SoundSourceComponent.cpp.

void SoundSourceComponent::setOffset ( f32  offset  ) 

Sets the current playing position of the sound.

Note:
Only works when a sound buffer is loaded.

Definition at line 326 of file SoundSourceComponent.cpp.

void SoundSourceComponent::setPitch ( f32  pitch  ) 

Sets the sound pitch.

Definition at line 333 of file SoundSourceComponent.cpp.

void SoundSourceComponent::setVolume ( f32  volume  ) 

Sets the sound volume.

Definition at line 345 of file SoundSourceComponent.cpp.

void SoundSourceComponent::stop (  ) 

Stops the associated sound.

Definition at line 183 of file SoundSourceComponent.cpp.

void SoundSourceComponent::unloadData (  ) 

Unloads previously loaded data.

Definition at line 140 of file SoundSourceComponent.cpp.


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

Generated on Wed Jun 10 22:26:27 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8