00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00015 #ifndef __SNDAUDIOBUFFERQUEUE_H__
00016 #define __SNDAUDIOBUFFERQUEUE_H__
00017
00018 #import <Foundation/Foundation.h>
00019
00020 #ifdef __MINGW32__
00021 # import "SndConditionLock.h"
00022 # define NSConditionLock SndConditionLock
00023 #endif
00024
00025 @class SndAudioBuffer;
00026
00032 typedef enum {
00033 audioBufferQueue_typeInput,
00034 audioBufferQueue_typeOutput
00035 } SndAudioBufferQueueType;
00036
00043 @interface SndAudioBufferQueue : NSObject
00044 {
00046 NSMutableArray *pendingBuffers;
00048 NSMutableArray *processedBuffers;
00050 NSConditionLock *pendingBuffersLock;
00052 NSConditionLock *processedBuffersLock;
00054 int numBuffers;
00055 }
00056
00064 + audioBufferQueueWithLength: (int) n;
00065
00066 - init;
00067 - (void) dealloc;
00068 - (NSString*) description;
00069
00080 - initQueueWithLength: (int) n;
00081
00089 - (SndAudioBuffer*) popNextPendingBuffer;
00090
00098 - (SndAudioBuffer*) popNextProcessedBuffer;
00099
00105 - addPendingBuffer: (SndAudioBuffer*) audioBuffer;
00106
00112 - addProcessedBuffer: (SndAudioBuffer*) audioBuffer;
00113
00117 - (void) cancelProcessedBuffers;
00118
00122 - (int) pendingBuffersCount;
00123
00127 - (int) processedBuffersCount;
00128
00133 - freeBuffers;
00134
00148 - prepareQueueAsType: (SndAudioBufferQueueType) type withBufferPrototype: (SndAudioBuffer*) buff;
00149
00154 - (int) bufferCount;
00155
00156 @end
00157
00158 #endif