iOS milestone 4 groundwork: bespoke editor registry and data sources
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>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
42f66534bf
commit
3b035d6a7d
@@ -30,6 +30,8 @@ final class DeviceModel: ObservableObject {
|
||||
let presetNames: [String]
|
||||
@Published private(set) var values: [String: Float] = [:]
|
||||
@Published var presetName: String?
|
||||
/// Data the DSP owns and non-parameter settings (see Bespoke/Bespoke.swift).
|
||||
var data: DeviceDataSource?
|
||||
|
||||
private let write: (String, Float) -> Void
|
||||
private let applyPresetNamed: (String) -> Void
|
||||
@@ -70,6 +72,7 @@ final class DeviceModel: ObservableObject {
|
||||
applyPreset: { name in if let p = presets.first(where: { $0.name == name }) { au.currentPreset = p } },
|
||||
reread: { Dictionary(uniqueKeysWithValues: all.map { ($0.identifier, $0.value) }) })
|
||||
presetName = au.currentPreset?.name
|
||||
data = AUDataSource(au: au)
|
||||
token = au.parameterTree?.token(byAddingParameterObserver: { [weak self] address, value in
|
||||
DispatchQueue.main.async {
|
||||
guard let self = self, let p = all.first(where: { $0.address == address }) else { return }
|
||||
|
||||
Reference in New Issue
Block a user