Public Member Functions | |
void | play () |
void | pause () |
void | stop () |
void | rewind () |
SourceState | getState () const |
virtual void | setLooping (bool loop=true) |
bool | isLooping () const |
bool | isPaused () const |
void | setDirection (float directionx, float directiony, float directionz) |
void | getDirection (float &directionx, float &directiony, float &directionz) const |
void | makeOmniDirectional () |
void | setSoundCone (float innerangle, float outerangle=360.0, float outergain=0.0) |
void | getSoundCone (float &innerangle, float &outerangle, float &outergain) const |
void | setGain (float gain) |
float | getGain () const |
void | setMinMaxGain (float min=0.0, float max=1.0) |
void | getMinMaxGain (float &min, float &max) const |
void | setAmbient (bool ambient=true) |
bool | isAmbient () const |
void | setRelative (bool relative=true) |
bool | isRelative () const |
void | setReferenceDistance (float distance=1.0) |
float | getReferenceDistance () const |
void | setMaxDistance (float distance) |
float | getMaxDistance () const |
void | setRolloffFactor (float factor=1.0) |
float | getRolloffFactor () const |
void | setPitch (float pitch=1.0) |
float | getPitch () const |
void | setReverbScale (float scale) throw (InitError,ValueError) |
void | setReverbDelay (float delay) throw (InitError,ValueError) |
float | getReverbDelay () throw (InitError) |
float | getReverbScale () throw (InitError) |
ALuint | link (const SourceBase *source) throw (MemoryError) |
void | unlink (const SourceBase *source) throw (NameError) |
void | unlink (const ALuint name) throw (NameError) |
void | unlinkAll () |
ALuint | getAlSource () const |
void | setPosition (float x, float y, float z) |
void | getPosition (float &x, float &y, float &z) const |
void | setVelocity (float vx, float vy, float vz) |
void | getVelocity (float &vx, float &vy, float &vz) const |
SourceBase & | operator= (const SourceBase &sourcebase) |
Protected Member Functions | |
virtual | ~SourceBase () |
SourceBase () throw (MemoryError,NameError) | |
SourceBase (float x, float y, float z) throw (MemoryError,NameError) | |
SourceBase (const SourceBase &sourcebase) | |
Protected Attributes | |
ALuint | sourcename_ |
bool | streaming_ |
virtual openalpp::SourceBase::~SourceBase | ( | ) | [protected, virtual] |
Destructor.
openalpp::SourceBase::SourceBase | ( | ) | throw (MemoryError,NameError) [protected] |
Constructor.
openalpp::SourceBase::SourceBase | ( | float | x, | |
float | y, | |||
float | z | |||
) | throw (MemoryError,NameError) [protected] |
Constructor.
x | x coordinate. | |
y | y coordinate. | |
z | z coordinate. |
openalpp::SourceBase::SourceBase | ( | const SourceBase & | sourcebase | ) | [protected] |
Copy constructor.
void openalpp::SourceBase::play | ( | ) |
Play the source.
Reimplemented in openalpp::GroupSource, and openalpp::Source.
void openalpp::SourceBase::pause | ( | ) |
Pause the source.
Reimplemented in openalpp::Source.
void openalpp::SourceBase::stop | ( | ) |
Stop the source.
Reimplemented in openalpp::Source.
void openalpp::SourceBase::rewind | ( | ) |
Rewind the source.
SourceState openalpp::SourceBase::getState | ( | ) | const |
Get the current state.
virtual void openalpp::SourceBase::setLooping | ( | bool | loop = true |
) | [virtual] |
Turn on/off looping.
loop | is true if the source should loop, false otherwise. |
Reimplemented in openalpp::Source.
bool openalpp::SourceBase::isLooping | ( | ) | const |
Check whether the source is looping.
bool openalpp::SourceBase::isPaused | ( | ) | const |
void openalpp::SourceBase::setDirection | ( | float | directionx, | |
float | directiony, | |||
float | directionz | |||
) |
Sets the direction of the source.
directionx | x value of the direction vector. | |
directiony | y value of the direction vector. | |
directionz | z value of the direction vector. |
void openalpp::SourceBase::getDirection | ( | float & | directionx, | |
float & | directiony, | |||
float & | directionz | |||
) | const |
Gets the direction of the source.
directionx | x value of the direction vector. | |
directiony | y value of the direction vector. | |
directionz | z value of the direction vector. |
void openalpp::SourceBase::makeOmniDirectional | ( | ) |
Makes the source omni-directional. The same effect can be achieved by calling SetDirection(0,0,0)
void openalpp::SourceBase::setSoundCone | ( | float | innerangle, | |
float | outerangle = 360.0 , |
|||
float | outergain = 0.0 | |||
) |
Sets the sound cone parameters for a directional sound source. This function has no effect on omni-directional sources. Two cones, with the top at the source, and turned the same direction as the source, are defined by this. Inside the inner cone (specified by innerangle), sound will be played at full volume (attenuated by distance), and outside the outer cone (specified by outerangle) sound will be played at the volume specified by outergain. Between these areas, the sound volume will be interpolated between normal gain and outergain.
innerangle | specifies the inner cone. | |
outerangle | specifies the outer cone. | |
outergain | specifies the gain outside the outer cone. |
void openalpp::SourceBase::getSoundCone | ( | float & | innerangle, | |
float & | outerangle, | |||
float & | outergain | |||
) | const |
Gets the sound cone parameters.
innerangle | specifies the inner cone. | |
outerangle | specifies the outer cone. | |
outergain | specifies the gain outside the outer cone. |
void openalpp::SourceBase::setGain | ( | float | gain | ) |
Sets gain (volume). The volume a source will be played at will be multiplied by this _after_ the attenuation calculations. Note: In todays's implementation on Linux, gain is clamped to [0.0,1.0]. This will be changed in future releases of OpenAL.
gain | is the gain [0.0,... |
float openalpp::SourceBase::getGain | ( | ) | const |
Gets the gain (volume).
void openalpp::SourceBase::setMinMaxGain | ( | float | min = 0.0 , |
|
float | max = 1.0 | |||
) |
Sets maximum and minimum gain this source will be played at. I.e. the gain will be clamped to these values.
min | is minimum gain. | |
max | is maximum gain. |
void openalpp::SourceBase::getMinMaxGain | ( | float & | min, | |
float & | max | |||
) | const |
Gets maximum and minumum gain.
min | is minimum gain. | |
max | is maximum gain. |
void openalpp::SourceBase::setAmbient | ( | bool | ambient = true |
) |
Makes the source ambient (or makes it stop being ambient). This function _will_ change the source's position, direction and roll-off factor.
ambient | is true if the source should be ambient, false otherwise. |
bool openalpp::SourceBase::isAmbient | ( | ) | const |
Check if the source is ambient.
void openalpp::SourceBase::setRelative | ( | bool | relative = true |
) |
Makes the source's position relative (or makes it stop being relative). This means that the position in space will not be absolute, but rather relative to the listener.
relative | is true if the source should be relative, false otherwise. |
bool openalpp::SourceBase::isRelative | ( | ) | const |
Check if the source's position is relative.
void openalpp::SourceBase::setReferenceDistance | ( | float | distance = 1.0 |
) |
Sets the reference distance for this source. The reference distance is used in attenuation calculations.
distance | is the reference distance. |
float openalpp::SourceBase::getReferenceDistance | ( | ) | const |
Gets the reference distance.
void openalpp::SourceBase::setMaxDistance | ( | float | distance | ) |
Sets the maximum distance. This is used in attenuation calculations, if the distance model is InverseDistanceClamped.
distance | is the maximum distance. |
float openalpp::SourceBase::getMaxDistance | ( | ) | const |
Gets the maximum distance.
void openalpp::SourceBase::setRolloffFactor | ( | float | factor = 1.0 |
) |
Sets the roll-off factor. This is used in distance attenuation calculations.
factor | is the rolloff factor. |
float openalpp::SourceBase::getRolloffFactor | ( | ) | const |
Gets the roll-off factor.
void openalpp::SourceBase::setPitch | ( | float | pitch = 1.0 |
) |
Sets the pitch. 1.0 is normal. Each reduction by 50% equals a reduction by one octave.
pitch | is the pitch (0.0,1.0]. |
float openalpp::SourceBase::getPitch | ( | ) | const |
Gets the pitch.
void openalpp::SourceBase::setReverbScale | ( | float | scale | ) | throw (InitError,ValueError) |
Set reverb scale for this source. This is simply the scale of the "echo." AudioEnviroment::InitiateReverb() must be called before this.
scale | is the reverb scale [0.0-1.0]. |
void openalpp::SourceBase::setReverbDelay | ( | float | delay | ) | throw (InitError,ValueError) |
Set reverb delay for this source. AudioEnviroment::InitiateReverb() must be called before using this. This is how many seconds back in time the echo will be.
delay | is the delay [0.0-2.0] in seconds. |
float openalpp::SourceBase::getReverbDelay | ( | ) | throw (InitError) |
Get reverb delay for this source.
float openalpp::SourceBase::getReverbScale | ( | ) | throw (InitError) |
Get reverb scale for this source.
ALuint openalpp::SourceBase::link | ( | const SourceBase * | source | ) | throw (MemoryError) |
Link this source to another. This causes calls to Play(), Pause(), Stop() and Rewind() (on this source) to be applied to all sources this has been linked to, synchronously.
source | is the source to link to. |
void openalpp::SourceBase::unlink | ( | const SourceBase * | source | ) | throw (NameError) |
Unlink this source from another.
source | is the source to unlink. |
void openalpp::SourceBase::unlink | ( | const ALuint | name | ) | throw (NameError) |
Unlink this source from another.
name | is the name of the source to unlink. |
void openalpp::SourceBase::unlinkAll | ( | ) |
Unlink all sources from this.
ALuint openalpp::SourceBase::getAlSource | ( | ) | const |
Returns the OpenAL name of the source. Can be used to directly modify the source with OpenAL functions.
void openalpp::SourceBase::setPosition | ( | float | x, | |
float | y, | |||
float | z | |||
) | [virtual] |
Inherited from PositionedObject.
Implements openalpp::PositionedObject.
void openalpp::SourceBase::getPosition | ( | float & | x, | |
float & | y, | |||
float & | z | |||
) | const [virtual] |
Inherited from PositionedObject.
Implements openalpp::PositionedObject.
void openalpp::SourceBase::setVelocity | ( | float | vx, | |
float | vy, | |||
float | vz | |||
) | [virtual] |
Inherited from PositionedObject.
Implements openalpp::PositionedObject.
void openalpp::SourceBase::getVelocity | ( | float & | vx, | |
float & | vy, | |||
float & | vz | |||
) | const [virtual] |
Inherited from PositionedObject.
Implements openalpp::PositionedObject.
SourceBase& openalpp::SourceBase::operator= | ( | const SourceBase & | sourcebase | ) |
Assignment operator.
ALuint openalpp::SourceBase::sourcename_ [protected] |
OpenAL name for this source.
bool openalpp::SourceBase::streaming_ [protected] |
Flag for whether the source is streaming.