0.38.0 (72): Bluetooth LE MIDI controllers in Settings (Android and iOS)

- Android: BleMidi scans for the BLE MIDI service, connects through
  MidiManager.openBluetoothDevice, remembers and reconnects controllers;
  Settings › MIDI inputs › Bluetooth MIDI (Scan / Connect / Disconnect / Forget)
- iOS: the system Bluetooth MIDI panel from Setup › MIDI Sync, connected
  controllers remembered and reconnected at launch via CoreBluetooth

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-16 14:57:53 +01:00
co-authored by Claude Opus 5.5
parent 2bc5cb1cbb
commit 4d9e2328cb
18 changed files with 574 additions and 7 deletions
@@ -148,6 +148,8 @@ struct MidiSyncCard: View {
SizzleMidi.shared.setSourceKey(src.key, enabled: on)
}
}
SetupDivider()
BluetoothMidiSection()
}
}
}
@@ -195,3 +197,35 @@ struct BackupCard: View {
}
}
}
/// Bluetooth LE MIDI controllers (the Android app's Bluetooth MIDI list): the
/// system panel finds and connects them; connected ones join the MIDI inputs
/// above and are remembered, to reconnect at every launch until forgotten.
struct BluetoothMidiSection: View {
@ObservedObject var ble = BluetoothMidi.shared
var body: some View {
HStack {
VStack(alignment: .leading, spacing: 2) {
Text("Bluetooth MIDI").font(.system(size: 15, weight: .medium)).foregroundColor(Theme.text)
Text("Find Bluetooth LE MIDI controllers and connect them. Connected ones are listed with the " +
"MIDI inputs and reconnect at every launch.")
.font(.system(size: 12)).foregroundColor(Theme.dim).fixedSize(horizontal: false, vertical: true)
}
Spacer()
SetupButton(title: "Find controllers", icon: "antenna.radiowaves.left.and.right") {
BluetoothMidiPanel.present { ble.panelClosed() }
}
}
ForEach(ble.remembered.sorted { $0.value < $1.value }, id: \.key) { id, name in
HStack {
VStack(alignment: .leading, spacing: 2) {
Text(name).font(.system(size: 15)).foregroundColor(Theme.text)
Text("Remembered — reconnects at launch").font(.system(size: 12)).foregroundColor(Theme.dim)
}
Spacer()
SetupButton(title: "Forget") { ble.forget(id) }
}
}
}
}