#include <SoundChunk.h>
Public Member Functions | |
| SoundChunk () | |
| SoundChunk (Sample *buff, const unsigned fc) | |
| SoundChunk (Sample **buff, const unsigned cc, const unsigned fc) | |
| ~SoundChunk () | |
| SoundChunk (SoundChunk const &chnk) | |
| SoundChunk & | operator= (SoundChunk const &chnk) |
| SoundChunk | copy (Allocator &alloc=SystemAllocator::global()) const |
| void | setDestroyer (Allocator &pool) |
| void | setDestroyer (MemoryGate<> &gate) |
| void | resetDestroyer () |
| bool | hasDestroyer () const |
| void | destroyMemory () |
| SoundChunk & | release () |
| bool | isValid () const |
| unsigned | frameCount () const |
| void | setFrameCount (unsigned n) |
| unsigned | channelCount () const |
| void | setChannelCount (unsigned n) |
| Sample * | buffer (unsigned n) |
| Sample const * | buffer (unsigned n) const |
| void | setBuffer (unsigned n, Sample *buff) |
| Sample * | operator[] (unsigned n) |
| Sample const * | operator[] (unsigned n) const |
| Sample * | begin (unsigned n) |
| Sample const * | begin (unsigned n) const |
| Sample * | end (unsigned n) |
| Sample const * | end (unsigned n) const |
| SoundChunk | subChunk (unsigned b, unsigned len) |
| void | write (unsigned pos, Sample *buff, unsigned len) |
| void | write (unsigned to, SoundChunk const &buff) |
| bool | writeChannel (unsigned chan, unsigned pos, Sample *buff, unsigned len) |
| void | clear (unsigned b, unsigned len) |
| void | clear () |
| void | clearChannel (unsigned n, unsigned b, unsigned len) |
| void | clearChannel (unsigned n) |
Private Types | |
| enum | _ExitStrategy { USE_NONE = 0, USE_GATE, USE_POOL, USE_ENUM_END } |
Private Member Functions | |
| void | _destroy () |
Private Attributes | |
| Sample * | _buffers [ARK_MAX_CHANNELS] |
| unsigned | _frameCount |
| unsigned | _channelCount |
| union { | |
| MemoryGate * _gate | |
| Allocator * _pool | |
| } | _exit |
| int | _exitCmd |
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clear Clears the entire chunk to 0.
|
|
||||||||||||
|
clear Clears all channels of this chunk in the specified region to 0.
|
|
|
clearChannel Clears the entire channel specified.
|
|
||||||||||||||||
|
clearChannel Clears a specified range in a specific channel to 0.
|
|
|
copy Copies the chunk contents into a new chunk and returns it. New chunks are allocated from the system allocator, unless another allocator is passed as a parameter.
|
|
|
destroyMemory If this->hasDestroyer() == true, then the memory for this chunk is destroyed with the installed destroyer, otherwise, does nothing.
|
|
|
|
|
|
|
|
|
|
|
|
hasDestroyer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
release Convenience function, calls resetDestroeyer() and returns a reference to *this. Useful for removing RAII hook just as you return a sound chunk from a function.
|
|
|
resetDestroyer Removes any currently registered destroyer.
|
|
||||||||||||
|
|
|
|
|
|
|
setDestroyer Sets a memory gate as the designated destroyer for this chunk, invalidating all previously registered destroyers.
|
|
|
setDestroyer Sets an allocator as the designated destroyer for this chunk, invalidating all previously registered destroyers.
|
|
|
|
|
||||||||||||
|
subChunk Creates a subchunk from the desired region of this chunk. The subchunk does not own it's memory and thus no destroyer should be installed.
|
|
||||||||||||
|
write Writes the passed chunk at the specified offset.
|
|
||||||||||||||||
|
write Writes a sample buffer to a specified offset of each channel in this chunk.
|
|
||||||||||||||||||||
|
writeChannel Writes a buffer to a specified offset of a specific channel in this chunk.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.4.4