iOS milestone 3 groundwork: SizzleSession bridge, app shell with tabs, slot-backed editors, screen snapshots

SizzleSession owns the song, engine (192-frame chunks, try-lock on the audio
thread), samples and audio output; AppModel/RootView give the four tabs;
DeviceModel now works on toolbox slots too; make screen-snapshots renders the
app's tabs on the Mac.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-16 09:15:28 +01:00
co-authored by Claude Opus 5.5
parent 7bc54e6466
commit 29650b88d7
26 changed files with 1211 additions and 47 deletions
+6
View File
@@ -0,0 +1,6 @@
#import "SizzleDeviceAU.h"
#import "SizzleSession.h"
#import "SnapshotComponents.h"
#import "SizzleSession+Tracker.h"
#import "SizzleSession+Mix.h"
#import "SizzleSession+Setup.h"
+1 -1
View File
@@ -11,7 +11,7 @@ import SwiftUI
@main
struct EditorSnapshots {
@MainActor static func main() {
DeviceEditor.snapshot = true
Snapshot.active = true
let out = URL(fileURLWithPath: CommandLine.arguments.count > 1 ? CommandLine.arguments[1] : "png")
try? FileManager.default.createDirectory(at: out, withIntermediateDirectories: true)
for c in SizzleComponentList.all() {
+43
View File
@@ -0,0 +1,43 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
// Renders each app tab (with the demo song loaded) to PNG on the Mac, in an iPad
// portrait and landscape size: `make -C ios screen-snapshots` → build/screens/png/.
import AppKit
import SwiftUI
@main
struct ScreenSnapshots {
@MainActor static func main() {
Snapshot.active = true
setenv("SIZZLE_NO_AUDIO", "1", 1)
let args = CommandLine.arguments
let out = URL(fileURLWithPath: args.count > 1 ? args[1] : "png")
try? FileManager.default.createDirectory(at: out, withIntermediateDirectories: true)
if args.count > 2, let text = try? String(contentsOfFile: args[2]) {
try? SizzleSession.shared.loadProjectText(text)
}
let sizes: [(String, CGSize)] = [("portrait", CGSize(width: 768, height: 1024)), ("landscape", CGSize(width: 1024, height: 768))]
for tab in AppModel.Tab.allCases {
for (orientation, size) in sizes {
let app = AppModel()
app.tab = tab
let view = ScreenHarness(app: app).frame(width: size.width, height: size.height)
let r = ImageRenderer(content: view)
r.scale = 2
guard let img = r.cgImage else { print("FAIL \(tab)"); continue }
let name = "\(tab.rawValue)_\(tab)_\(orientation).png"
try? NSBitmapImageRep(cgImage: img).representation(using: .png, properties: [:])?
.write(to: out.appendingPathComponent(name))
print("wrote \(name)")
}
}
}
}
/// RootView's layout with a given AppModel (RootView owns its own).
private struct ScreenHarness: View {
@ObservedObject var app: AppModel
var body: some View { RootView(model: app) }
}