Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <SoundBuffer.h>
Public Member Functions | |
SoundBuffer () throw () | |
SoundBuffer (unsigned int capacity, const Format &format) throw (OutOfMemoryException) | |
SoundBuffer (const SoundBuffer &other) throw (OutOfMemoryException) | |
void | reserve (unsigned int capacity) throw (OutOfMemoryException) |
void | reserve (unsigned int capacity, const Format &format) throw (OutOfMemoryException) |
unsigned int | getByteCapacity () const throw () |
unsigned int | getSampleCapacity () const throw () |
unsigned int | getUsedBytes () const throw () |
void * | getBuffer () throw () |
const void * | getBuffer () const throw () |
const Format & | getFormat () const |
void | setFormat (const Format &newFormat) throw () |
void | setUsedBytes (unsigned int used) throw () |
unsigned int | getSampleCount () const throw () |
void | reformat (const Format &newFormat) throw (Exception) |
SoundBuffer & | operator= (const SoundBuffer &other) throw (OutOfMemoryException) |
void | swap (SoundBuffer &other) throw () |
void | optimize () throw () |
void | clear () |
Sound Buffer class
Definition at line 26 of file SoundBuffer.h.
Audio::SoundBuffer::SoundBuffer | ( | ) | ||
throw | ( | |||
) |
Create an empty buffer (zero capacity, default format)
Definition at line 14 of file SoundBuffer.cpp.
Audio::SoundBuffer::SoundBuffer | ( | unsigned int | capacity, |
const Format & | format | ||
) | |||
throw | ( | OutOfMemoryException | |
) |
Create a buffer of specified sample capacity and format
Definition at line 22 of file SoundBuffer.cpp.
Audio::SoundBuffer::SoundBuffer | ( | const SoundBuffer & | other) | ||
throw | ( | OutOfMemoryException | |||
) |
Create a copy of the other buffer
Definition at line 31 of file SoundBuffer.cpp.
References buffer, and VsnetOSS::memcpy().
void Audio::SoundBuffer::clear | ( | ) |
|
inline |
Get write access to the buffer
Definition at line 72 of file SoundBuffer.h.
Referenced by Audio::OpenALSimpleSound::loadImpl().
|
inline |
|
inline |
Get a buffer's byte capacity
Definition at line 61 of file SoundBuffer.h.
|
inline |
|
inline |
Get a buffer's sample capacity
Definition at line 66 of file SoundBuffer.h.
References Audio::Format::frameSize().
|
inline |
Get a buffer's sample capacity for a certain format
Definition at line 87 of file SoundBuffer.h.
References Audio::Format::frameSize().
|
inline |
Get the portion of the buffer actually used for holding useful data
Definition at line 69 of file SoundBuffer.h.
Referenced by Audio::OpenALSimpleSound::loadImpl().
SoundBuffer & Audio::SoundBuffer::operator= | ( | const SoundBuffer & | other) | ||
throw | ( | OutOfMemoryException | |||
) |
Copy the given buffer as if SoundBuffer(buffer) was called
Definition at line 42 of file SoundBuffer.cpp.
References buffer, and VsnetOSS::memcpy().
void Audio::SoundBuffer::optimize | ( | ) | ||
throw | ( | |||
) |
Free extra memory allocated
Definition at line 89 of file SoundBuffer.cpp.
Referenced by Audio::OpenALSimpleSound::loadImpl().
Reformat the samples in the buffer without reallocating if possible (inplace)
Definition at line 73 of file SoundBuffer.cpp.
void Audio::SoundBuffer::reserve | ( | unsigned int | capacity) | ||
throw | ( | OutOfMemoryException | |||
) |
Set a buffer's capacity.
capacity | The buffer's capacity in bytes |
Definition at line 55 of file SoundBuffer.cpp.
References buffer.
Referenced by Audio::OpenALSimpleSound::loadImpl().
void Audio::SoundBuffer::reserve | ( | unsigned int | capacity, |
const Format & | format | ||
) | |||
throw | ( | OutOfMemoryException | |
) |
Set a buffer's capacity and format.
capacity | The buffer's capacity in samples (or frames) for 'format' |
format | The new format associated to the buffer |
Definition at line 66 of file SoundBuffer.cpp.
|
inline |
Set the format of the stream mantaining the capacity yet destroying all current data
Definition at line 81 of file SoundBuffer.h.
|
inline |
Set the portion of the buffer actually used for holding useful data
Definition at line 84 of file SoundBuffer.h.
Referenced by Audio::OpenALSimpleSound::loadImpl().
void Audio::SoundBuffer::swap | ( | SoundBuffer & | other) | ||
throw | ( | ||||
) |
Swap buffer contents and format It's an inherently quick operation, since it only swaps pointers and descriptors.
Definition at line 80 of file SoundBuffer.cpp.
References buffer.
Referenced by Audio::OpenALSimpleSound::loadImpl().