This class can more flexibly process and emit varying chunk sizes than the previous code could, solving the problem of wide tempo changes. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
40 lines
688 B
Objective-C
40 lines
688 B
Objective-C
//
|
|
// DSPNode.m
|
|
// CogAudio Framework
|
|
//
|
|
// Created by Christopher Snowhill on 2/10/25.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import "DSPNode.h"
|
|
|
|
@implementation DSPNode
|
|
|
|
- (id _Nullable)initWithController:(id _Nonnull)c previous:(id _Nullable)p latency:(double)latency {
|
|
self = [super init];
|
|
if(self) {
|
|
buffer = [[ChunkList alloc] initWithMaximumDuration:latency];
|
|
|
|
semaphore = [[Semaphore alloc] init];
|
|
|
|
accessLock = [[NSLock alloc] init];
|
|
|
|
initialBufferFilled = NO;
|
|
|
|
controller = c;
|
|
endOfStream = NO;
|
|
shouldContinue = YES;
|
|
|
|
nodeChannelConfig = 0;
|
|
nodeLossless = NO;
|
|
|
|
durationPrebuffer = latency * 0.25;
|
|
|
|
[self setPreviousNode:p];
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
@end
|