Document input mute in Help; pulsing glow while muted

- Help: cover the input mute in Setup ("input starts muted on every Start"),
  Choosing an Input (hard input gate vs the output Rig Mute, MIDI-mappable), and
  the MIDI switch list (Rig Mute / Input Mute).
- Input-mute button is now its own view with a pulsing red ring + shadow that
  oscillates under a repeatForever animation while muted, so new users see why
  the rig is silent. The glow settles out when un-muted and never intercepts taps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 15:44:02 -07:00
parent b0294612f8
commit 5542ee5b5a
2 changed files with 78 additions and 16 deletions
@@ -1209,19 +1209,71 @@ public struct ShoeGazeBuilderView: View {
}
/// Input-mute toggle, shown beside the Start/Stop transport. Silences the incoming guitar / mic
/// signal (distinct from the rig-output mute). Comes up muted on each engine start.
/// signal (distinct from the rig-output mute). Comes up muted on each engine start, with a
/// pulsing red glow while muted so new users spot why they hear nothing.
private var inputMuteButton: some View {
let muted: Bool = shoeGaze.inputMuted
return Button {
shoeGaze.toggleInputMuted()
} label: {
Label(muted ? "Input Muted" : "Mute Input",
systemImage: muted ? "mic.slash.fill" : "mic.fill")
.font(.subheadline)
InputMuteButton(shoeGaze: shoeGaze)
}
/// The input-mute toggle with a pulsing red glow while active. Its own view so it can own the
/// repeating-animation state; the glow reads `pulse`, which oscillates under a `repeatForever`
/// animation only while the input is muted.
private struct InputMuteButton: View {
let shoeGaze: ShoeGaze
/// Oscillates 0↔1 under a repeating animation while muted, driving the glow's radius/opacity.
@State private var pulse: Bool = false
private static let glowCornerRadius: CGFloat = 6
private static let glowLineWidth: CGFloat = 1.5
private static let glowRadiusLow: CGFloat = 2
private static let glowRadiusHigh: CGFloat = 9
private static let glowOpacityLow: Double = 0.35
private static let glowOpacityHigh: Double = 0.95
private static let pulseDuration: Double = 0.85
var body: some View {
let muted: Bool = shoeGaze.inputMuted
return Button {
shoeGaze.toggleInputMuted()
} label: {
Label(muted ? "Input Muted" : "Mute Input",
systemImage: muted ? "mic.slash.fill" : "mic.fill")
.font(.subheadline)
}
.buttonStyle(.bordered)
.tint(muted ? .red : .gray)
.overlay(glow(muted: muted))
.help("Mute the input feeding the pedals — silences the incoming guitar / mic signal")
.onChange(of: muted) { _, nowMuted in startOrStopPulse(muted: nowMuted) }
.onAppear { startOrStopPulse(muted: muted) }
}
/// A red ring + shadow that pulses while muted, and is invisible otherwise. Non-interactive
/// so it never intercepts the button's taps.
private func glow(muted: Bool) -> some View {
RoundedRectangle(cornerRadius: InputMuteButton.glowCornerRadius, style: .continuous)
.strokeBorder(Color.red, lineWidth: InputMuteButton.glowLineWidth)
.shadow(
color: Color.red,
radius: pulse ? InputMuteButton.glowRadiusHigh : InputMuteButton.glowRadiusLow
)
.opacity(muted ? (pulse ? InputMuteButton.glowOpacityHigh : InputMuteButton.glowOpacityLow) : 0)
.allowsHitTesting(false)
}
/// Starts the forever-repeating pulse when muted, or settles it back to rest when not.
private func startOrStopPulse(muted: Bool) {
if muted {
pulse = false
withAnimation(.easeInOut(duration: InputMuteButton.pulseDuration).repeatForever(autoreverses: true)) {
pulse = true
}
} else {
withAnimation(.easeOut(duration: 0.2)) { pulse = false }
}
}
.buttonStyle(.bordered)
.tint(muted ? .red : .gray)
.help("Mute the input feeding the pedals — silences the incoming guitar / mic signal")
}
// MARK: - Board area