Add MIDI foot-controller control; board/rig bypass; iOS fixes
Headline: MIDI control for a Behringer FCB1010 (four phases). - MIDIController (Lyrebird MIDI client): connection indicator via source polling, background-queue->main-actor hop, MIDI Learn. - Volume and Wah pedals (Wah reuses the SVF bandpass sweep, driven by pedal position instead of an envelope follower). - CC -> any pedal knob (0-127 mapped across the knob range). - Program Change -> pedal/board/rig toggles: software latch for booleans, exclusive radio for board solo. Positional addressing with display-name hints; stale/out-of-range bindings are skipped, not fired. - Per-rig MIDIMap embedded in ShoeGazeState as an optional field (old rigs decode to nil; no preset version bump). Central MIDI Mapping sheet with Learn/Clear per control. Also included (same working branch): - Full board bypass and rig bypass (dry passthrough via cascaded crossfades in BoardOutputMaster), with UI toggles. - Horizontal pedal picker grouped by category in filter order. - Drag a palette pedal onto a chain card to insert before it (ShoeGaze.insertPedal); tap still appends. - iOS: guard macOS-only .menuStyle(.borderlessButton) to silence the _UIReparentingView warning; iCloud-unavailable alert; keep the device awake while audio runs. Tests: 24 added (Volume/Wah, MIDIMap Codable incl. legacy decode, CC and PC controller behavior, insert/bypass API). Full suite green; macOS and iOS app targets build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -162,6 +162,7 @@ public struct BoardBarView: View {
|
||||
let isEditing: Bool = index == editingBoardIndex
|
||||
let isAudible: Bool = shoeGaze.isBoardAudible(board)
|
||||
let isSoloed: Bool = shoeGaze.activeBoardIndex == index
|
||||
let isBypassed: Bool = shoeGaze.isBoardBypassed(board)
|
||||
|
||||
VStack(spacing: BoardBarView.cellInnerSpacing) {
|
||||
Text(boardLabel(index: index, board: board))
|
||||
@@ -175,6 +176,7 @@ public struct BoardBarView: View {
|
||||
HStack(spacing: BoardBarView.cellSpacing) {
|
||||
ledButton(board: board, isAudible: isAudible)
|
||||
soloButton(board: board, isSoloed: isSoloed)
|
||||
bypassButton(board: board, isBypassed: isBypassed)
|
||||
}
|
||||
|
||||
levelFader(board: board)
|
||||
@@ -257,6 +259,25 @@ public struct BoardBarView: View {
|
||||
.help("Solo this board (exclusive)")
|
||||
}
|
||||
|
||||
/// Full-bypass footswitch — lit when this board is bypassed (dry passthrough, pedals skipped).
|
||||
private func bypassButton(board: PedalBoard, isBypassed: Bool) -> some View {
|
||||
Button {
|
||||
shoeGaze.setBoard(board, bypassed: !isBypassed)
|
||||
} label: {
|
||||
Text("B")
|
||||
.font(.system(size: BoardBarView.nameFontSize, weight: .bold))
|
||||
.foregroundStyle(isBypassed ? Color.black : Color.white)
|
||||
.frame(width: BoardBarView.soloButtonSize, height: BoardBarView.soloButtonSize)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 4)
|
||||
.fill(isBypassed ? Color.orange : Color(white: BoardBarView.ledDimBrightness))
|
||||
)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.help(isBypassed ? "Board bypassed — tap to re-engage the pedals"
|
||||
: "Bypass this board (dry passthrough)")
|
||||
}
|
||||
|
||||
/// Board master-gain fader. Hidden until the board's output master is connected.
|
||||
@ViewBuilder
|
||||
private func levelFader(board: PedalBoard) -> some View {
|
||||
|
||||
Reference in New Issue
Block a user