Add rig-wide output volume + hard mute, MIDI-mappable
Volume is a CC-mappable [0,1] gain applied after every board's output; mute is a separate hard gate (not the existing dry bypass), togglable via Program Change. Both are lagged to avoid clicks and fan out across all boards from a single ShoeGaze-level setter. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -151,10 +151,38 @@ public struct BoardBarView: View {
|
||||
.monospacedDigit()
|
||||
.foregroundStyle(Color.white.opacity(BoardBarView.labelOpacity))
|
||||
}
|
||||
|
||||
rigVolumeRow
|
||||
}
|
||||
.frame(width: BoardBarView.controlColumnWidth)
|
||||
}
|
||||
|
||||
/// Rig-wide output volume + mute (applies to the whole rig, after every board).
|
||||
private var rigVolumeRow: some View {
|
||||
HStack(spacing: BoardBarView.cellInnerSpacing) {
|
||||
Text("Vol")
|
||||
.font(.caption2)
|
||||
.foregroundStyle(Color.white.opacity(BoardBarView.labelOpacity))
|
||||
Slider(
|
||||
value: Binding(
|
||||
get: { shoeGaze.rigVolume },
|
||||
set: { shoeGaze.setRigVolume($0) }
|
||||
),
|
||||
in: 0.0 ... 1.0
|
||||
)
|
||||
.frame(minWidth: BoardBarView.crossfadeSliderMinWidth)
|
||||
.disabled(shoeGaze.rigMuted)
|
||||
Button {
|
||||
shoeGaze.toggleRigMuted()
|
||||
} label: {
|
||||
Image(systemName: shoeGaze.rigMuted ? "speaker.slash.fill" : "speaker.wave.2.fill")
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.tint(shoeGaze.rigMuted ? .red : .orange)
|
||||
.help(shoeGaze.rigMuted ? "Unmute the rig output" : "Mute the rig output")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Board cell
|
||||
|
||||
@ViewBuilder
|
||||
|
||||
@@ -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-mute", action: .rigMute, label: "Rig Mute"),
|
||||
SwitchRowModel(id: "sw-all", action: .allBoards, label: "All Boards On"),
|
||||
]
|
||||
for boardPair: (offset: Int, element: PedalBoard) in shoeGaze.boards.enumerated() {
|
||||
@@ -124,7 +125,9 @@ public struct MIDIMappingSheet: View {
|
||||
}
|
||||
|
||||
private var ccRowModels: [CCRowModel] {
|
||||
var rows: [CCRowModel] = []
|
||||
var rows: [CCRowModel] = [
|
||||
CCRowModel(id: "cc-rigvol", target: .rigVolume, label: "Rig · Volume"),
|
||||
]
|
||||
for boardPair: (offset: Int, element: PedalBoard) in shoeGaze.boards.enumerated() {
|
||||
let boardIndex: Int = boardPair.offset
|
||||
let board: PedalBoard = boardPair.element
|
||||
|
||||
Reference in New Issue
Block a user