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
@@ -8,6 +8,7 @@ import SwiftUI
|
||||
// DeviceLabView / PluginCheck), so there they are no-ops.
|
||||
|
||||
#if canImport(UIKit)
|
||||
import AVKit
|
||||
import UIKit
|
||||
|
||||
enum ShareSheet {
|
||||
@@ -79,8 +80,53 @@ private struct PluginCheckSheet: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// The system's audio route picker (AirPlay, Bluetooth, an interface) and the
|
||||
/// current route's names (Android's audio device rows; iOS chooses the route).
|
||||
struct AudioRouteView: View {
|
||||
@State private var output = AudioRouteView.names(\.outputs)
|
||||
@State private var input = AudioRouteView.names(\.inputs)
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack(spacing: 10) {
|
||||
VStack(alignment: .leading, spacing: 3) {
|
||||
Text("Output: " + output).font(.system(size: 14)).foregroundColor(Theme.text)
|
||||
Text("Input: " + input).font(.system(size: 14)).foregroundColor(Theme.text)
|
||||
}
|
||||
Spacer()
|
||||
RoutePicker().frame(width: 44, height: 44)
|
||||
}
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: AVAudioSession.routeChangeNotification).receive(on: RunLoop.main)) { _ in
|
||||
output = Self.names(\.outputs)
|
||||
input = Self.names(\.inputs)
|
||||
}
|
||||
}
|
||||
|
||||
static func names(_ kp: KeyPath<AVAudioSessionRouteDescription, [AVAudioSessionPortDescription]>) -> String {
|
||||
let ports = AVAudioSession.sharedInstance().currentRoute[keyPath: kp].map(\.portName)
|
||||
return ports.isEmpty ? "—" : ports.joined(separator: ", ")
|
||||
}
|
||||
|
||||
private struct RoutePicker: UIViewRepresentable {
|
||||
func makeUIView(context: Context) -> AVRoutePickerView {
|
||||
let v = AVRoutePickerView()
|
||||
v.tintColor = UIColor(Theme.accent)
|
||||
v.activeTintColor = UIColor(Theme.accent)
|
||||
return v
|
||||
}
|
||||
func updateUIView(_ v: AVRoutePickerView, context: Context) {}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
struct AudioRouteView: View {
|
||||
var body: some View {
|
||||
Text("Output: Speaker\nInput: Microphone").font(.system(size: 14)).foregroundColor(Theme.text)
|
||||
}
|
||||
}
|
||||
|
||||
enum ShareSheet {
|
||||
@MainActor static func present(_ url: URL, done: @escaping () -> Void = {}) { done() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user