SuperTuxKart
|
The buffer (data) for one kind of sound effects. More...
#include <sfx_buffer.hpp>
Public Member Functions | |
SFXBuffer (const std::string &file, bool positional, float rolloff, float max_width, float gain) | |
Creates a sfx. | |
SFXBuffer (const std::string &file, const XMLNode *node) | |
Constructor getting the sfx parameters from an XML node. | |
bool | load () |
load the buffer from file into OpenAL. | |
void | unload () |
Frees the loaded buffer. | |
bool | isLoaded () const |
ALuint | getBufferID () const |
Only returns a valid buffer if isLoaded() returned true. | |
bool | isPositional () const |
Returns if the buffer is positional. | |
float | getRolloff () const |
Returns the rolloff value of this buffer. | |
float | getGain () const |
Returns the gain for this sfx. | |
float | getMaxDist () const |
Returns the maximum distance this sfx can be heard. | |
const std::string & | getFileName () const |
Returns the file name of this buffer. | |
void | setPositional (bool positional) |
Sets if this buffer is positional or not. | |
float | getDuration () const |
Returns how long this buffer will play. | |
The buffer (data) for one kind of sound effects.
SFXBuffer::SFXBuffer | ( | const std::string & | file, |
bool | positional, | ||
float | rolloff, | ||
float | max_dist, | ||
float | gain | ||
) |
Creates a sfx.
The parameter are taken from the parameters:
file | File name of the buffer. |
positional | If the sfx is positional. |
rolloff | Rolloff value of this sfx. |
max_dist | Maximum distance the sfx can be heard. |
gain | Gain value of this sfx. |
SFXBuffer::SFXBuffer | ( | const std::string & | file, |
const XMLNode * | node | ||
) |
Constructor getting the sfx parameters from an XML node.
file | File name of the data. |
node | XML Node with the data for this sfx. |
|
inline |
bool SFXBuffer::load | ( | ) |
load the buffer from file into OpenAL.
void SFXBuffer::unload | ( | ) |
Frees the loaded buffer.
Cannot appear in destructor because copy-constructors may be used, and the OpenAL source must not be deleted on a copy