SndStreamMixer Class Reference

Stream mixer and effects processor. More...

#import <SndStreamMixer.h>

List of all members.

Public Member Functions

(id) - init
 Initializer method.
(id) - processInBuffer:outBuffer:nowTime:
 Mixes together all clients currently exposed output buffers.
(BOOL) - removeClient:
 Removes the given SndStreamClient from mixing.
(int) - addClient:
 Add a SndStreamClient to the mix.
(void) - finishMixing
 Informs the receiver that all mixing is to be completed, that mixing clients and buffers are to be updated.
(int) - clientCount
 Returns the number of stream clients currently connected to the mixer.
(SndAudioProcessorChain *) - audioProcessorChain
 Returns the SndAudioProcessorChain applied after mixing SndStreamClients.
(void) - resetTime:
 Resets the mixer's sense of time, and pro.
(SndStreamClient *) - clientAtIndex:
 Returns a given SndStreamClient being mixed, indexed by a numeric identifier.

Static Public Member Functions

(id) + mixer
 Factory method returning an initialized and autoreleased SndStreamMixer instance.

Protected Attributes

NSMutableArray * streamClients
NSLock * streamClientsLock
SndAudioProcessorChainprocessorChain
double nowTime
double lastNowTime


Detailed Description

Stream mixer and effects processor.

The SndStreamMixer class is responsible for managing the mixing of SndAudioBuffers from all current SndStreamClients. After mixing all buffers, it can apply any signal processing to the mixed result by modifying it's SndAudioProcessorChain retrieved using audioProcessorChain.


Member Function Documentation

+ (id) mixer  

Factory method returning an initialized and autoreleased SndStreamMixer instance.

Returns:
Returns an initialized and autoreleased SndStreamMixer instance.

- (id) init  

Initializer method.

Returns:
Returns self.

- (id) processInBuffer: (SndAudioBuffer *)  inB
outBuffer: (SndAudioBuffer *)  outB
nowTime: (double)  t 

Mixes together all clients currently exposed output buffers.

After mixing all client exposed output buffers, processInBuffer:outBuffer:nowTime then applies any audio processing to the mix. Each client then receives the message startProcessingNextBufferWithInput:nowTime:, passing the input buffer, to generate the next buffer.

Parameters:
inB The input buffer filled with recorded audio.
outB The output buffer to fill for playback.
t The current now time.
Returns:
Returns self.

- (BOOL) removeClient: (SndStreamClient *)  client  

Removes the given SndStreamClient from mixing.

Parameters:
client The SndStreamClient instance to remove.
Returns:
Returns YES if client was successfully removed, NO if it was not being mixed.

- (int) addClient: (SndStreamClient *)  client  

Add a SndStreamClient to the mix.

If the client is already being mixed, it will not be added again.

Parameters:
client A SndStreamClient instance.
Returns:
Returns the new number of clients.

- (void) finishMixing  

Informs the receiver that all mixing is to be completed, that mixing clients and buffers are to be updated.

This should be sent when the manager is shutting down.

- (int) clientCount  

Returns the number of stream clients currently connected to the mixer.

Returns:
Returns the number of stream clients currently connected to the mixer.

- (SndAudioProcessorChain *) audioProcessorChain  

Returns the SndAudioProcessorChain applied after mixing SndStreamClients.

Returns:
Returns a reference to the audio processor chain.

- (void) resetTime: (double)  originTimeInSeconds  

Resets the mixer's sense of time, and pro.

Parameters:
originTimeInSeconds 

- (SndStreamClient *) clientAtIndex: (int)  clientIndex  

Returns a given SndStreamClient being mixed, indexed by a numeric identifier.

Parameters:
clientIndex 


Member Data Documentation

- (NSMutableArray*) streamClients [protected]

A modifiable array of SndStreamClients currently being mixed.

- (NSLock*) streamClientsLock [protected]

Controls access to the clients preventing their addition or removal while being mixed.

A chain of SndAudioProcessors that is applied after mixing all the stream clients together.

- (double) nowTime [protected]

The current time (in seconds) to mix up to, as updated from the SndStreamManager, passed into processInBuffer:outBuffer:nowTime.

- (double) lastNowTime [protected]

The previous time of last update from SndStreamManager.


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

Generated on Sat Dec 5 17:01:16 2009 for MusicKit by  doxygen 1.5.6