ActivePatchManager
public final class ActivePatchManager : SubscriptionManager<ActivePatchEvent>
Maintains the active SoundFont patch being used for sound generation. There should only ever be one instance of this class, but this is not enforced.
-
The currently active patch (if any)
Declaration
Swift
public private(set) var active: ActivePatchKind { get } -
The currently active sound font (if any)
Declaration
Swift
public var activeSoundFont: LegacySoundFont? { get } -
The currently active preset instance (if any)
Declaration
Swift
public var activePatch: LegacyPatch? { get } -
The currently active preset instance (if any)
Declaration
Swift
public var activeFavorite: LegacyFavorite? { get } -
The preset configuration for the currently active preset or favorite
Declaration
Swift
public var activePresetConfig: PresetConfig? { get } -
Obtain the last-saved active patch value
Declaration
Swift
static var restoredActivePatchKind: ActivePatchKind? { get } -
Construct new manager
Declaration
Swift
public init(soundFonts: SoundFonts, selectedSoundFontManager: SelectedSoundFontManager)Parameters
soundFontthe sound font manager
selectedSoundFontManagerthe manager of the selected sound font
inApptrue if the running inside the app, false if running in the AUv3 extension
-
Obtain the sound font instance that corresponds to the given preset key.
Declaration
Swift
public func resolveToSoundFont(_ soundFontAndPatch: SoundFontAndPatch) -> LegacySoundFont?Parameters
soundFontAndPatchthe preset key to resolve
Return Value
optional sound font instance that corresponds to the given key
-
Obtain the preset instance that corresponds to the given preset key.
Declaration
Swift
public func resolveToPatch(_ soundFontAndPatch: SoundFontAndPatch) -> LegacyPatch?Parameters
soundFontAndPatchthe preset key to resolve
Return Value
optional patch instance that corresponds to the given key
-
Set a new active preset.
Declaration
Swift
@discardableResult public func setActive(preset: SoundFontAndPatch, playSample: Bool) -> BoolParameters
presetthe preset to make active
playSampleif true, play a note using the new preset
-
Make a favorite the active preset.
Declaration
Swift
@discardableResult public func setActive(favorite: LegacyFavorite, playSample: Bool) -> BoolParameters
favoritethe favorite to make active
playSampleif true, play a note using the new preset
-
Set a new active value.
Declaration
Swift
@discardableResult public func setActive(_ kind: ActivePatchKind, playSample: Bool = false) -> BoolParameters
kindwrapped value to set
playSampleif true, play a note using the new preset
View on GitHub
ActivePatchManager Class Reference