Rewrite attempt number two. Now using array lists of audio chunks, with each chunk having its format and optionally losslessness stashed along with it. This replaces the old virtual ring buffer method. As a result of this, the HRIR toggle now works instantaneously. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
49 lines
882 B
Objective-C
49 lines
882 B
Objective-C
//
|
|
// RefillNode.m
|
|
// Cog
|
|
//
|
|
// Created by Christopher Snowhill on 1/13/22.
|
|
// Copyright 2022 __LoSnoCo__. All rights reserved.
|
|
//
|
|
|
|
#import "Plugin.h"
|
|
#import "RefillNode.h"
|
|
|
|
#import "Logging.h"
|
|
|
|
@implementation RefillNode
|
|
|
|
- (id)initWithController:(id)c previous:(id)p
|
|
{
|
|
self = [super init];
|
|
if (self)
|
|
{
|
|
// This special node should be able to handle up to four buffers
|
|
buffer = [[ChunkList alloc] initWithMaximumDuration:12.0];
|
|
semaphore = [[Semaphore alloc] init];
|
|
|
|
initialBufferFilled = NO;
|
|
|
|
controller = c;
|
|
endOfStream = NO;
|
|
shouldContinue = YES;
|
|
|
|
nodeLossless = NO;
|
|
|
|
[self setPreviousNode:p];
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
- (void)dealloc
|
|
{
|
|
DLog(@"Refill Node dealloc");
|
|
}
|
|
|
|
- (void)setFormat:(AudioStreamBasicDescription)format
|
|
{
|
|
nodeFormat = format;
|
|
}
|
|
|
|
@end
|