Cog/Audio/Chain/Node.h
Christopher Snowhill 637ea4efe1 Core Audio output: Rewrote major portions
After all this rewriting, down or upmixing the audio is now handled with
the lowest latency possible, meaning that toggling the HRIR option now
takes effect immediately.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-05 03:45:02 -08:00

66 lines
1.3 KiB
Objective-C

//
// Node.h
// CogNew
//
// Created by Vincent Spader on 1/4/06.
// Copyright 2006 Vincent Spader. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <CoreAudio/CoreAudio.h>
#import "VirtualRingBuffer.h"
#import "Semaphore.h"
#define BUFFER_SIZE 1024 * 1024
#define CHUNK_SIZE 16 * 1024
@interface Node : NSObject {
VirtualRingBuffer *buffer;
Semaphore *semaphore;
id __weak previousNode;
id __weak controller;
BOOL shouldReset;
BOOL shouldContinue;
BOOL endOfStream; //All data is now in buffer
BOOL initialBufferFilled;
AudioStreamBasicDescription nodeFormat;
}
@property (readonly) AudioStreamBasicDescription nodeFormat;
- (id)initWithController:(id)c previous:(id)p;
- (int)writeData:(void *)ptr amount:(int)a;
- (int)readData:(void *)ptr amount:(int)a;
- (void)process; //Should be overwriten by subclass
- (void)threadEntry:(id)arg;
- (void)launchThread;
- (void)setShouldReset:(BOOL)s;
- (BOOL)shouldReset;
- (void)setPreviousNode:(id)p;
- (id)previousNode;
- (BOOL)shouldContinue;
- (void)setShouldContinue:(BOOL)s;
- (VirtualRingBuffer *)buffer;
- (void)resetBuffer; //WARNING! DANGER WILL ROBINSON!
- (Semaphore *)semaphore;
//-(void)resetBuffer;
- (BOOL)endOfStream;
- (void)setEndOfStream:(BOOL)e;
- (double)secondsBuffered;
@end