2007-10-03 20:23:14 +00:00
|
|
|
//
|
|
|
|
// ConverterNode.h
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Zaphod Beeblebrox on 8/2/05.
|
|
|
|
// Copyright 2005 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
|
|
|
#import <AudioToolbox/AudioToolbox.h>
|
|
|
|
#import <AudioUnit/AudioUnit.h>
|
2022-02-07 05:49:27 +00:00
|
|
|
#import <CoreAudio/AudioHardware.h>
|
2007-10-03 20:23:14 +00:00
|
|
|
|
|
|
|
#import "Node.h"
|
|
|
|
|
2022-01-26 00:50:42 +00:00
|
|
|
#import "HeadphoneFilter.h"
|
|
|
|
|
2007-10-03 20:23:14 +00:00
|
|
|
@interface ConverterNode : Node {
|
2022-02-07 05:49:27 +00:00
|
|
|
NSDictionary *rgInfo;
|
|
|
|
|
2022-03-04 10:07:38 +00:00
|
|
|
void *_r8bstate;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
void *inputBuffer;
|
|
|
|
size_t inputBufferSize;
|
|
|
|
size_t inpSize, inpOffset;
|
|
|
|
|
|
|
|
BOOL stopping;
|
|
|
|
BOOL convertEntered;
|
|
|
|
BOOL paused;
|
|
|
|
|
|
|
|
BOOL skipResampler;
|
|
|
|
|
|
|
|
unsigned int PRIME_LEN_;
|
|
|
|
unsigned int N_samples_to_add_;
|
|
|
|
unsigned int N_samples_to_drop_;
|
|
|
|
|
|
|
|
unsigned int is_preextrapolated_;
|
|
|
|
unsigned int is_postextrapolated_;
|
|
|
|
|
|
|
|
int latencyEaten;
|
|
|
|
int latencyEatenPost;
|
|
|
|
|
|
|
|
double sampleRatio;
|
|
|
|
|
|
|
|
float volumeScale;
|
|
|
|
|
|
|
|
void *floatBuffer;
|
|
|
|
size_t floatBufferSize;
|
|
|
|
size_t floatSize, floatOffset;
|
|
|
|
|
|
|
|
void *extrapolateBuffer;
|
|
|
|
size_t extrapolateBufferSize;
|
|
|
|
|
|
|
|
void **dsd2pcm;
|
|
|
|
size_t dsd2pcmCount;
|
|
|
|
int dsd2pcmLatency;
|
|
|
|
|
|
|
|
BOOL rememberedLossless;
|
|
|
|
|
2007-10-03 20:23:14 +00:00
|
|
|
AudioStreamBasicDescription inputFormat;
|
2022-02-07 05:49:27 +00:00
|
|
|
AudioStreamBasicDescription floatFormat;
|
|
|
|
AudioStreamBasicDescription dmFloatFormat; // downmixed/upmixed float format
|
2007-10-03 20:23:14 +00:00
|
|
|
AudioStreamBasicDescription outputFormat;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2022-02-07 08:56:05 +00:00
|
|
|
uint32_t inputChannelConfig;
|
|
|
|
uint32_t outputChannelConfig;
|
|
|
|
|
2022-02-08 03:18:45 +00:00
|
|
|
BOOL streamFormatChanged;
|
|
|
|
AudioStreamBasicDescription newInputFormat;
|
|
|
|
uint32_t newInputChannelConfig;
|
|
|
|
|
|
|
|
AudioChunk *lastChunkIn;
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
void *hdcd_decoder;
|
|
|
|
|
|
|
|
HeadphoneFilter *hFilter;
|
2007-10-03 20:23:14 +00:00
|
|
|
}
|
|
|
|
|
2022-01-14 19:18:50 +00:00
|
|
|
@property AudioStreamBasicDescription inputFormat;
|
|
|
|
|
2013-10-11 03:02:02 +00:00
|
|
|
- (id)initWithController:(id)c previous:(id)p;
|
2013-10-07 10:59:04 +00:00
|
|
|
|
2022-02-07 08:56:05 +00:00
|
|
|
- (BOOL)setupWithInputFormat:(AudioStreamBasicDescription)inputFormat withInputConfig:(uint32_t)inputConfig outputFormat:(AudioStreamBasicDescription)outputFormat outputConfig:(uint32_t)outputConfig isLossless:(BOOL)lossless;
|
2007-10-03 20:23:14 +00:00
|
|
|
- (void)cleanUp;
|
|
|
|
|
|
|
|
- (void)process;
|
|
|
|
- (int)convert:(void *)dest amount:(int)amount;
|
|
|
|
|
2013-10-07 10:59:04 +00:00
|
|
|
- (void)setRGInfo:(NSDictionary *)rgi;
|
|
|
|
|
2022-02-07 08:56:05 +00:00
|
|
|
- (void)setOutputFormat:(AudioStreamBasicDescription)format outputConfig:(uint32_t)outputConfig;
|
2007-10-12 02:55:59 +00:00
|
|
|
|
2022-02-07 08:56:05 +00:00
|
|
|
- (void)inputFormatDidChange:(AudioStreamBasicDescription)format inputConfig:(uint32_t)inputConfig;
|
2007-10-12 02:55:59 +00:00
|
|
|
|
2013-10-07 10:59:04 +00:00
|
|
|
- (void)refreshVolumeScaling;
|
|
|
|
|
2007-10-03 20:23:14 +00:00
|
|
|
@end
|