00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00015 #ifndef __SNDSTREAMCLIENT__
00016 #define __SNDSTREAMCLIENT__
00017
00018 #import <Foundation/Foundation.h>
00019
00020 enum {
00021 OB_notInit,
00022 OB_isInit
00023 };
00024
00025 @class SndAudioBuffer;
00026 @class SndAudioBufferQueue;
00027 @class SndStreamManager;
00028 @class SndAudioProcessorChain;
00029
00030 #ifdef __MINGW32__
00031 # import "SndConditionLock.h"
00032 # define NSConditionLock SndConditionLock
00033 #endif
00034
00036
00038
00044 @protocol SndStreamClientDelegate
00045
00050 - inputBufferSkipped: (id) sender;
00051
00056 - outputBufferSkipped: (id) sender;
00057
00062 - didProcessStreamBuffer: (id) sender;
00063
00064 @end
00065
00067
00069
00078 @interface SndStreamClient : NSObject
00079 {
00081 SndAudioBuffer *exposedOutputBuffer;
00083 SndAudioBuffer *synthOutputBuffer;
00085 SndAudioBuffer *synthInputBuffer;
00087 SndAudioBufferQueue *outputQueue;
00089 SndAudioBufferQueue *inputQueue;
00090
00092 NSConditionLock *synthThreadLock;
00094 NSConditionLock *outputBufferLock;
00095
00097 BOOL active;
00099 BOOL needsInput;
00101 BOOL generatesOutput;
00103 SndAudioProcessorChain *processorChain;
00105 SndStreamManager *manager;
00107 id delegate;
00109 double clientNowTime;
00113 double lastManagerTime;
00114
00116 NSString *clientName;
00117
00118 @private
00120 BOOL delegateRespondsToOutputBufferSkipSelector;
00122 BOOL delegateRespondsToInputBufferSkipSelector;
00124 BOOL delegateRespondsToDidProcessBufferSelector;
00126 BOOL bDisconnect;
00127 }
00128
00133 + streamClient;
00134
00140 - freeBufferMem;
00141
00148 - (NSString *) description;
00149
00162 - welcomeClientWithBuffer: (SndAudioBuffer *) buff manager: (SndStreamManager *) m;
00163
00179 - startProcessingNextBufferWithInput: (SndAudioBuffer *) inB nowTime: (double) t;
00180
00188 - (double) preemptQueuedStream;
00189
00193 - (void) processingThread;
00194
00201 - (SndAudioBuffer *) outputBuffer;
00202
00209 - (SndAudioBuffer *) synthOutputBuffer;
00210
00217 - (SndAudioBuffer *) synthInputBuffer;
00218
00225 - managerIsShuttingDown;
00226
00240 - (void) processBuffers;
00241
00258 - (double) synthesisTime;
00259
00264 - (void) resetTime: (double) originTimeInSeconds;
00265
00280 - (double) streamTime;
00281
00286 - (BOOL) isActive;
00287
00294 - setDetectPeaks: (BOOL) detectPeaks;
00295
00304 - getPeakLeft: (float *) leftPeak right: (float *) rightPeak;
00305
00310 - (BOOL) generatesOutput;
00311
00316 - (BOOL) needsInput;
00317
00326 - setGeneratesOutput: (BOOL) b;
00327
00341 - setNeedsInput: (BOOL) b;
00342
00351 - setManager: (SndStreamManager *) m;
00352
00360 - lockOutputBuffer;
00361
00366 - unlockOutputBuffer;
00367
00376 - prepareToStreamWithBuffer: (SndAudioBuffer *) buff;
00377
00385 - didFinishStreaming;
00386
00391 - (SndAudioProcessorChain *) audioProcessorChain;
00392
00397 - (void) setAudioProcessorChain: (SndAudioProcessorChain *) newAudioProcessorChain;
00398
00404 - (void) setDelegate: (id) d;
00405
00410 - (id) delegate;
00411
00415 - (int) inputBufferCount;
00416
00420 - (int) outputBufferCount;
00421
00427 - (BOOL) setInputBufferCount: (int) n;
00428
00434 - (BOOL) setOutputBufferCount: (int) n;
00435
00442 - (double) outputLatencyInSeconds;
00443
00450 - (long) outputLatencyInSamples;
00451
00456 - (NSString *) clientName;
00457
00466 - setClientName: (NSString *) name;
00467
00473 - offlineProcessBuffer: (SndAudioBuffer *) anAudioBuffer nowTime: (double) t;
00474
00475 @end
00476
00478
00479 #endif