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:
co-authored by
Claude Opus 5.5
parent
435305e42a
commit
64e21e0bcc
@@ -50,6 +50,22 @@ extension EnvironmentValues {
|
||||
}
|
||||
}
|
||||
|
||||
/// The app's microphone recorder for editors that take a recording (the Grain
|
||||
/// Cloud's RECORD); nil in the plugin, which shows no RECORD button.
|
||||
struct DeviceRecordControl {
|
||||
let isRecording: Bool
|
||||
let toggle: () -> Void
|
||||
}
|
||||
private struct DeviceRecorderKey: EnvironmentKey {
|
||||
static let defaultValue: DeviceRecordControl? = nil
|
||||
}
|
||||
extension EnvironmentValues {
|
||||
var deviceRecorder: DeviceRecordControl? {
|
||||
get { self[DeviceRecorderKey.self] }
|
||||
set { self[DeviceRecorderKey.self] = newValue }
|
||||
}
|
||||
}
|
||||
|
||||
/// Hand-built pieces of device editors (the Android app's bespoke editors), by
|
||||
/// device. DeviceEditor asks here first and falls back to the card layout. Each
|
||||
/// device's views live in their own file in this folder.
|
||||
|
||||
@@ -18,7 +18,7 @@ enum DelayBespoke {
|
||||
"1/4T", "1/8", "1/16.", "1/8T", "1/16", "1/16T"]
|
||||
static var divisions: [String] { Layouts.file?.delayDivisions ?? fallbackDivisions }
|
||||
/// Android's default theme's playhead green (the selected-step band).
|
||||
static let band = Color(red: 0x7C / 255.0, green: 0xFC / 255.0, blue: 0x9A / 255.0)
|
||||
static var band: Color { Theme.playhead }
|
||||
}
|
||||
|
||||
private struct DelayEditorView: View {
|
||||
|
||||
@@ -14,7 +14,8 @@ protocol SampleLengthSource: AnyObject {
|
||||
|
||||
/// The Grain Cloud's source strip (Android's GrainCloudEditor.kt): load a WAV (or
|
||||
/// SF2/XI) as the cloud's own source, and see the source with its START..END region
|
||||
/// lit. The settings themselves are the card pages below it. (RECORD isn't ported.)
|
||||
/// lit. The settings themselves are the card pages below it. RECORD (the app only)
|
||||
/// makes a microphone take the source.
|
||||
@MainActor
|
||||
enum GrainCloudBespoke {
|
||||
static func header(_ model: DeviceModel) -> AnyView? { AnyView(GrainSourceStrip(model: model)) }
|
||||
@@ -39,6 +40,7 @@ struct GrainSourceStrip: View {
|
||||
@ObservedObject var model: DeviceModel
|
||||
@State private var pickerShown = false
|
||||
@Environment(\.deviceFilePicker) private var hostPicker
|
||||
@Environment(\.deviceRecorder) private var recorder
|
||||
@State private var importError: String?
|
||||
/// Bumped while a built-in source is still being rendered, to look again.
|
||||
@State private var retry = 0
|
||||
@@ -63,6 +65,15 @@ struct GrainSourceStrip: View {
|
||||
.overlay(Rectangle().stroke(Theme.accent.opacity(0.6), lineWidth: 1))
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture { if let pick = hostPicker { pick { url in load(url) } } else { pickerShown = true } }
|
||||
if let rec = recorder {
|
||||
Text(rec.isRecording ? "■ STOP REC" : "● RECORD").font(Theme.mono(12))
|
||||
.foregroundColor(rec.isRecording ? Theme.background : Theme.accent)
|
||||
.padding(.horizontal, 10).padding(.vertical, 6)
|
||||
.background(rec.isRecording ? Theme.accent : Theme.surface)
|
||||
.overlay(Rectangle().stroke(Theme.accent.opacity(0.6), lineWidth: 1))
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture(perform: rec.toggle)
|
||||
}
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
Text(caption).font(Theme.mono(10)).foregroundColor(Theme.dim)
|
||||
|
||||
Reference in New Issue
Block a user