Code Fix: Add nullability flags to Vis Manager

The Visualization Manager PCM/FFT copy function was already observing
these parameters for null input and only returning output to the ones
which were not null. This just makes it clear that they are both
optional parameters. This is useful for future visualization adventures,
allowing PCM copy without invoking the FFT processing, or requesting FFT
without also having to keep the PCM.

This is mostly only a compile time change, and has no noticeable effect
on the current runtime behavior, as the only consumers of the Visualizer
data currently request both PCM and FFT.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-03-13 19:47:35 -07:00
parent d97b1e788a
commit 7cb010e337
2 changed files with 2 additions and 2 deletions

View file

@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)postSampleRate:(double)sampleRate; - (void)postSampleRate:(double)sampleRate;
- (void)postVisPCM:(const float *)inPCM amount:(int)amount; - (void)postVisPCM:(const float *)inPCM amount:(int)amount;
- (double)readSampleRate; - (double)readSampleRate;
- (void)copyVisPCM:(float *)outPCM visFFT:(float *)outFFT latencyOffset:(double)latency; - (void)copyVisPCM:(float *_Nullable)outPCM visFFT:(float *_Nullable)outFFT latencyOffset:(double)latency;
- (void)reset; - (void)reset;

View file

@ -112,7 +112,7 @@ static VisualizationController *_sharedController = nil;
return visSamplesPosted; return visSamplesPosted;
} }
- (void)copyVisPCM:(float *)outPCM visFFT:(float *)outFFT latencyOffset:(double)latency { - (void)copyVisPCM:(float *_Nullable)outPCM visFFT:(float *_Nullable)outFFT latencyOffset:(double)latency {
if(!outPCM && !outFFT) return; if(!outPCM && !outFFT) return;
if(!visAudio || !visAudioSize) { if(!visAudio || !visAudioSize) {