AUBufferList

Superclasses : none
Subclasses : none
Header : AUBuffer

class AUBufferList 

AUBufferList is a container for managing AudioBufferLists.


Methods

Allocation


Allocate

public nonvirtual method


 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.



Deallocate

public nonvirtual method


 void Deallocate();

Frees the buffer space. The streams are not freed.



GetAllocatedFrames

public nonvirtual method


 UInt32 GetAllocatedFrames() const;

Returns the number of frames allocated for internal buffer space.



Constructor


AUBufferList

private constructor


 AUBufferList(AUBufferList &);



Destructor


~AUBufferList

public nonvirtual destructor


 ~AUBufferList();

Frees all buffer space and streams.



Other


CopyBufferContentsTo

public nonvirtual method


 void CopyBufferContentsTo(AudioBufferList &abl) const;

Copy the contents of the buffers to another AudioBufferList.



CopyBufferListTo

public nonvirtual method


 void CopyBufferListTo(AudioBufferList &abl) const;

Copy the buffer list pointers to another AudioBufferList.



GetBufferList

public nonvirtual method


 AudioBufferList& GetBufferList();

Returns a reference to the contained AudioBufferList.



InvalidateBufferList

public nonvirtual method


 void InvalidateBufferList();

Mark the buffer pointers as invalid. Attempts to access the buffers after this will fail until PrepareBuffer, PrepareNullBuffer, or SetBufferList is called.



PrepareBuffer

public nonvirtual method


 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.



PrepareNullBuffer

public nonvirtual method


 AudioBufferList& PrepareNullBuffer(
          const CAStreamBasicDescription& format,
          UInt32                          nFrames
    );



PrintBuffer

public static method


 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.



SetBuffer

public nonvirtual method


 void SetBuffer(
          UInt32                          index,
          const AudioBuffer&              ab
    );



SetBufferList

public nonvirtual method


 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.



UseExternalBuffer

public nonvirtual method


 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.



ZeroBuffer

public static method


 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


mAllocatedBytes

private instance variable


 UInt32 mAllocatedBytes;

Number of bytes allocated for buffer memory.



mAllocatedFrames

private instance variable


 UInt32 mAllocatedFrames;

Number of frames allocated for buffer memory.



mAllocatedStreams

private instance variable


 UInt32 mAllocatedStreams;

Number of streams allocated.



mExternalMemory

private instance variable


 bool mExternalMemory;

True if mMemory is not owned by this object.



mMemory

private instance variable


 Byte* mMemory;

The pointer to buffer space.



mPtrState

private instance variable


 EPtrState mPtrState;

Whether the buffer list is invalid, external, or internal.



mPtrs

private instance variable


 AudioBufferList* mPtrs;

An array of pointers to the AudioBufferLists.