ObjectAL  2.1
ObjectAL API Reference (iOS) for Kobold2D developers
ALSoundSourcePool Class Reference

A pool of sound sources, which can be fetched based on availability. More...

#include <ALSoundSourcePool.h>

Collaboration diagram for ALSoundSourcePool:

List of all members.

Public Member Functions

void addSource: (id< ALSoundSource > source)
 Add a source to this pool.
void removeSource: (id< ALSoundSource > source)
 Remove a source from this pool.
id< ALSoundSourcegetFreeSource: (bool attemptToInterrupt)
 Acquire a free or freeable source from this pool.

Static Public Member Functions

id pool ()
 Make a new pool.

Protected Attributes

NSMutableArray * sources
 All sources managed by this pool (id<ALSoundSource>).

Properties

NSArray * sources
 All sources managed by this pool (id<ALSoundSource>).

Detailed Description

A pool of sound sources, which can be fetched based on availability.


Member Function Documentation

void ALSoundSourcePool::addSource: ( id<ALSoundSource source) [virtual]

Add a source to this pool.

Parameters:
sourceThe source to add.
id< ALSoundSource > ALSoundSourcePool::getFreeSource: ( bool  attemptToInterrupt) [virtual]

Acquire a free or freeable source from this pool.

It first attempts to find a completely free source. Failing this, it will attempt to interrupt a source and return that (if attemptToInterrupt is TRUE).

Parameters:
attemptToInterruptIf TRUE, attempt to interrupt sources to free them for use.
Returns:
The freed sound source, or nil if no sources are freeable.
id ALSoundSourcePool::pool ( ) [static, virtual]

Make a new pool.

Returns:
A new pool.
void ALSoundSourcePool::removeSource: ( id<ALSoundSource source) [virtual]

Remove a source from this pool.

Parameters:
sourceThe source to remove.

Member Data Documentation

NSMutableArray* ALSoundSourcePool::sources [protected]

All sources managed by this pool (id<ALSoundSource>).


Property Documentation

NSArray* ALSoundSourcePool::sources [read, assign]

All sources managed by this pool (id<ALSoundSource>).


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