Cog/Audio/Chain/BufferChain.h
Christopher Snowhill 120a93465e [Metadata Handling] Fix dynamic info updates
Ensure that dynamic info updates, even on static files, only update the
exact track they apply to, by atomically assigning the userInfo property
before opening the decoder, so that callbacks to the player indicate the
correct track and don't assume it's the one that's currently visibly
playing. Fixes start of track metadata notifications from overwriting
the previously playing track.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-12 19:43:41 -07:00

85 lines
1.9 KiB
Objective-C

//
// BufferChain.h
// CogNew
//
// Created by Vincent Spader on 1/4/06.
// Copyright 2006 Vincent Spader. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "AudioPlayer.h"
#import "ConverterNode.h"
#import "InputNode.h"
@interface BufferChain : NSObject {
InputNode *inputNode;
ConverterNode *converterNode;
NSURL *streamURL;
id userInfo;
NSDictionary *rgInfo;
id finalNode; // Final buffer in the chain.
id controller;
}
- (id)initWithController:(id)c;
- (void)buildChain;
- (BOOL)open:(NSURL *)url withOutputFormat:(AudioStreamBasicDescription)outputFormat withOutputConfig:(uint32_t)outputConfig withUserInfo:(id)userInfo withRGInfo:(NSDictionary *)rgi;
// Used when changing tracks to reuse the same decoder
- (BOOL)openWithInput:(InputNode *)i withOutputFormat:(AudioStreamBasicDescription)outputFormat withOutputConfig:(uint32_t)outputConfig withUserInfo:(id)userInfo withRGInfo:(NSDictionary *)rgi;
// Used when resetting the decoder on seek
- (BOOL)openWithDecoder:(id<CogDecoder>)decoder
withOutputFormat:(AudioStreamBasicDescription)outputFormat
withOutputConfig:(uint32_t)outputConfig
withUserInfo:(id)userInfo
withRGInfo:(NSDictionary *)rgi;
- (void)seek:(double)time;
- (void)launchThreads;
- (InputNode *)inputNode;
- (id)finalNode;
- (id)userInfo;
- (void)setUserInfo:(id)i;
- (NSDictionary *)rgInfo;
- (void)setRGInfo:(NSDictionary *)rgi;
- (NSURL *)streamURL;
- (void)setStreamURL:(NSURL *)url;
- (void)setShouldContinue:(BOOL)s;
- (void)initialBufferFilled:(id)sender;
- (BOOL)endOfInputReached;
- (BOOL)setTrack:(NSURL *)track;
- (BOOL)isRunning;
- (id)controller;
- (ConverterNode *)converter;
- (AudioStreamBasicDescription)inputFormat;
- (uint32_t)inputConfig;
- (double)secondsBuffered;
- (void)sustainHDCD;
- (void)restartPlaybackAtCurrentPosition;
- (void)pushInfo:(NSDictionary *)info;
- (void)setError:(BOOL)status;
@end