cog/Audio/Chain/Node.h

71 lines
1.3 KiB
C
Raw Normal View History

2006-01-20 15:34:02 +00:00
//
// Node.h
2006-01-20 15:34:02 +00:00
// CogNew
//
// Created by Vincent Spader on 1/4/06.
// Copyright 2006 Vincent Spader. All rights reserved.
2006-01-20 15:34:02 +00:00
//
#import "ChunkList.h"
2006-01-20 15:34:02 +00:00
#import "Semaphore.h"
#import <Cocoa/Cocoa.h>
2006-01-20 15:34:02 +00:00
#define BUFFER_SIZE 1024 * 1024
2006-01-20 15:34:02 +00:00
#define CHUNK_SIZE 16 * 1024
@interface Node : NSObject {
ChunkList *buffer;
Semaphore *semaphore;
NSRecursiveLock *accessLock;
id __weak previousNode;
id __weak controller;
BOOL shouldReset;
BOOL shouldContinue;
BOOL endOfStream; // All data is now in buffer
BOOL initialBufferFilled;
AudioStreamBasicDescription nodeFormat;
uint32_t nodeChannelConfig;
BOOL nodeLossless;
2006-01-20 15:34:02 +00:00
}
- (id)initWithController:(id)c previous:(id)p;
2006-01-20 15:34:02 +00:00
- (void)writeData:(const void *)ptr amount:(size_t)a;
- (AudioChunk *)readChunk:(size_t)maxFrames;
2006-01-20 15:34:02 +00:00
- (void)process; // Should be overwriten by subclass
2006-01-20 15:34:02 +00:00
- (void)threadEntry:(id)arg;
- (void)launchThread;
- (void)setShouldReset:(BOOL)s;
- (BOOL)shouldReset;
- (void)setPreviousNode:(id)p;
2006-01-20 15:34:02 +00:00
- (id)previousNode;
- (BOOL)shouldContinue;
- (void)setShouldContinue:(BOOL)s;
- (ChunkList *)buffer;
- (void)resetBuffer; // WARNING! DANGER WILL ROBINSON!
2006-01-20 15:34:02 +00:00
- (AudioStreamBasicDescription)nodeFormat;
- (uint32_t)nodeChannelConfig;
- (BOOL)nodeLossless;
2006-01-20 15:34:02 +00:00
- (Semaphore *)semaphore;
//-(void)resetBuffer;
- (BOOL)endOfStream;
- (void)setEndOfStream:(BOOL)e;
2006-01-20 15:34:02 +00:00
- (double)secondsBuffered;
2006-01-20 15:34:02 +00:00
@end