Add "All Boards On" as a mappable switch action
Maps the rig's "All" button (selectAllBoards — cancel any solo, bring every board back up) to a Program Change. One-shot (no latch); rig-level, so no board hint. Appears in the Switches section under Rig Bypass. Test: PC fires selectAllBoards, clearing an active solo. 320 green; both app targets build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -317,6 +317,9 @@ public final class MIDIController {
|
||||
switch action {
|
||||
case .rigBypass:
|
||||
shoeGaze.toggleRigBypassed()
|
||||
case .allBoards:
|
||||
// One-shot: cancel any solo and bring every board back up.
|
||||
shoeGaze.selectAllBoards(crossfadeSeconds: boardActionCrossfade)
|
||||
case .boardSolo(let boardIndex):
|
||||
guard let board: PedalBoard = board(at: boardIndex), matchesBoard(board, hint) else { return }
|
||||
shoeGaze.soloBoard(board, crossfadeSeconds: boardActionCrossfade)
|
||||
@@ -339,7 +342,7 @@ public final class MIDIController {
|
||||
/// A display-name hint for an action, captured at learn time for stale-binding detection.
|
||||
private func hint(for action: MIDIMap.Action) -> String? {
|
||||
switch action {
|
||||
case .rigBypass:
|
||||
case .rigBypass, .allBoards:
|
||||
return nil
|
||||
case .boardSolo(let index), .boardAudible(let index), .boardBypass(let index):
|
||||
return board(at: index)?.label
|
||||
|
||||
@@ -41,6 +41,8 @@ public struct MIDIMap: Codable, Equatable, Sendable {
|
||||
/// so boolean actions latch in software; `boardSolo` is exclusive (radio).
|
||||
public enum Action: Codable, Equatable, Sendable {
|
||||
case rigBypass
|
||||
/// Cancels any solo and makes every board audible again (the "All" button).
|
||||
case allBoards
|
||||
case boardSolo(boardIndex: Int)
|
||||
case boardAudible(boardIndex: Int)
|
||||
case boardBypass(boardIndex: Int)
|
||||
|
||||
@@ -99,6 +99,7 @@ public struct MIDIMappingSheet: View {
|
||||
private var switchRowModels: [SwitchRowModel] {
|
||||
var rows: [SwitchRowModel] = [
|
||||
SwitchRowModel(id: "sw-rig", action: .rigBypass, label: "Rig Bypass"),
|
||||
SwitchRowModel(id: "sw-all", action: .allBoards, label: "All Boards On"),
|
||||
]
|
||||
for boardPair in shoeGaze.boards.enumerated() {
|
||||
let boardIndex: Int = boardPair.offset
|
||||
|
||||
Reference in New Issue
Block a user