iOS 0.6.0: milestone 5 (recording, MIDI, input bindings, themes, bundles, backups)

- Master recording (MasterSink ring + writer thread) and the sample recorder
- CoreMIDI in/out: sound module, clock send/follow, virtual "Sizzle" ports;
  platform-free parser/module/clock in core (midi_test)
- Hardware keyboard and gamepads via GameController; rebindable keyboard,
  gamepad and MIDI CC actions; per-parameter MIDI learn
- Colour themes (.szt), project bundles (.szgz), backup & restore;
  ZIP in core with zlib (zip_test against jar and unzip)
- Persistent app settings; audio pauses in the background unless sound module

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-16 14:26:01 +01:00
co-authored by Claude Opus 5.5
parent 435305e42a
commit 64e21e0bcc
54 changed files with 3303 additions and 97 deletions
+3 -3
View File
@@ -7,9 +7,9 @@ import SwiftUI
/// components/Widgets.kt (RetroButton, RepeatButton, RetroDropdown, SectionLabel).
/// Namespaced so they can't clash with the other screens' own.
enum MixKit {
/// Android palette colours the shared Theme doesn't carry.
static let playhead = Color(red: 0x7C / 255, green: 0xFC / 255, blue: 0x9A / 255)
static let danger = Color(red: 0xE0 / 255, green: 0x5A / 255, blue: 0x4B / 255)
/// The theme's playhead and danger colours.
static var playhead: Color { Theme.playhead }
static var danger: Color { Theme.danger }
/// Pitch.name: 60 -> "C-4", 61 -> "C#4".
static func pitchName(_ midi: Int) -> String {
+44 -9
View File
@@ -28,18 +28,53 @@ private struct MixBody: View {
if inst { instruments.append(i) } else { effects.append(i) }
}
let names = (0..<16).map { session.name(ofSlot: $0) }
return GeometryReader { geo in
let landscape = geo.size.width > geo.size.height
HStack(spacing: 6) {
ForEach(0..<4, id: \.self) { ch in
ChannelStrip(ch: ch, landscape: landscape, instruments: instruments, effects: effects, names: names,
open: { ToolboxNav.open($0, app: app, returnTab: .mix) })
.frame(maxWidth: .infinity, maxHeight: .infinity)
return VStack(spacing: 0) {
RecordToolbar(session: session)
GeometryReader { geo in
let landscape = geo.size.width > geo.size.height
HStack(spacing: 6) {
ForEach(0..<4, id: \.self) { ch in
ChannelStrip(ch: ch, landscape: landscape, instruments: instruments, effects: effects, names: names,
open: { ToolboxNav.open($0, app: app, returnTab: .mix) })
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
.padding(6)
}
}
.background(Theme.background)
}
}
/// Android's RecordToolbar: arm the master recording (it starts on Play or an
/// external MIDI clock Start), the FX tail after the stop, and the last take. Takes
/// are saved in Sizzle's Recordings folder (Files app); SHARE sends the last one.
private struct RecordToolbar: View {
let session: SizzleSession
var body: some View {
let recording = session.masterRecording
let last = session.lastRecordingURL
let status: String = recording ? "recording…"
: session.recordArmed ? "armed — starts on play or MIDI clock start"
: last.map { "saved \($0.lastPathComponent)" } ?? "master → WAV (Files › Sizzle › Recordings)"
MixKit.HScroll {
HStack(spacing: 6) {
MixKit.Button(label: recording ? "● REC" : "● ARM", active: session.recordArmed && !recording, danger: recording) {
session.recordArmed = !session.recordArmed
}
MixKit.Dropdown(label: "TAIL", options: [0, 1, 2, 3, 4], selected: session.recordTailBars,
optionLabel: { "\($0) bar" + ($0 == 1 ? "" : "s") },
onSelect: { session.recordTailBars = $0; AppSettings.shared.recordTailBars = $0 })
if let url = last, !recording {
MixKit.Button(label: "SHARE") { ShareSheet.present(url) }
}
Text(status).font(Theme.mono(11)).foregroundColor(Theme.dim).lineLimit(1)
}
.padding(6)
}
.background(Theme.background)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Theme.surface)
}
}
@@ -133,7 +168,7 @@ private struct VolumeFader: View {
ZStack(alignment: .top) {
Theme.background
Rectangle().fill(Theme.accent.opacity(0.30)).frame(height: vol * h).offset(y: top)
MeterLayer(ch: ch, volume: vol)
if AppSettings.shared.vuMeters { MeterLayer(ch: ch, volume: vol) }
Rectangle().fill(Theme.accent).frame(height: 3).offset(y: min(max(top - 1.5, 0), max(h - 3, 0)))
}
.frame(width: g.size.width, height: h, alignment: .top)