From accb99bd39acdf499534208c229dc9a791555de2 Mon Sep 17 00:00:00 2001 From: Marian Paul Date: Wed, 27 Nov 2024 17:00:15 +0100 Subject: [PATCH] Make FloatPlot public again, fixing a regression --- .../AudioKitUI/Visualizations/FloatPlot.swift | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Sources/AudioKitUI/Visualizations/FloatPlot.swift b/Sources/AudioKitUI/Visualizations/FloatPlot.swift index d2b3d88..3c0ed1a 100644 --- a/Sources/AudioKitUI/Visualizations/FloatPlot.swift +++ b/Sources/AudioKitUI/Visualizations/FloatPlot.swift @@ -5,7 +5,7 @@ import Metal import MetalKit // This must be in sync with the definition in shaders.metal -struct FragmentConstants { +public struct FragmentConstants { public var foregroundColor: SIMD4 public var backgroundColor: SIMD4 public var isFFT: Bool @@ -15,9 +15,25 @@ struct FragmentConstants { // Padding is required because swift doesn't pad to alignment // like MSL does. public var padding: Int = 0 + + public init( + foregroundColor: SIMD4, + backgroundColor: SIMD4, + isFFT: Bool, + isCentered: Bool, + isFilled: Bool, + padding: Int = 0 + ) { + self.foregroundColor = foregroundColor + self.backgroundColor = backgroundColor + self.isFFT = isFFT + self.isCentered = isCentered + self.isFilled = isFilled + self.padding = padding + } } -class FloatPlot: NSObject { +public class FloatPlot: NSObject { var waveformTexture: MTLTexture? let commandQueue: MTLCommandQueue! let pipelineState: MTLRenderPipelineState!