Superclasses :
none
Subclasses :
none
Header : AUBuffer
class AUBufferList
AUBufferList is a container for managing AudioBufferLists.
Methods
Allocation
void Allocate(
const CAStreamBasicDescription& format,
UInt32 nFrames
);
Allocates buffer space large enough for the number of stream/channels specified in the
format and the number of frames requested.
void Deallocate();
Frees the buffer space. The streams are not freed.
UInt32 GetAllocatedFrames() const;
Returns the number of frames allocated for internal buffer space.
Constructor
AUBufferList(AUBufferList &);
Destructor
|
public nonvirtual destructor
|
~AUBufferList();
Frees all buffer space and streams.
Other
void CopyBufferContentsTo(AudioBufferList &abl) const;
Copy the contents of the buffers to another AudioBufferList.
void CopyBufferListTo(AudioBufferList &abl) const;
Copy the buffer list pointers to another AudioBufferList.
AudioBufferList& GetBufferList();
Returns a reference to the contained AudioBufferList.
void InvalidateBufferList();
Mark the buffer pointers as invalid. Attempts to access the buffers after this will fail until
PrepareBuffer, PrepareNullBuffer, or SetBufferList is called.
AudioBufferList& PrepareBuffer(
const CAStreamBasicDescription& format,
UInt32 nFrames
);
Sets the buffer formats in the buffer list to the desired format and partitions the already
allocated buffer memory accordingly.
AudioBufferList& PrepareNullBuffer(
const CAStreamBasicDescription& format,
UInt32 nFrames
);
static void PrintBuffer(
const char* label,
int subscript,
const AudioBufferList& abl,
UInt32 nFrames = 8,
bool asFloats = true
);
Print the buffer contents for debugging purposes. Assumes floating point format.
void SetBuffer(
UInt32 index,
const AudioBuffer& ab
);
AudioBufferList& SetBufferList(const AudioBufferList &abl);
Sets the AUBufferList to use another AudioBufferList for its buffers.
This is often used for reusing input buffers as output buffers in order to optimize cache usage.
void UseExternalBuffer(
const CAStreamBasicDescription& format,
const AudioUnitExternalBuffer& buf
);
Sets the buffer to use memory not owned by itself.
This memory will not be freed by Deallocate or the destructor.
static void ZeroBuffer(AudioBufferList &abl);
Fill buffers with zero. Usually used in a Render routine to fill output buffers with silence before mixing into them.
Data
Other
|
private instance variable
|
UInt32 mAllocatedBytes;
Number of bytes allocated for buffer memory.
|
private instance variable
|
UInt32 mAllocatedFrames;
Number of frames allocated for buffer memory.
|
private instance variable
|
UInt32 mAllocatedStreams;
Number of streams allocated.
|
private instance variable
|
bool mExternalMemory;
True if mMemory is not owned by this object.
|
private instance variable
|
Byte* mMemory;
The pointer to buffer space.
|
private instance variable
|
EPtrState mPtrState;
Whether the buffer list is invalid, external, or internal.
|
private instance variable
|
AudioBufferList* mPtrs;
An array of pointers to the AudioBufferLists.