// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown // SPDX-License-Identifier: GPL-3.0-or-later import CoreAudioKit import UIKit /// The extension's principal class: the AU factory and its (minimal) view. public final class AudioUnitViewController: AUViewController, AUAudioUnitFactory { private var audioUnit: AUAudioUnit? public func createAudioUnit(with componentDescription: AudioComponentDescription) throws -> AUAudioUnit { let au = try SpikeAudioUnit(componentDescription: componentDescription, options: []) audioUnit = au return au } public override func viewDidLoad() { super.viewDidLoad() preferredContentSize = CGSize(width: 400, height: 220) view.backgroundColor = UIColor(red: 0.08, green: 0.09, blue: 0.10, alpha: 1) let label = UILabel() label.numberOfLines = 0 label.font = .monospacedSystemFont(ofSize: 12, weight: .regular) label.textColor = UIColor(red: 0.96, green: 0.76, blue: 0.29, alpha: 1) label.text = "Sizzle Spike Sine (AUv3)\nPlay notes from the host.\n\n" + Spike.probeGroup(as: "au-view") label.translatesAutoresizingMaskIntoConstraints = false view.addSubview(label) NSLayoutConstraint.activate([ label.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 12), label.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -12), label.topAnchor.constraint(equalTo: view.topAnchor, constant: 12), ]) } }