#include <Audio.h>
Public Member Functions | |
SoundInstance (ALuint buffer) | |
Create associating with an OpenAL buffer object's name. | |
ALuint | get_buffer () |
Return the buffer name given on creation. | |
bool | get_assigned () |
return true if an ALSoundSource is being used. | |
unsigned int | get_index () |
Get the index value passed when assigned. | |
void | assign (ALSoundSource &source, unsigned int index) |
Use an ALSoundSource. | |
void | unassign () |
Stop using an ALSoundSource. | |
void | set_gain (ALfloat gain) |
Set how loud the sound should be played. | |
ALfloat | get_gain () |
return the gain set by set_gain() | |
void | set_pitch (ALfloat pitch) |
Set the scale for the pitch of the sound (1 is normal). | |
void | set_position (btVector3 position) |
Set the position of the sound relative to the viewer. | |
void | set_looping (bool looping=true) |
Set whether the sound should repeat continuosly. | |
bool | get_looping () |
Return true iff the sound should repeat continuosly. | |
void | play () |
Play the sound. | |
void | stop () |
Stop the sound from playing. | |
bool | get_playing () |
Return true iff the sound is playing. | |
void | update_al () |
Update the assigned ALSoundSource. | |
Private Attributes | |
ALSoundSource * | m_source |
unsigned int | m_source_index |
ALuint | m_buffer |
ALfloat | m_gain |
ALfloat | m_pitch |
btVector3 | m_position |
bool | m_looping |
bool | m_playing |
bool | m_assigning |
May or may not be actually played. Only the most audioable sounds are fed into OpenAL. The less audiable ones are ignored for performance reasons.
Definition at line 218 of file Audio.h.
Engine::SoundInstance::SoundInstance | ( | ALuint | buffer | ) |
void Engine::SoundInstance::assign | ( | ALSoundSource & | source, | |
unsigned int | index | |||
) |
Use an ALSoundSource.
After this, the ALSoundSource is not assigned to any SoundInstance it was assigned to before. This will make the sound actually audiable.
bool Engine::SoundInstance::get_assigned | ( | ) |
ALuint Engine::SoundInstance::get_buffer | ( | ) |
ALfloat Engine::SoundInstance::get_gain | ( | ) |
unsigned int Engine::SoundInstance::get_index | ( | ) |
bool Engine::SoundInstance::get_looping | ( | ) |
bool Engine::SoundInstance::get_playing | ( | ) |
void Engine::SoundInstance::set_gain | ( | ALfloat | gain | ) |
void Engine::SoundInstance::set_looping | ( | bool | looping = true |
) |
Set whether the sound should repeat continuosly.
A looping sound source can be assigned an ALSoundSource at any time. A sound source which doesn't loop that could not be assigned an ALSoundSource will never be heard. The looping value shouldn't be changed while playing and attached to a ALSoundSource. You can call this function with the previous state again though, it will just do nothing.
void Engine::SoundInstance::set_pitch | ( | ALfloat | pitch | ) |
void Engine::SoundInstance::set_position | ( | btVector3 | position | ) |
void Engine::SoundInstance::stop | ( | ) |
void Engine::SoundInstance::unassign | ( | ) |
void Engine::SoundInstance::update_al | ( | ) |
bool Engine::SoundInstance::m_assigning [private] |
ALuint Engine::SoundInstance::m_buffer [private] |
ALfloat Engine::SoundInstance::m_gain [private] |
bool Engine::SoundInstance::m_looping [private] |
ALfloat Engine::SoundInstance::m_pitch [private] |
bool Engine::SoundInstance::m_playing [private] |
btVector3 Engine::SoundInstance::m_position [private] |
ALSoundSource* Engine::SoundInstance::m_source [private] |
unsigned int Engine::SoundInstance::m_source_index [private] |
Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.