iOS 0.3.0: card editors like Android's for every plugin (knobs, switches, tabs, drawings)
Layouts exported from Android's DeviceLayouts (DeviceLayouts.json), iOS layouts for the devices with hand-built Android editors, SwiftUI editor shared by the extension and the app, Mac snapshot tool for the editors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
47588990ce
commit
b6589ee792
@@ -0,0 +1,2 @@
|
||||
#import "SizzleDeviceAU.h"
|
||||
#import "SnapshotComponents.h"
|
||||
@@ -0,0 +1,20 @@
|
||||
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// components.txt for the Swift snapshot tool (editor_snapshots.swift).
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SizzleComponentInfo : NSObject
|
||||
@property (nonatomic) OSType type;
|
||||
@property (nonatomic) OSType subtype;
|
||||
@property (nonatomic, copy) NSString *name;
|
||||
@end
|
||||
|
||||
@interface SizzleComponentList : NSObject
|
||||
+ (NSArray<SizzleComponentInfo *> *)all;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,22 @@
|
||||
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#import "SnapshotComponents.h"
|
||||
#import "Components.gen.h"
|
||||
|
||||
@implementation SizzleComponentInfo
|
||||
@end
|
||||
|
||||
@implementation SizzleComponentList
|
||||
+ (NSArray<SizzleComponentInfo *> *)all {
|
||||
NSMutableArray *list = [NSMutableArray array];
|
||||
for (int i = 0; i < kSizzleComponentCount; ++i) {
|
||||
SizzleComponentInfo *c = [SizzleComponentInfo new];
|
||||
c.type = kSizzleComponents[i].type;
|
||||
c.subtype = kSizzleComponents[i].subtype;
|
||||
c.name = @(kSizzleComponents[i].name);
|
||||
[list addObject:c];
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,39 @@
|
||||
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// Renders every device's editor (each tab) to PNG on the Mac, to look at the
|
||||
// layouts without a device: `make -C ios editor-snapshots` → build/snapshots/png/.
|
||||
|
||||
import AppKit
|
||||
import AudioToolbox
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct EditorSnapshots {
|
||||
@MainActor static func main() {
|
||||
DeviceEditor.snapshot = 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() {
|
||||
let desc = AudioComponentDescription(componentType: c.type, componentSubType: c.subtype,
|
||||
componentManufacturer: 0x5473_7973, componentFlags: 0, componentFlagsMask: 0)
|
||||
guard let cls = SizzleDeviceAU.class(forComponentType: c.type) as? SizzleDeviceAU.Type,
|
||||
let au = try? cls.init(componentDescription: desc, options: []) else { print("FAIL \(c.name)"); continue }
|
||||
let model = DeviceModel(au: au)
|
||||
let pages = Layouts.pages(for: au.toolboxType, allKeys: model.order)
|
||||
for (i, page) in pages.enumerated() {
|
||||
let view = DeviceEditor(model: model, page: i)
|
||||
.frame(width: 560)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.environment(\.colorScheme, .dark)
|
||||
let r = ImageRenderer(content: view)
|
||||
r.scale = 2
|
||||
guard let img = r.cgImage else { print("FAIL render \(c.name)"); continue }
|
||||
let rep = NSBitmapImageRep(cgImage: img)
|
||||
let name = "\(au.toolboxType)_\(i)_\(page.title.replacingOccurrences(of: " ", with: "_")).png"
|
||||
try? rep.representation(using: .png, properties: [:])?.write(to: out.appendingPathComponent(name))
|
||||
print("wrote \(name)")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user