2007-10-03 16:23:14 -04: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 02:49:27 -03:00
|
|
|
#import <CoreAudio/AudioHardware.h>
|
2007-10-03 16:23:14 -04:00
|
|
|
|
2025-02-26 01:10:06 -03:00
|
|
|
#import <CogAudio/soxr.h>
|
2023-10-02 11:04:26 -03:00
|
|
|
|
2025-02-26 01:10:06 -03:00
|
|
|
#import <CogAudio/Node.h>
|
2007-10-03 16:23:14 -04:00
|
|
|
|
|
|
|
@interface ConverterNode : Node {
|
2022-02-07 02:49:27 -03:00
|
|
|
NSDictionary *rgInfo;
|
|
|
|
|
2023-10-02 11:04:26 -03:00
|
|
|
soxr_t soxr;
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
void *inputBuffer;
|
|
|
|
size_t inputBufferSize;
|
|
|
|
size_t inpSize, inpOffset;
|
|
|
|
|
2025-02-12 09:41:11 -03:00
|
|
|
double streamTimestamp, streamTimeRatio;
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
BOOL stopping;
|
|
|
|
BOOL convertEntered;
|
|
|
|
BOOL paused;
|
|
|
|
|
2023-10-02 11:04:26 -03:00
|
|
|
BOOL skipResampler;
|
|
|
|
|
|
|
|
unsigned int PRIME_LEN_;
|
|
|
|
unsigned int N_samples_to_add_;
|
|
|
|
unsigned int N_samples_to_drop_;
|
|
|
|
|
|
|
|
BOOL is_preextrapolated_;
|
|
|
|
int is_postextrapolated_;
|
|
|
|
|
|
|
|
int latencyEaten;
|
|
|
|
int latencyEatenPost;
|
|
|
|
|
|
|
|
double sampleRatio;
|
|
|
|
|
2025-05-03 04:23:19 -04:00
|
|
|
BOOL observersAdded;
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
float volumeScale;
|
|
|
|
|
2023-10-02 11:04:26 -03:00
|
|
|
void *floatBuffer;
|
|
|
|
size_t floatBufferSize;
|
|
|
|
|
|
|
|
void *extrapolateBuffer;
|
|
|
|
size_t extrapolateBufferSize;
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
BOOL rememberedLossless;
|
|
|
|
|
2007-10-03 16:23:14 -04:00
|
|
|
AudioStreamBasicDescription inputFormat;
|
2022-02-07 02:49:27 -03:00
|
|
|
AudioStreamBasicDescription floatFormat;
|
2023-10-02 11:04:26 -03:00
|
|
|
AudioStreamBasicDescription outputFormat;
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2022-02-07 05:56:05 -03:00
|
|
|
uint32_t inputChannelConfig;
|
|
|
|
|
2022-02-08 00:18:45 -03:00
|
|
|
BOOL streamFormatChanged;
|
|
|
|
AudioStreamBasicDescription newInputFormat;
|
|
|
|
uint32_t newInputChannelConfig;
|
2007-10-03 16:23:14 -04:00
|
|
|
}
|
|
|
|
|
2022-01-14 16:18:50 -03:00
|
|
|
@property AudioStreamBasicDescription inputFormat;
|
|
|
|
|
2013-10-11 00:02:02 -03:00
|
|
|
- (id)initWithController:(id)c previous:(id)p;
|
2013-10-07 07:59:04 -03:00
|
|
|
|
2023-10-02 11:04:26 -03:00
|
|
|
- (BOOL)setupWithInputFormat:(AudioStreamBasicDescription)inputFormat withInputConfig:(uint32_t)inputConfig outputFormat:(AudioStreamBasicDescription)outputFormat isLossless:(BOOL)lossless;
|
2007-10-03 16:23:14 -04:00
|
|
|
- (void)cleanUp;
|
|
|
|
|
2025-02-14 03:25:27 -03:00
|
|
|
- (BOOL)paused;
|
|
|
|
|
2007-10-03 16:23:14 -04:00
|
|
|
- (void)process;
|
2022-07-14 04:45:49 -04:00
|
|
|
- (AudioChunk *)convert;
|
2007-10-03 16:23:14 -04:00
|
|
|
|
2013-10-07 07:59:04 -03:00
|
|
|
- (void)setRGInfo:(NSDictionary *)rgi;
|
|
|
|
|
2023-10-02 11:04:26 -03:00
|
|
|
- (void)setOutputFormat:(AudioStreamBasicDescription)outputFormat;
|
|
|
|
|
2022-02-07 05:56:05 -03:00
|
|
|
- (void)inputFormatDidChange:(AudioStreamBasicDescription)format inputConfig:(uint32_t)inputConfig;
|
2007-10-11 22:55:59 -04:00
|
|
|
|
2013-10-07 07:59:04 -03:00
|
|
|
- (void)refreshVolumeScaling;
|
|
|
|
|
2007-10-03 16:23:14 -04:00
|
|
|
@end
|