@ WWDC 19
- Provide a fine-tuned set of parameteer values
- Capture a snapshot of the state of the Audiio Unit's parameters
- Loading a preset restores the Audio Unit to the same state
-
We already support factory presets
open var factoryPresets: [AudioUnitPreset]? { get }
-
Provided by the Audio Unit Developer
-
Immutable, built into the Audio Unit
open var userPresets: [AUAudioUnitPreset]? { get }
-
Created and managed by the user
-
Mutable
open var supportsUserPresets: Bool { get }
- Set by the Audio Unit to opt-in
- Checked by the host to verify support
open func saveUserPreset(_ userPreset: AUAudioUnitPreset) throws
open func deleteUserPreset(_ userPreset: AUAudioUnitPreset) throws
- Have default implementations in
AUAudioUnit
- Can be overriden to implement custom logic
open func presetState(foor userPreset: AUAudioUnitPreset) throws -> [Striing : Any]
- Implemented in the superclass, but can be overriden
- Returns the contents of a user preset
- Can be assigned to
fullStateForDocument
open var isLoadedInProcess: Bool { get }
- Returns true if the audio unit is loaded in-process
- Loading in process is only available on macOS
- We now support user presets for Audio Units in addition to factoryPresets
- The Audio Unit has to opt in
- The methods have default implementations in the super class, but can be overriden