Public Methods |
| SoundState (const std::string &name) |
| ~SoundState () |
| Destructor, releases any allocated sound sources. More...
|
| SoundState (const SoundState &state) |
| Copy constructor. More...
|
void | setName (const std::string &name) |
| Change the name of the SoundState to name. More...
|
SoundState & | operator= (const SoundState &state) |
| Assignment operator. More...
|
std::string | getName () const |
| Return the name of this soundstate. More...
|
bool | hasSource () const |
| Returns true if the SoundState has allocated a soundsource. More...
|
void | setSample (openalpp::Sample *sample) |
| Set the sample that this state will play. More...
|
void | setStream (openalpp::Stream *stream) |
| Set the stream that this state will play. More...
|
void | setPosition (const osg::Vec3 &pos) |
| Set the position of SoundState. More...
|
osg::Vec3 | getPosition () const |
| Get the position of SoundState. More...
|
void | setVelocity (const osg::Vec3 &vel) |
| Set the velocity of the SoundState. More...
|
osg::Vec3 | getVelocity (const osg::Vec3 &vel) const |
| Get the velocity of the SoundState. More...
|
void | setDirection (const osg::Vec3 &dir) |
| Set the direction of the SoundState. More...
|
osg::Vec3 | getDirection () const |
| Get the direction of the SoundState. More...
|
void | setGain (float gain) |
| Set the gain (volume) of the soundstate (1.0 is default). More...
|
float | getGain () const |
| Get the gain (volume) of the soundstate (1.0 is default). More...
|
bool | getLooping () const |
| Return true if the sound state is in looping mode. More...
|
void | setLooping (bool flag) |
| Set the SoundState in looping mode. More...
|
void | setAmbient (bool flag) |
| Set the soundstate in ambient (no attenuation will be calculated). More...
|
bool | getAmbient () const |
| Get the soundstate in ambient (no attenuation will be calculated). More...
|
void | setRelative (bool flag) |
| Set the soundstate so it will always be relative to the listener in position. More...
|
bool | getRelative () const |
| Get the soundstate so it will always be relative to the listener in position. More...
|
void | setSoundCone (float innerAngle, float outerAngle, float outerGain) |
bool | isActive () |
| -
Returns:
-
true if the source is in playing state. If there is no source associated, it will return false.
More...
|
void | setReferenceDistance (float distance) |
| Set the reference distance for the SoundState. More...
|
float | getReferenceDistance (float distance) const |
| Get the reference distance for the SoundState. More...
|
void | setMaxDistance (float max) |
float | getMaxDistance (float max) const |
void | setRolloffFactor (float roll) |
| Specifies the roll of factor for the SoundState, 1.0 is default. More...
|
float | getRolloffFactor () const |
| Return the roll of factor for the SoundState, 1.0 is default. More...
|
void | setPitch (float pitch) |
| Set the pitch (rate) for the SoundState (1.0 is default). More...
|
float | getPitch () const |
| Get the pitch (rate) for the SoundState (1.0 is default). More...
|
void | setPlay (bool flag) |
| Starts to play the SoundState. More...
|
bool | getPlay () |
| Return if the soundstate will play. More...
|
void | setOccludeDampingFactor (float d) |
float | getOccludeDampingFactor () const |
void | setOccludeScale (float d) |
float | getOccludeScale () const |
void | setOccluded (bool f) |
bool | getOccluded () const |
void | setStopMethod (openalpp::SourceState s) |
| Set whether paus or stop should be used when calling setPlay(false). More...
|
bool | isPlaying () |
| Returns true if there is a source and it is playing. More...
|
openalpp::SourceState | getStopMethod () const |
bool | allocateSource (unsigned int priority=0, bool registrate_as_active=true) |
unsigned int | getPriority () const |
| Return the priority set for this SoundState. More...
|
void | setSource (openalpp::Source *source) |
| Set the Source for this SoundState. More...
|
const openalpp::Source * | getSource () const |
| Return the Source for this SoundState. More...
|
void | releaseSource () |
| Release the Source that is allocated for this SoundState. More...
|
void | apply () |
| Performs the actual modification to the allocated Source. More...
|
Private Types |
enum | SetField {
Gain,
Looping,
Ambient,
Relative,
SoundCone,
ReferenceDistance,
RolloffFactor,
Stream,
Sample,
Pitch,
Position,
Direction,
Velocity,
MaxDistance,
Play,
Occluded,
Last
} |
| Specifies what field that has been set. More...
|
Private Methods |
void | setAll (bool flag) |
| Clear all the flags indicating a value has been set. More...
|
bool | isSet (SetField f) |
| Return true if SetField f is set since last call to apply() or clear(). More...
|
void | set (SetField f) |
| Set the given field to true. More...
|
void | clear (SetField f) |
Private Attributes |
openalpp::ref_ptr< openalpp::Stream > | m_stream |
openalpp::ref_ptr< openalpp::Sample > | m_sample |
openalpp::ref_ptr< openalpp::Source > | m_source |
std::string | m_name |
osg::Vec3 | m_position |
osg::Vec3 | m_direction |
osg::Vec3 | m_velocity |
float | m_gain |
float | m_innerAngle |
float | m_outerAngle |
float | m_outerGain |
float | m_referenceDistance |
float | m_maxDistance |
float | m_rolloffFactor |
float | m_pitch |
float | m_occlude_damping_factor |
float | m_occlude_scale |
bool | m_is_occluded |
bool | m_looping |
bool | m_ambient |
bool | m_relative |
bool | m_play |
bool | m_pause |
unsigned | m_priority |
std::vector< bool > | m_is_set |
This class stores the attributes for a sound source. It can exist with a sound source allocated to it, (hasSource() == true) which makes it the same thing as a sound source. Otherwise, it works as a placeholder (state) for a sound source. It can be assigned a sound source at anytime. Then apply() is called and it has a sound source the actual settings will be performed. It a state has a sound source all the set*() method calls apply automatically.