Kigs Framework  Doc version 0.8
Open source multi purpose Rapid Application Development framework
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
AudioSource Class Referenceabstract

#include <AudioSource.h>

Inheritance diagram for AudioSource:
AndroidAudioSource

Public Member Functions

 AudioSource (const kstl::string &name, DECLARE_CLASS_NAME_TREE_ARG)
 Kigs constructor.
 
bool Draw (TravState *state) override
 Draw sound if the current listener is active.
 
bool addItem (CoreModifiable *item, ItemPosition pos=Last DECLARE_DEFAULT_LINK_NAME) override
 
bool removeItem (CoreModifiable *item DECLARE_DEFAULT_LINK_NAME) override
 
void GetBoundingBox (Point3D &pmin, Point3D &pmax) const override
 

Protected Member Functions

virtual ~AudioSource ()
 destructor
 
virtual void Protected1Draw (TravState *state)=0
 method used to play sound data from current buffer
 

Protected Attributes

maFloat myPitch
 sound pitch (affect sound speed and tone)
 
maFloat myGain
 sound gain (affect sound volume)
 
maBool myIsLooping
 looping flag (if true, sound will loop)
 
maBool myIsPlaying
 playing flag (true if the sound is playing)
 
maUInt myState
 current state (0:stop, 1:play, 2:pause)
 
maFloat m_ReferenceDistance
 minimum distance used for attenuation computing
 
maFloat m_MaxDistance
 maximum distance used for attenuation computing
 
maFloat m_RollOfFactor
 attenuation factor (higher value means faster attenuation)
 
AudioBuffermyBuffer
 current sound buffer
 

Friends

class ModuleSoundManager
 allow ModuleSoundManager to play sources by itself (no scene graph required)
 

Detailed Description

the audio source holds parameters for computing emitted sounds

Member Function Documentation

◆ addItem()

bool AudioSource::addItem ( CoreModifiable item,
ItemPosition pos  DECLARE_LINK_NAME = Last DECLARE_DEFAULT_LINK_NAME 
)
override

add an item

Note
if item is an AudioBuffer, empty the current buffer (if needed) and add the new one
Returns
true is item was successfully added

◆ GetBoundingBox()

void AudioSource::GetBoundingBox ( Point3D &  pmin,
Point3D &  pmax 
) const
inlineoverride

audio source must be always drawned

◆ removeItem()

bool AudioSource::removeItem ( CoreModifiable *item  DECLARE_DEFAULT_LINK_NAME)
override

remove an item

Note
if item is an AudioBuffer, empty and discard it
Returns
true is item was successfully removed

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