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>
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
#import "AudioPlayer.h"
|
2022-02-07 05:49:27 +00:00
|
|
|
#import "ConverterNode.h"
|
|
|
|
#import "InputNode.h"
|
2006-01-20 15:34:02 +00:00
|
|
|
|
|
|
|
@interface BufferChain : NSObject {
|
|
|
|
InputNode *inputNode;
|
2007-10-03 20:23:14 +00:00
|
|
|
ConverterNode *converterNode;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
NSURL *streamURL;
|
|
|
|
id userInfo;
|
2022-02-07 05:49:27 +00:00
|
|
|
NSDictionary *rgInfo;
|
|
|
|
|
|
|
|
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
|
|
|
|
2022-02-07 08:56:05 +00:00
|
|
|
- (BOOL)open:(NSURL *)url withOutputFormat:(AudioStreamBasicDescription)outputFormat withOutputConfig:(uint32_t)outputConfig withRGInfo:(NSDictionary *)rgi;
|
2007-10-11 02:08:29 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
// Used when changing tracks to reuse the same decoder
|
2022-02-07 08:56:05 +00:00
|
|
|
- (BOOL)openWithInput:(InputNode *)i withOutputFormat:(AudioStreamBasicDescription)outputFormat withOutputConfig:(uint32_t)outputConfig withRGInfo:(NSDictionary *)rgi;
|
2007-10-11 02:08:29 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
// Used when resetting the decoder on seek
|
2021-12-26 10:01:02 +00:00
|
|
|
- (BOOL)openWithDecoder:(id<CogDecoder>)decoder
|
2022-02-07 05:49:27 +00:00
|
|
|
withOutputFormat:(AudioStreamBasicDescription)outputFormat
|
2022-02-07 08:56:05 +00:00
|
|
|
withOutputConfig:(uint32_t)outputConfig
|
2022-02-07 05:49:27 +00:00
|
|
|
withRGInfo:(NSDictionary *)rgi;
|
2021-12-26 10:01:02 +00:00
|
|
|
|
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;
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (NSDictionary *)rgInfo;
|
2013-10-02 09:30:04 +00:00
|
|
|
- (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
|
|
|
|
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-02-07 08:56:05 +00:00
|
|
|
- (uint32_t)inputConfig;
|
2021-12-26 07:41:45 +00:00
|
|
|
|
2022-01-14 07:05:32 +00:00
|
|
|
- (double)secondsBuffered;
|
|
|
|
|
2022-01-19 10:08:57 +00:00
|
|
|
- (void)sustainHDCD;
|
|
|
|
|
2006-01-20 15:34:02 +00:00
|
|
|
@end
|