Inherits from NSObject
Conforms to ALSoundSource
Declared in ALChannelSource.h

Overview

A Sound source composed of other sources. Property values are applied to all sources within the channel.
Sounds will get played by any free sources within this channel.
If all sources are busy when playback is requested, it will attempt to interrupt a source to free it for playback.

Properties

context

This source’s owning context.

@property (nonatomic, readonly, retain) ALContext *context

Declared In

ALChannelSource.h

reservedSources

The number of sources reserved by this channel.

@property (nonatomic, readwrite, assign) int reservedSources

Declared In

ALChannelSource.h

sourcePool

All sources being used by this channel. Do not modify!

@property (nonatomic, readonly, retain) ALSoundSourcePool *sourcePool

Declared In

ALChannelSource.h

Class Methods

channelWithSources:

Create a channel with a number of sources.

+ (id)channelWithSources:(int)reservedSources

Parameters

reservedSources

the number of sources to reserve for this channel.

Return Value

A new channel.

Declared In

ALChannelSource.h

Instance Methods

addChannel:

Absorb another channel’s sources into this one. All of the channel’s sources will be moved into this channel.

- (void)addChannel:(ALChannelSource *)channel

Parameters

channel

The channel to absorb sources from.

Declared In

ALChannelSource.h

addSource:

Add a source to this channel.

- (void)addSource:(id<ALSoundSource>)source

Parameters

source

The source to add.

Declared In

ALChannelSource.h

clearUnusedBuffers

Set all buffers in all non-playing sources to nil.

- (NSArray *)clearUnusedBuffers

Return Value

A list of buffers that were cleared.

Declared In

ALChannelSource.h

initWithSources:

Initialize a channel with a number of sources.

- (id)initWithSources:(int)reservedSources

Parameters

reservedSources

the number of sources to reserve for this channel.

Return Value

The initialized channel.

Declared In

ALChannelSource.h

removeBuffersNamed:

Remove all instances of the specified buffer.

- (BOOL)removeBuffersNamed:(NSString *)name

Parameters

name

The name of the buffer.

Return Value

NO if any of the matching buffers are currently being played.

Declared In

ALChannelSource.h

removeSource:

Remove a source from the channel.

- (id<ALSoundSource>)removeSource:(id<ALSoundSource>)source

Parameters

source

The source to remove. If nil, remove any source.

Return Value

The source that was removed.

Declared In

ALChannelSource.h

resetToDefault

Reset all sources in this channel to their default state.

- (void)resetToDefault

Declared In

ALChannelSource.h

setDefaultsFromSource:

Set this channel’s default values from those in the specified source.

- (void)setDefaultsFromSource:(id<ALSoundSource>)source

Parameters

source

the source to set default values from.

Declared In

ALChannelSource.h

splitChannelWithSources:

Split the specified number of sources from this channel, creating a new channel.

- (ALChannelSource *)splitChannelWithSources:(int)numSources

Parameters

numSources

The number of sources to split off

Return Value

A new channel with the split-off sources.

Declared In

ALChannelSource.h