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
+40
View File
@@ -0,0 +1,40 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
import SwiftUI
/// Everything that runs once at launch, before any screen (Android's SizzleApp):
/// settings that live outside the song, MIDI, and the hardware input sources.
@MainActor
enum AppBoot {
static func start() {
let settings = AppSettings.shared
let session = SizzleSession.shared
session.recordTailBars = settings.recordTailBars
ThemeLibrary.shared.select(settings.paletteName)
let input = InputController.shared
input.app = AppModel.main
input.start()
HardwareInput.shared.start()
let midi = SizzleMidi.shared
midi.sendClock = settings.sendMidiClock
midi.receiveClock = settings.receiveMidiClock
midi.soundModule = settings.soundModule
midi.onNote = { on, ch, note, vel in input.midiNote(on: on, channel: ch, note: note, velocity: vel) }
midi.onControl = { cc, value in input.midiControl(cc, value) }
midi.start(withDisabledKeys: settings.midiSourcesOff)
}
/// Leaving the foreground: save, and unless Sizzle stays on as a sound module
/// (or is playing / recording), pause the audio so iOS can suspend the app.
static func background() {
let session = SizzleSession.shared
session.autosave()
let busy = session.isPlaying || session.masterRecording || SampleRecorder.shared.isRecording
if !AppSettings.shared.soundModule && !busy { session.audioSuspended = true }
}
static func foreground() { SizzleSession.shared.audioSuspended = false }
}