#include <ALObj.h>
Public Member Functions | |
| ALObj (ALuint fileCount, const char *fileNames[], bool looping) | |
| ~ALObj () | |
| bool | getMute () |
| ALfloat * | getPosition () |
| ALfloat * | getVolume () |
| void | setPosition (ALfloat x, ALfloat y, ALfloat z) |
| void | setVelocity (ALfloat x, ALfloat y, ALfloat z) |
| void | setDistances (ALfloat max, ALfloat ref) |
| void | setDistanceMax (ALfloat max) |
| void | setDistanceRef (ALfloat ref) |
| void | setMute (ALboolean mute) |
| void | setVolume (ALfloat volume) |
| void | createLowPassFilter () |
| void | setLowPassFilter (ALfloat gain, ALfloat gainHF) |
| void | deleteFilters () |
| void | deleteBuffers () |
| void | deleteSource () |
| void | play () |
| void | play (ALuint uiBufferID) |
| void | stop () |
Public Attributes | |
| ALuint | source |
| ALuint | filter |
ALObj defines a sound object. It consists of a source and a number of buffers with the wave data that can be played by the source one each time. A source can be positioned in the world and has attributes like an individual volume. It has methods to activate different filters on a source.
filename: ALObj.h
| sonus::ALObj::ALObj | ( | ALuint | fileCount, | |
| const char * | fileNames[], | |||
| bool | looping | |||
| ) |
Constructor Creates a sound object in the world.
| fileCount | The number of audio files to be load. | |
| fileNames | An array of filenames to be looked for and loaded to buffers. | |
| looping | Indicates if the source is playing its sound constantly or only when triggered. |
| sonus::ALObj::~ALObj | ( | ) |
Destructor Stops the sound if the object is currently playing and deletes the source.
| bool sonus::ALObj::getMute | ( | ) |
Indicates if the sound object is currently muted or not.
| ALfloat* sonus::ALObj::getPosition | ( | ) |
Get the current position of the sound object in the world.
| ALfloat* sonus::ALObj::getVolume | ( | ) |
Get the current volume of the sound object.
| void sonus::ALObj::setPosition | ( | ALfloat | x, | |
| ALfloat | y, | |||
| ALfloat | z | |||
| ) |
Set the new AL_POSITION of the sound object.
| x | The x coordinate position to be set. | |
| y | The y coordinate position to be set. | |
| z | The z coordinate position to be set. |
| void sonus::ALObj::setVelocity | ( | ALfloat | x, | |
| ALfloat | y, | |||
| ALfloat | z | |||
| ) |
Set the AL_VELOCITY of the sound object.
| x | The x coordinate velocity to be set. | |
| y | The y coordinate velocity to be set. | |
| z | The z coordinate velocity to be set. |
| void sonus::ALObj::setDistances | ( | ALfloat | max, | |
| ALfloat | ref | |||
| ) |
Set AL_MAX_DISTANCE and AL_REFERENCE_DISTANCE values. See OpenAL documentation for explanation.
| max | AL_MAX_DISTANCE | |
| ref | AL_REFERENCE_DISTANCE |
| void sonus::ALObj::setDistanceMax | ( | ALfloat | max | ) |
Set AL_MAX_DISTANCE value. See OpenAL documentation for explanation.
| max | AL_MAX_DISTANCE |
| void sonus::ALObj::setDistanceRef | ( | ALfloat | ref | ) |
Set AL_REFERENCE_DISTANCE value. See OpenAL documentation for explanation.
| ref | AL_REFERENCE_DISTANCE |
| void sonus::ALObj::setMute | ( | ALboolean | mute | ) |
Set the mute state of the sound object.
| mute | A boolean indicating the mute state. |
| void sonus::ALObj::setVolume | ( | ALfloat | volume | ) |
Set the volume (AL_GAIN) of the sound object.
| volume | An ALfloat value indicating the volume. |
| void sonus::ALObj::createLowPassFilter | ( | ) |
Add a low-pass filter to the sound object.
| void sonus::ALObj::setLowPassFilter | ( | ALfloat | gain, | |
| ALfloat | gainHF | |||
| ) |
Define the settings for the low-pass filter (AL_FILTER_LOWPASS). See OpenAL documentation for explanation.
| gain | Set the overall volume of the low-pass filter. | |
| gainHF | Set the higher frequency volume of the low-pass filter. |
| void sonus::ALObj::deleteFilters | ( | ) |
Delete all filters of the sound object.
| void sonus::ALObj::deleteBuffers | ( | ) |
Delete all buffers of the sound object.
| void sonus::ALObj::deleteSource | ( | ) |
Delete the source of the sound object.
| void sonus::ALObj::play | ( | ) |
Play the current sound file.
| void sonus::ALObj::play | ( | ALuint | uiBufferID | ) |
Play one specific sound file. (Binds the buffer to the source and plays it.)
| uiBufferID | The ID of the buffer in the buffer array. |
| void sonus::ALObj::stop | ( | ) |
Stop the current sound file.
1.5.4