Cog/Audio/Chain/RefillNode.m
Christopher Snowhill 62edb39761 Cog Audio: Major rewrite of audio buffering
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>
2022-02-06 03:08:34 -08:00

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