DSP: Whitespace changes

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-02-11 17:44:07 -08:00
parent 8a468c08ce
commit 7e5c9c8f7c
2 changed files with 11 additions and 9 deletions

View file

@ -28,12 +28,12 @@ static void * kDSPRubberbandNodeContext = &kDSPRubberbandNodeContext;
BOOL processEntered; BOOL processEntered;
BOOL observersapplied; BOOL observersapplied;
AudioStreamBasicDescription lastInputFormat; AudioStreamBasicDescription lastInputFormat;
AudioStreamBasicDescription inputFormat; AudioStreamBasicDescription inputFormat;
uint32_t lastInputChannelConfig, inputChannelConfig; uint32_t lastInputChannelConfig, inputChannelConfig;
float *rsPtrs[32]; float *rsPtrs[32];
float rsInBuffer[4096 * 32]; float rsInBuffer[4096 * 32];
float rsOutBuffer[65536 * 32]; float rsOutBuffer[65536 * 32];
@ -162,7 +162,7 @@ static void * kDSPRubberbandNodeContext = &kDSPRubberbandNodeContext;
options |= RubberBandOptionPhaseIndependent; options |= RubberBandOptionPhaseIndependent;
} }
} }
value = [defaults stringForKey:@"rubberbandWindow"]; value = [defaults stringForKey:@"rubberbandWindow"];
if([value isEqualToString:@"standard"]) { if([value isEqualToString:@"standard"]) {
options |= RubberBandOptionWindowStandard; options |= RubberBandOptionWindowStandard;
@ -175,7 +175,7 @@ static void * kDSPRubberbandNodeContext = &kDSPRubberbandNodeContext;
options |= RubberBandOptionWindowLong; options |= RubberBandOptionWindowLong;
} }
} }
if(!engineR3) { if(!engineR3) {
value = [defaults stringForKey:@"rubberbandSmoothing"]; value = [defaults stringForKey:@"rubberbandSmoothing"];
if([value isEqualToString:@"off"]) { if([value isEqualToString:@"off"]) {
@ -253,10 +253,10 @@ static void * kDSPRubberbandNodeContext = &kDSPRubberbandNodeContext;
if(stopping || paused || !ts) return; if(stopping || paused || !ts) return;
RubberBandOptions changed = tslastoptions ^ tsnewoptions; RubberBandOptions changed = tslastoptions ^ tsnewoptions;
if(changed) { if(changed) {
tslastoptions = tsnewoptions; tslastoptions = tsnewoptions;
BOOL engineR3 = !!(tsnewoptions & RubberBandOptionEngineFiner); BOOL engineR3 = !!(tsnewoptions & RubberBandOptionEngineFiner);
const RubberBandOptions transientsmask = RubberBandOptionTransientsCrisp | RubberBandOptionTransientsMixed | RubberBandOptionTransientsSmooth; const RubberBandOptions transientsmask = RubberBandOptionTransientsCrisp | RubberBandOptionTransientsMixed | RubberBandOptionTransientsSmooth;
const RubberBandOptions detectormask = RubberBandOptionDetectorCompound | RubberBandOptionDetectorPercussive | RubberBandOptionDetectorSoft; const RubberBandOptions detectormask = RubberBandOptionDetectorCompound | RubberBandOptionDetectorPercussive | RubberBandOptionDetectorSoft;
@ -352,7 +352,7 @@ static void * kDSPRubberbandNodeContext = &kDSPRubberbandNodeContext;
- (AudioChunk *)convert { - (AudioChunk *)convert {
if(stopping) if(stopping)
return 0; return 0;
processEntered = YES; processEntered = YES;
if(stopping || [self endOfStream] == YES || [self shouldContinue] == NO) { if(stopping || [self endOfStream] == YES || [self shouldContinue] == NO) {
@ -398,7 +398,7 @@ static void * kDSPRubberbandNodeContext = &kDSPRubberbandNodeContext;
for(size_t i = 0; i < channels; ++i) { for(size_t i = 0; i < channels; ++i) {
cblas_scopy(len, ibuf + i, channels, rsPtrs[i], 1); cblas_scopy(len, ibuf + i, channels, rsPtrs[i], 1);
} }
rubberband_process(ts, (const float * const *)rsPtrs, len, endOfStream); rubberband_process(ts, (const float * const *)rsPtrs, len, endOfStream);
size_t samplesAvailable; size_t samplesAvailable;
@ -445,4 +445,5 @@ static void * kDSPRubberbandNodeContext = &kDSPRubberbandNodeContext;
processEntered = NO; processEntered = NO;
return outputChunk; return outputChunk;
} }
@end @end

View file

@ -114,6 +114,7 @@
shouldContinue = NO; shouldContinue = NO;
break; break;
} }
if(durationLeft < chunkDuration || shouldReset) { if(durationLeft < chunkDuration || shouldReset) {
[accessLock unlock]; [accessLock unlock];
[semaphore timedWait:500]; [semaphore timedWait:500];