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
@@ -0,0 +1,20 @@
|
||||
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import Foundation
|
||||
|
||||
/// DeviceDataSource for toolbox slot [slot] of the app's song. Each device's
|
||||
/// support lives in an extension in Host/Bespoke/.
|
||||
@MainActor
|
||||
final class SlotDataSource: DeviceDataSource {
|
||||
let session: SizzleSession
|
||||
let slot: Int
|
||||
init(session: SizzleSession, slot: Int) { self.session = session; self.slot = slot }
|
||||
|
||||
// Hidden settings are plain slot values here.
|
||||
func hiddenValue(_ key: String) -> String? {
|
||||
let v = session.value(ofSlot: slot, key: key)
|
||||
return v.isEmpty ? nil : v
|
||||
}
|
||||
func setHiddenValue(_ value: String, key: String) { session.setValue(value, ofSlot: slot, key: key) }
|
||||
}
|
||||
Reference in New Issue
Block a user