2006-01-20 15:34:02 +00:00
|
|
|
//
|
2006-04-02 15:44:08 +00:00
|
|
|
// BufferChain.h
|
2006-01-20 15:34:02 +00:00
|
|
|
// CogNew
|
|
|
|
//
|
2006-09-04 18:46:18 +00:00
|
|
|
// Created by Vincent Spader on 1/4/06.
|
|
|
|
// Copyright 2006 Vincent Spader. All rights reserved.
|
2006-01-20 15:34:02 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
|
|
|
#import "InputNode.h"
|
2007-10-03 20:23:14 +00:00
|
|
|
#import "ConverterNode.h"
|
2007-02-24 20:36:27 +00:00
|
|
|
#import "AudioPlayer.h"
|
2006-01-20 15:34:02 +00:00
|
|
|
|
|
|
|
@interface BufferChain : NSObject {
|
|
|
|
InputNode *inputNode;
|
2007-10-03 20:23:14 +00:00
|
|
|
ConverterNode *converterNode;
|
2021-12-26 07:41:45 +00:00
|
|
|
|
2021-12-26 10:01:02 +00:00
|
|
|
AudioStreamBasicDescription inputFormat;
|
2006-04-13 02:51:22 +00:00
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
NSURL *streamURL;
|
|
|
|
id userInfo;
|
2013-10-02 09:30:04 +00:00
|
|
|
NSDictionary *rgInfo;
|
2006-01-20 15:34:02 +00:00
|
|
|
|
|
|
|
id finalNode; //Final buffer in the chain.
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
id controller;
|
2006-01-20 15:34:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id)initWithController:(id)c;
|
|
|
|
- (void)buildChain;
|
2007-10-11 02:08:29 +00:00
|
|
|
|
2013-10-07 20:03:34 +00:00
|
|
|
- (BOOL)open:(NSURL *)url withOutputFormat:(AudioStreamBasicDescription)outputFormat withRGInfo:(NSDictionary*)rgi;
|
2007-10-11 02:08:29 +00:00
|
|
|
|
|
|
|
//Used when changing tracks to reuse the same decoder
|
2013-10-07 20:03:34 +00:00
|
|
|
- (BOOL)openWithInput:(InputNode *)i withOutputFormat:(AudioStreamBasicDescription)outputFormat withRGInfo:(NSDictionary*)rgi;
|
2007-10-11 02:08:29 +00:00
|
|
|
|
2021-12-26 10:01:02 +00:00
|
|
|
//Used when resetting the decoder on seek
|
|
|
|
- (BOOL)openWithDecoder:(id<CogDecoder>)decoder
|
|
|
|
withOutputFormat:(AudioStreamBasicDescription)outputFormat
|
|
|
|
withRGInfo:(NSDictionary*)rgi;
|
|
|
|
|
2006-04-02 20:03:12 +00:00
|
|
|
- (void)seek:(double)time;
|
2006-01-20 15:34:02 +00:00
|
|
|
|
|
|
|
- (void)launchThreads;
|
|
|
|
|
2007-10-11 02:08:29 +00:00
|
|
|
- (InputNode *)inputNode;
|
|
|
|
|
2006-01-20 15:34:02 +00:00
|
|
|
- (id)finalNode;
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
- (id)userInfo;
|
|
|
|
- (void)setUserInfo:(id)i;
|
|
|
|
|
2013-10-02 09:30:04 +00:00
|
|
|
- (NSDictionary*)rgInfo;
|
|
|
|
- (void)setRGInfo:(NSDictionary *)rgi;
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
- (NSURL *)streamURL;
|
2007-03-02 01:36:52 +00:00
|
|
|
- (void)setStreamURL:(NSURL *)url;
|
2007-02-24 20:36:27 +00:00
|
|
|
|
|
|
|
- (void)setShouldContinue:(BOOL)s;
|
|
|
|
|
2007-10-12 02:55:59 +00:00
|
|
|
- (void)initialBufferFilled:(id)sender;
|
2007-03-19 00:19:47 +00:00
|
|
|
|
2007-10-11 02:08:29 +00:00
|
|
|
- (BOOL)endOfInputReached;
|
|
|
|
- (BOOL)setTrack:(NSURL *)track;
|
2007-02-24 20:36:27 +00:00
|
|
|
|
2007-10-12 02:55:59 +00:00
|
|
|
- (void)inputFormatDidChange:(AudioStreamBasicDescription)format;
|
|
|
|
|
2013-10-12 20:52:58 +00:00
|
|
|
- (BOOL)isRunning;
|
|
|
|
|
2013-10-21 05:04:09 +00:00
|
|
|
- (id)controller;
|
|
|
|
|
2021-12-26 07:41:45 +00:00
|
|
|
- (ConverterNode *)converter;
|
|
|
|
- (AudioStreamBasicDescription)inputFormat;
|
|
|
|
|
2022-01-14 07:05:32 +00:00
|
|
|
- (double)secondsBuffered;
|
|
|
|
|
2006-01-20 15:34:02 +00:00
|
|
|
@end
|