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:
Reactorcoremeltdown
2026-11-16 09:47:25 +01:00
co-authored by Claude Opus 5.5
parent 42f66534bf
commit 3b035d6a7d
21 changed files with 251 additions and 4 deletions
+2
View File
@@ -5,3 +5,5 @@
#import "SizzleSession+Tracker.h"
#import "SizzleSession+Mix.h"
#import "SizzleSession+Setup.h"
#import "SizzleSession+Sources.h"
#import "SizzleSession+Viz.h"
+12
View File
@@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import "SizzleSession.h"
NS_ASSUME_NONNULL_BEGIN
/// API for the device editors' Sources views beyond SizzleSession.h.
@interface SizzleSession (Sources)
@end
NS_ASSUME_NONNULL_END
+10
View File
@@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import "SizzleSession+Sources.h"
#import "SizzleSession+Internal.h"
using namespace sizzle;
@implementation SizzleSession (Sources)
@end
+12
View File
@@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import "SizzleSession.h"
NS_ASSUME_NONNULL_BEGIN
/// API for the device editors' Viz views beyond SizzleSession.h.
@interface SizzleSession (Viz)
@end
NS_ASSUME_NONNULL_END
+10
View File
@@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import "SizzleSession+Viz.h"
#import "SizzleSession+Internal.h"
using namespace sizzle;
@implementation SizzleSession (Viz)
@end
+20
View File
@@ -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) }
}
+1
View File
@@ -31,6 +31,7 @@ extension DeviceModel {
},
applyPreset: { name in session.applyFactoryPreset(name, toSlot: slot) },
reread: read)
data = SlotDataSource(session: session, slot: slot)
}
}