SuperpoweredSDK  v2.0.1
Superpowered Audio SDK
Superpowered::AudiobufferPool Class Reference

Manages a global audio buffer pool, reducing the number of memory allocation requests, increasing efficiency of audio applications. More...

#include "SuperpoweredAudioBuffers.h"

Static Public Member Functions

static void * getBuffer (unsigned int sizeBytes)
 Creates a buffer with retain count set to 1, similar to an NSObject in Objective-C. More...
 
static void initialize ()
 Initializes the buffer pool. More...
 
static void releaseBuffer (void *buffer)
 Release a buffer, similar to an NSObject in Objective-C (decreases the retain count by 1, the memory will be freed after retain count reaches 0). More...
 
static void retainBuffer (void *buffer)
 Retains a buffer, similar to Objective-C (increases the retain count by 1, similar to an NSObject in Objective-C). More...
 

Private Member Functions

 AudiobufferPool (const AudiobufferPool &)
 
AudiobufferPooloperator= (const AudiobufferPool &)
 

Private Attributes

bufferPoolInternals * internals
 

Detailed Description

Manages a global audio buffer pool, reducing the number of memory allocation requests, increasing efficiency of audio applications.

Check the offline example project on how to use.

Constructor & Destructor Documentation

◆ AudiobufferPool()

Superpowered::AudiobufferPool::AudiobufferPool ( const AudiobufferPool )
private

Member Function Documentation

◆ getBuffer()

static void* Superpowered::AudiobufferPool::getBuffer ( unsigned int  sizeBytes)
static

Creates a buffer with retain count set to 1, similar to an NSObject in Objective-C.

Use releaseBuffer() to release. This method never blocks, never locks, is very fast and safe to use in a realtime thread. Can be called concurrently on any thread.

Returns
The buffer.
Parameters
sizeBytesThe requested buffer's size in bytes. Maximum: 8388608 (8 MB).

◆ initialize()

static void Superpowered::AudiobufferPool::initialize ( )
static

Initializes the buffer pool.

◆ operator=()

AudiobufferPool& Superpowered::AudiobufferPool::operator= ( const AudiobufferPool )
private

◆ releaseBuffer()

static void Superpowered::AudiobufferPool::releaseBuffer ( void *  buffer)
static

Release a buffer, similar to an NSObject in Objective-C (decreases the retain count by 1, the memory will be freed after retain count reaches 0).

This method never blocks, never locks, is very fast and safe to use in a realtime thread. Can be called concurrently on any thread.

Parameters
bufferThe buffer.

◆ retainBuffer()

static void Superpowered::AudiobufferPool::retainBuffer ( void *  buffer)
static

Retains a buffer, similar to Objective-C (increases the retain count by 1, similar to an NSObject in Objective-C).

This method never blocks, never locks, is very fast and safe to use in a realtime thread. Can be called concurrently on any thread.

Parameters
bufferThe buffer.

Member Data Documentation

◆ internals

bufferPoolInternals* Superpowered::AudiobufferPool::internals
private

The documentation for this class was generated from the following file: