Device editors ask BespokeEditors for headers, whole bodies, drawings and card actions; DeviceDataSource gives them DSP data and hidden settings, backed by app slots (SlotDataSource) or AUs (AUDataSource, hidden values in SizzleDeviceAU). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
2.2 KiB
Objective-C
48 lines
2.2 KiB
Objective-C
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#import <AudioToolbox/AudioToolbox.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
/// What every Sizzle AUv3 shares: the device (a ToolboxType, e.g. "DELAY" or
|
|
/// "WAVETABLE") and its parameters from the generated specs, the hand-over of
|
|
/// settings to the render thread, factory presets (Android's PresetLibrary set),
|
|
/// user presets and saved state. Subclasses add busses and the render block:
|
|
/// SizzleEffectAU (aufx) and SizzleInstrumentAU (aumu). Pick the right one with
|
|
/// +classForComponentType:.
|
|
@interface SizzleDeviceAU : AUAudioUnit
|
|
|
|
/// Standard initializer: the device comes from the component's subtype
|
|
/// (components.txt). Used by AU registration (in-process and in the extension).
|
|
- (nullable instancetype)initWithComponentDescription:(AudioComponentDescription)desc
|
|
options:(AudioComponentInstantiationOptions)options
|
|
error:(NSError **)outError;
|
|
|
|
/// The AU class for a component type: kAudioUnitType_MusicDevice → instruments,
|
|
/// anything else → effects.
|
|
+ (Class)classForComponentType:(OSType)type;
|
|
|
|
/// The device's name as shown in Sizzle ("Tape Delay").
|
|
@property (nonatomic, readonly) NSString *displayName;
|
|
/// Its ToolboxType name ("DELAY").
|
|
@property (nonatomic, readonly) NSString *toolboxType;
|
|
|
|
/// Formats a parameter value the way Sizzle's editor does (units, %, choices).
|
|
- (NSString *)stringForParameter:(AUParameter *)param value:(AUValue)value;
|
|
|
|
/// The parameter's default (Android's ParamSpec.default; a choice index for lists).
|
|
- (AUValue)defaultValueForParameter:(AUParameter *)param;
|
|
/// Whether the parameter takes whole numbers only.
|
|
- (BOOL)isIntegerParameter:(AUParameter *)param;
|
|
/// A setting that isn't an AU parameter (e.g. the Mix Tightener's stage trims),
|
|
/// as stored text, or nil; saved with the AU's state. Main thread.
|
|
- (nullable NSString *)hiddenValueForKey:(NSString *)key;
|
|
- (void)setHiddenValue:(NSString *)value forKey:(NSString *)key;
|
|
/// Its label in Sizzle's spec, e.g. "Osc1 Level", "Wet (dB)" (displayName is the same).
|
|
- (NSString *)specLabelForParameter:(AUParameter *)param;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|