MusicKit
0.0.0
|
Stream mixer and effects processor. More...
#import <SndStreamMixer.h>
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. | |
(NSArray *) | - clients |
Returns an NSArray of clients of the SndStreamMixer instance. | |
(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. | |
(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. | |
(NSArray *) | - clients |
Returns an NSArray of clients of the SndStreamMixer instance. | |
(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. | |
(id) | + mixer |
Factory method returning an initialized and autoreleased SndStreamMixer instance. | |
Protected Attributes | |
NSMutableArray * | streamClients |
NSLock * | streamClientsLock |
SndAudioProcessorChain * | processorChain |
double | nowTime |
double | lastNowTime |
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.
- (int) addClient: | (SndStreamClient *) | client |
Add a SndStreamClient to the mix.
If the client is already being mixed, it will not be added again.
client | A SndStreamClient instance. |
- (int) addClient: | (SndStreamClient *) | client |
Add a SndStreamClient to the mix.
If the client is already being mixed, it will not be added again.
client | A SndStreamClient instance. |
Returns the SndAudioProcessorChain applied after mixing SndStreamClients.
Returns the SndAudioProcessorChain applied after mixing SndStreamClients.
- (SndStreamClient *) clientAtIndex: | (int) | clientIndex |
Returns a given SndStreamClient being mixed, indexed by a numeric identifier.
clientIndex |
- (SndStreamClient *) clientAtIndex: | (int) | clientIndex |
Returns a given SndStreamClient being mixed, indexed by a numeric identifier.
clientIndex |
- (int) clientCount |
Returns the number of stream clients currently connected to the mixer.
- (int) clientCount |
Returns the number of stream clients currently connected to the mixer.
- (NSArray *) clients |
Returns an NSArray of clients of the SndStreamMixer instance.
- (NSArray *) clients |
Returns an NSArray of clients of the SndStreamMixer instance.
- (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.
- (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.
- (id) init |
Initializer method.
- (id) init |
Initializer method.
+ (id) mixer |
Factory method returning an initialized and autoreleased SndStreamMixer instance.
+ (id) mixer |
Factory method returning an initialized and autoreleased SndStreamMixer instance.
- (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.
inB | The input buffer filled with recorded audio. |
outB | The output buffer to fill for playback. |
t | The current now time. |
- (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.
inB | The input buffer filled with recorded audio. |
outB | The output buffer to fill for playback. |
t | The current now time. |
- (BOOL) removeClient: | (SndStreamClient *) | client |
Removes the given SndStreamClient from mixing.
client | The SndStreamClient instance to remove. |
- (BOOL) removeClient: | (SndStreamClient *) | client |
Removes the given SndStreamClient from mixing.
client | The SndStreamClient instance to remove. |
- (void) resetTime: | (double) | originTimeInSeconds |
Resets the mixer's sense of time, and pro.
originTimeInSeconds |
- (void) resetTime: | (double) | originTimeInSeconds |
Resets the mixer's sense of time, and pro.
originTimeInSeconds |
- (double) lastNowTime [protected] |
The previous time of last update from SndStreamManager.
- (double) nowTime [protected] |
The current time (in seconds) to mix up to, as updated from the SndStreamManager, passed into processInBuffer:outBuffer:nowTime.
- (SndAudioProcessorChain *) processorChain [protected] |
A chain of SndAudioProcessors that is applied after mixing all the stream clients together.
- (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.