The buffer (data) for one kind of sound effects.
More...
#include <sfx_buffer.hpp>
|
| | SFXBuffer (const std::string &file, bool positional, float rolloff, float max_width, float gain) |
| | Creates a sfx. More...
|
| |
| | SFXBuffer (const std::string &file, const XMLNode *node) |
| | Constructor getting the sfx parameters from an XML node. More...
|
| |
| bool | load () |
| | load the buffer from file into OpenAL. More...
|
| |
| void | unload () |
| | Frees the loaded buffer. More...
|
| |
| 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.
|
| |
|
|
bool | loadVorbisBuffer (const std::string &name, ALuint buffer) |
| | Load a vorbis file into an OpenAL buffer based on a routine by Peter Mulholland, used with permission (quote : "Feel free to use")
|
| |
|
|
bool | m_loaded |
| | Whether the contents of the file was loaded.
|
| |
|
std::string | m_file |
| | The file that contains the OGG audio data.
|
| |
|
ALuint | m_buffer |
| | The openal buffer id.
|
| |
|
bool | m_positional |
| | If the sound is positional.
|
| |
|
float | m_rolloff |
| | The roll-off value.
|
| |
|
float | m_gain |
| | The volume gain value.
|
| |
|
float | m_max_dist |
| | Maximum distance the sfx can be heard.
|
| |
|
float | m_duration |
| | Duration of the sfx.
|
| |
The buffer (data) for one kind of sound effects.
◆ SFXBuffer() [1/2]
| 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:
- 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() [2/2]
| SFXBuffer::SFXBuffer |
( |
const std::string & |
file, |
|
|
const XMLNode * |
node |
|
) |
| |
Constructor getting the sfx parameters from an XML node.
- Parameters
-
| file | File name of the data. |
| node | XML Node with the data for this sfx. |
◆ isLoaded()
| bool SFXBuffer::isLoaded |
( |
| ) |
const |
|
inline |
- Returns
- whether this buffer was loaded from disk
◆ load()
load the buffer from file into OpenAL.
- Note
- If this buffer is already loaded, this call does nothing and returns false.
- Returns
- Whether loading was successful.
◆ unload()
| 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
The documentation for this class was generated from the following files: