Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
sound::Sound Class Reference

#include <Sound.h>

Inheritance diagram for sound::Sound:
scene::Node resource::ResourceEventReceiver engine::Object

List of all members.

Public Member Functions

const core::vector3d getDirection () const
f32 getGain () const
 Returns the gain.
f32 getInnerConeAngle () const
 Return the innerConeAngle.
f32 getMaxDistance () const
 Returns the max distance.
f32 getMinDistance () const
 Returns the min distance.
f32 getOuterConeAngle () const
 Returns the outerConeAngle.
f32 getOuterConeGain () const
 Returns the outerConeGain.
f32 getPitch () const
 Returns the pitch multiplier.
SoundDatagetSoundData () const
const core::vector3dgetVelocity () const
bool isLooping () const
 Returns looping state.
virtual bool isPaused () const
 Returns true if the sound is paused.
virtual bool isPlaying () const
 Returns true if the sound is playing.
virtual bool isStopped () const
 Returns true if the sound is stopped.
virtual void pause ()
 Pauses the sound. Upon calling play again, the sound will resume where it left off.
virtual void play ()
 Plays the sound.
void resourceLoaded (const resource::ResourceEvent &evt)
 Called just after a Resource has been loaded.
void resourceUnloaded (const resource::ResourceEvent &evt)
 Called just after a Resource has been unloaded.
void setConeSettings (f32 innerConeAngle, f32 outerConeAngle, f32 outerConeGain)
void setDistanceValues (f32 minDistance, f32 maxDistance)
virtual void setGain (f32 gain)
 Sets the gain.
virtual void setInnerConeAngle (f32 innerConeAngle)
 Sets the inner angle of the sound cone for a directional sound.
virtual void setLoop (bool loop)
 Sets the looping state.
virtual void setMaxDistance (f32 maxDistance)
 Sets the Max Distance.
virtual void setMinDistance (f32 minDistance)
 Sets the Min Distance.
virtual void setOuterConeAngle (f32 outerConeAngle)
 Sets the outer angle of the sound cone for a directional sound.
virtual void setOuterConeGain (f32 outerConeGain)
 Sets the gain outside the sound cone of a directional sound.
virtual void setPitch (f32 pitch)
 Sets the pitch multiplier.
void setSoundData (const std::string &filename)
 Sets the sound data this sound will use.
void setSoundData (SoundData *soundData)
void setVelocity (const core::vector3d &vec)
void setVelocity (f32 x, f32 y, f32 z)
 Sound (const std::string &name, SoundData *soundData)
 Sound (SoundData *soundData)
virtual void stop ()
 Stops the sound. Upon calling play again, the sound will resume from the begining.
virtual ~Sound ()

Protected Member Functions

void initProperties ()

Protected Attributes

f32 mGain
f32 mInnerConeAngle
bool mLoop
f32 mMaxDistance
f32 mMinDistance
f32 mOuterConeAngle
f32 mOuterConeGain
f32 mPitch
SoundDatamSoundData
core::vector3d mVelocity

Static Protected Attributes

static u32 msNextGeneratedSoundIndex = 0

Detailed Description

Defines a sound in the sound world. Author: Kat'Oun version: 1.0


Constructor & Destructor Documentation

sound::Sound::Sound ( SoundData soundData)
sound::Sound::Sound ( const std::string &  name,
SoundData soundData 
)
sound::Sound::~Sound ( ) [virtual]

Member Function Documentation

const core::vector3d sound::Sound::getDirection ( ) const
f32 sound::Sound::getGain ( ) const

Returns the gain.

References mGain.

f32 sound::Sound::getInnerConeAngle ( ) const

Return the innerConeAngle.

References mInnerConeAngle.

f32 sound::Sound::getMaxDistance ( ) const

Returns the max distance.

References mMaxDistance.

f32 sound::Sound::getMinDistance ( ) const

Returns the min distance.

References mMinDistance.

f32 sound::Sound::getOuterConeAngle ( ) const

Returns the outerConeAngle.

References mOuterConeAngle.

f32 sound::Sound::getOuterConeGain ( ) const

Returns the outerConeGain.

References mOuterConeGain.

f32 sound::Sound::getPitch ( ) const

Returns the pitch multiplier.

References mPitch.

SoundData * sound::Sound::getSoundData ( ) const

References mSoundData.

const core::vector3d & sound::Sound::getVelocity ( ) const

References mVelocity.

void sound::Sound::initProperties ( ) [protected]

Reimplemented from scene::Node.

References mLoop, mVelocity, and core::vector3d::ORIGIN_3D.

Referenced by Sound().

bool sound::Sound::isLooping ( ) const

Returns looping state.

References mLoop.

bool sound::Sound::isPaused ( ) const [virtual]

Returns true if the sound is paused.

bool sound::Sound::isPlaying ( ) const [virtual]

Returns true if the sound is playing.

bool sound::Sound::isStopped ( ) const [virtual]

Returns true if the sound is stopped.

void sound::Sound::pause ( ) [virtual]

Pauses the sound. Upon calling play again, the sound will resume where it left off.

void sound::Sound::play ( ) [virtual]

Plays the sound.

void sound::Sound::resourceLoaded ( const resource::ResourceEvent evt) [virtual]
void sound::Sound::resourceUnloaded ( const resource::ResourceEvent evt) [virtual]

Called just after a Resource has been unloaded.

Reimplemented from resource::ResourceEventReceiver.

References mSoundData, resource::ResourceEvent::source, and engine::Object::uninitialize().

void sound::Sound::setConeSettings ( f32  innerConeAngle,
f32  outerConeAngle,
f32  outerConeGain 
)

Sets the variables used in the sound projection cone.

Parameters:
innerConeAngle,:The inside cone angle.
outerConeAngle,:The outside cone angle.
outerConeGain,:The outer cone gain.

References setInnerConeAngle(), setOuterConeAngle(), and setOuterConeGain().

void sound::Sound::setDistanceValues ( f32  minDistance,
f32  maxDistance 
)

Sets the variables used in the distance attenuation calculation.

Parameters:
minDistance,:The min distance that the sound emitter will cease to continue growing louder at (as it approaches the listener).
maxDistance,:The max distance a sound stops attenuating at.

References setMaxDistance(), and setMinDistance().

void sound::Sound::setGain ( f32  gain) [virtual]

Sets the gain.

References mGain.

void sound::Sound::setInnerConeAngle ( f32  innerConeAngle) [virtual]

Sets the inner angle of the sound cone for a directional sound.

References mInnerConeAngle.

Referenced by setConeSettings().

void sound::Sound::setLoop ( bool  loop) [virtual]

Sets the looping state.

References mLoop.

void sound::Sound::setMaxDistance ( f32  maxDistance) [virtual]

Sets the Max Distance.

References mMaxDistance.

Referenced by setDistanceValues().

void sound::Sound::setMinDistance ( f32  minDistance) [virtual]

Sets the Min Distance.

References mMinDistance.

Referenced by setDistanceValues().

void sound::Sound::setOuterConeAngle ( f32  outerConeAngle) [virtual]

Sets the outer angle of the sound cone for a directional sound.

References mOuterConeAngle.

Referenced by setConeSettings().

void sound::Sound::setOuterConeGain ( f32  outerConeGain) [virtual]

Sets the gain outside the sound cone of a directional sound.

References mOuterConeGain.

Referenced by setConeSettings().

void sound::Sound::setPitch ( f32  pitch) [virtual]

Sets the pitch multiplier.

References mPitch.

void sound::Sound::setSoundData ( const std::string &  filename)
void sound::Sound::setSoundData ( SoundData soundData)
void sound::Sound::setVelocity ( const core::vector3d vec)
void sound::Sound::setVelocity ( f32  x,
f32  y,
f32  z 
)
void sound::Sound::stop ( ) [virtual]

Stops the sound. Upon calling play again, the sound will resume from the begining.


Member Data Documentation

f32 sound::Sound::mGain [protected]

Referenced by getGain(), resourceLoaded(), and setGain().

bool sound::Sound::mLoop [protected]

Referenced by initProperties(), isLooping(), and setLoop().

Referenced by getPitch(), resourceLoaded(), and setPitch().


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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:10 by Doxygen (1.7.4)