Sound Class Reference
[Framework Module]

#include <sound.h>

Inheritance diagram for Sound:

Resource Root Object TreeNode< Root > Referenced Counted Serialized List< Root > ListNode< Root > OpenALSound

List of all members.


Detailed Description

Hold parameters for a sound instance. Usually a "game object" holds one or more Sound objects for all the sounds it has to play. Although Sound is derived from Resource, Sound objects should never be shared (this is enforced by the factory method AudioServer::NewSound()).

When opened, a Sound object will create a shared static or streaming sound resource, based on the settings of Sound.

Public Types

enum  Category {
  SND_EFFECT, SND_MUSIC, SND_SPEECH, SND_AMBIENT,
  SND_COUNT
}
 sound categories. More...

Public Member Functions

 Sound (const char *id)
virtual ~Sound ()
void SetCategory (Category category)
void SetPriority (int pri)
void SetStreaming (bool b)
void SetLooping (bool b)
void SetVolume (float v)
void SetMinVolume (float v)
void SetMaxVolume (float v)
void SetTransform (const matrix44 &m)
void SetVelocity (const vector3 &v)
void SetRefDistance (float d)
void SetMaxDistance (float d)
void SetInnerConeAngle (float a)
void SetOuterConeAngle (float a)
void SetOuterConeVolume (float v)
void SetRolloffFactor (float v)
void SetPitch (float v)
Category GetCategory () const
int GetPriority () const
bool IsStreaming () const
bool IsLooping () const
float GetVolume () const
float GetMinVolume () const
float GetMaxVolume () const
const matrix44GetTransform () const
const vector3GetVelocity () const
float GetRefDistance () const
float GetMaxDistance () const
float GetInnerConeAngle () const
float GetOuterConeAngle () const
float GetOuterConeVolume () const
float GetRolloffFactor () const
float GetPitch () const
void CopySoundAttrsFrom (const Sound *other)
virtual bool IsPlaying ()

Static Public Member Functions

static bool CategoryToString (Category category, string &name)
static bool StringToCategory (const string &name, Category &category)

Protected Member Functions

virtual void Play ()
virtual void Stop ()
virtual void Pause ()
virtual void PlayPause ()
virtual void Update ()
virtual void UpdateStream ()

Protected Attributes

Category category
matrix44 transform
vector3 velocity
bool streaming
bool looping
int priority
float volume
 Indicate the gain (volume amplification) applied. [> 0.0].
float min_volume
 Indicate minimum source attenuation. [0.0 - 1.0].
float max_volume
 Indicate maximum source attenuation. [0.0 - 1.0].
float ref_distance
 Source specific reference distance. [> 0.0] At 0.0, no distance attenuation occurs.
float max_distance
 Indicate distance above which sources are not attenuated using the inverse clamped distance model. [> 0.0].
float rolloff_factor
 Source specific rolloff factor. [>0.0].
float pitch
 Specify the pitch to be applied at source. [0.5 - 2.0].
float inner_cone_angle
 Directional source, inner cone angle, in degrees. [0-360].
float outer_cone_angle
 Directional source, outer cone angle, in degrees. [0-360].
float outer_cone_volume
 Directional source, outer cone gain. [0.0 - 1.0].
bool volume_dirty
bool move_dirty
bool props_dirty
Ref< SoundResourcesound_resource

Friends

class AudioServer


Member Enumeration Documentation

enum Sound::Category

sound categories.

Enumerator:
SND_EFFECT 
SND_MUSIC 
SND_SPEECH 
SND_AMBIENT 
SND_COUNT 


Constructor & Destructor Documentation

Sound::Sound ( const char *  id  ) 

Constructor.

Sound::~Sound (  )  [virtual]

Destructor.


Member Function Documentation

void Sound::SetCategory ( Category  c  )  [inline]

Sets category of sound.

void Sound::SetPriority ( int  p  )  [inline]

Sets the sound priority for voice management.

void Sound::SetStreaming ( bool  b  )  [inline]

Sets static/streaming type.

void Sound::SetLooping ( bool  b  )  [inline]

Sets the looping behaviour.

void Sound::SetVolume ( float  v  )  [inline]

Sets the playback volume.

Indicate the gain (volume amplification) applied. [> 0.0] A value of 1.0 means un-attenuated/unchanged. Each division by 2 equals an attenuation of -6dB. Each multiplicaton with 2 equals an amplification of +6dB.

A value of 0.0 is meaningless with respect to a logarithmic scale; it is interpreted as zero volume - the channel is effectively disabled.

void Sound::SetMinVolume ( float  v  )  [inline]

void Sound::SetMaxVolume ( float  v  )  [inline]

void Sound::SetTransform ( const matrix44 m  )  [inline]

Sets world transform.

void Sound::SetVelocity ( const vector3 v  )  [inline]

Sets the velocity.

void Sound::SetRefDistance ( float  d  )  [inline]

Sets the minimum distance (sound doesn't get louder when closer).

void Sound::SetMaxDistance ( float  d  )  [inline]

Sets the maximum distance (sound will not be audible beyond that distance.

void Sound::SetInnerConeAngle ( float  a  )  [inline]

Sets the inside cone angle in degrees.

void Sound::SetOuterConeAngle ( float  a  )  [inline]

Sets the outside cone angle in degrees.

void Sound::SetOuterConeVolume ( float  v  )  [inline]

Sets the cone outside volume (0.0 .. 1.0).

void Sound::SetRolloffFactor ( float  v  )  [inline]

Sets the rolloff factor.

void Sound::SetPitch ( float  v  )  [inline]

Sets the rolloff factor.

Sound::Category Sound::GetCategory (  )  const [inline]

Gets category of sound.

int Sound::GetPriority (  )  const [inline]

Gets the sound priority for voice management.

bool Sound::IsStreaming (  )  const [inline]

Gets static/streaming type.

bool Sound::IsLooping (  )  const [inline]

Gets the looping behaviour.

float Sound::GetVolume (  )  const [inline]

Gets the playback volume.

float Sound::GetMinVolume (  )  const [inline]

float Sound::GetMaxVolume (  )  const [inline]

const matrix44 & Sound::GetTransform (  )  const [inline]

Gets world transform.

const vector3 & Sound::GetVelocity (  )  const [inline]

Gets the velocity.

float Sound::GetRefDistance (  )  const [inline]

Gets the mimimum distance.

float Sound::GetMaxDistance (  )  const [inline]

Gets the maximum distance.

float Sound::GetInnerConeAngle (  )  const [inline]

Gets the inside cone angle.

float Sound::GetOuterConeAngle (  )  const [inline]

Gets the outside cone angle.

float Sound::GetOuterConeVolume (  )  const [inline]

Gets the cone outside volume.

float Sound::GetRolloffFactor (  )  const [inline]

Gets the rolloff factor.

float Sound::GetPitch (  )  const [inline]

Gets the rolloff factor.

void Sound::CopySoundAttrsFrom ( const Sound other  )  [inline]

Copies audio attributes from another sound object.

bool Sound::CategoryToString ( Category  category,
string &  name 
) [static]

bool Sound::StringToCategory ( const string &  name,
Category category 
) [static]

bool Sound::IsPlaying (  )  [virtual]

Returns true if sound is playing.

Reimplemented in OpenALSound.

void Sound::Play (  )  [protected, virtual]

Starts the sound.

Reimplemented in OpenALSound.

void Sound::Stop (  )  [protected, virtual]

Stops the sound.

Reimplemented in OpenALSound.

void Sound::Pause (  )  [protected, virtual]

Pause the sound.

Reimplemented in OpenALSound.

void Sound::PlayPause (  )  [protected, virtual]

Play/Pause the sound.

void Sound::Update (  )  [protected, virtual]

Updates the sound.

Reimplemented in OpenALSound.

void Sound::UpdateStream (  )  [protected, virtual]

Updates sound stream.

Reimplemented in OpenALSound.


Friends And Related Function Documentation

friend class AudioServer [friend]


Member Data Documentation

Category Sound::category [protected]

matrix44 Sound::transform [protected]

vector3 Sound::velocity [protected]

bool Sound::streaming [protected]

bool Sound::looping [protected]

int Sound::priority [protected]

float Sound::volume [protected]

Indicate the gain (volume amplification) applied. [> 0.0].

float Sound::min_volume [protected]

Indicate minimum source attenuation. [0.0 - 1.0].

float Sound::max_volume [protected]

Indicate maximum source attenuation. [0.0 - 1.0].

float Sound::ref_distance [protected]

Source specific reference distance. [> 0.0] At 0.0, no distance attenuation occurs.

float Sound::max_distance [protected]

Indicate distance above which sources are not attenuated using the inverse clamped distance model. [> 0.0].

float Sound::rolloff_factor [protected]

Source specific rolloff factor. [>0.0].

float Sound::pitch [protected]

Specify the pitch to be applied at source. [0.5 - 2.0].

float Sound::inner_cone_angle [protected]

Directional source, inner cone angle, in degrees. [0-360].

float Sound::outer_cone_angle [protected]

Directional source, outer cone angle, in degrees. [0-360].

float Sound::outer_cone_volume [protected]

Directional source, outer cone gain. [0.0 - 1.0].

bool Sound::volume_dirty [protected]

bool Sound::move_dirty [protected]

bool Sound::props_dirty [protected]

Ref<SoundResource> Sound::sound_resource [protected]


The documentation for this class was generated from the following files:
Generated on Sat Oct 20 14:47:36 2007 for Dark Oberon by  doxygen 1.5.3