2022-02-06 11:08:34 +00:00
|
|
|
//
|
|
|
|
// ChunkList.h
|
|
|
|
// CogAudio Framework
|
|
|
|
//
|
|
|
|
// Created by Christopher Snowhill on 2/5/22.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <CoreAudio/CoreAudio.h>
|
2022-02-07 05:49:27 +00:00
|
|
|
#import <Foundation/Foundation.h>
|
2022-02-06 11:08:34 +00:00
|
|
|
|
|
|
|
#import "AudioChunk.h"
|
|
|
|
|
|
|
|
#import "Semaphore.h"
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
@interface ChunkList : NSObject {
|
2022-02-07 05:49:27 +00:00
|
|
|
NSMutableArray<AudioChunk *> *chunkList;
|
|
|
|
double listDuration;
|
|
|
|
double maxDuration;
|
|
|
|
|
|
|
|
BOOL inAdder;
|
|
|
|
BOOL inRemover;
|
|
|
|
BOOL stopping;
|
2022-02-06 11:08:34 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
@property(readonly) double listDuration;
|
|
|
|
@property(readonly) double maxDuration;
|
2022-02-06 11:08:34 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (id)initWithMaximumDuration:(double)duration;
|
2022-02-06 11:08:34 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (void)reset;
|
2022-02-06 11:08:34 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (BOOL)isEmpty;
|
|
|
|
- (BOOL)isFull;
|
2022-02-06 11:08:34 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (void)addChunk:(AudioChunk *)chunk;
|
|
|
|
- (AudioChunk *)removeSamples:(size_t)maxFrameCount;
|
2022-02-06 11:08:34 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|