Looper reverse fix + header layout compaction + tempo toggle
Looper: - Reverse now continues from the current play-head instead of jumping to duration-minus-position; anchor-based position tracking survives direction changes. Sync mode defers the flip to the next beat; Free applies immediately. - Sync switch relabeled "Sync to Tempo". Tempo/Tuner: - Add a Tempo on/off toggle (ShoeGaze.setTempoEnabled) that hides the indicator and forces every tempo-dependent pedal switch (PedalSwitch.tempoDependent) off; PedalSwitchView disables such switches via the shoeGazeTempoEnabled environment. - Tuner readout laid out inline; Tempo/Tuner pinned to fixed heights so toggling state no longer shifts surrounding layout. Header: - Collapsed to two rows: title + Tempo/Tuner (left, stacked) and engine options over input controls (right, trailing-aligned). TAP is a standard-height button. - Removed the redundant Boards button; moved Clear into the board bar. - Fixed the rig mute glyph size so toggling mute doesn't shift the volume row. Help: added a Looper section documenting transport, Free/Sync, knobs, tracks, and MIDI-assignable actions. Tests: TempoEnableTests + looper reverse/deferral coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -56,6 +56,9 @@ public struct BoardBarView: View {
|
||||
private static let ledDimBrightness: Double = 0.16
|
||||
private static let ledRimOpacity: Double = 0.30
|
||||
private static let soloButtonSize: CGFloat = 22
|
||||
/// Fixed size for the rig mute glyph so the slash / wave states don't shift the volume row.
|
||||
private static let muteIconWidth: CGFloat = 16
|
||||
private static let muteIconHeight: CGFloat = 16
|
||||
private static let editingBorderWidth: CGFloat = 2
|
||||
private static let idleBorderOpacity: Double = 0.18
|
||||
private static let cellBackgroundBrightness: Double = 0.14
|
||||
@@ -71,6 +74,7 @@ public struct BoardBarView: View {
|
||||
@Binding private var editingBoardIndex: Int
|
||||
@Binding private var crossfadeSeconds: Double
|
||||
private let onAddBoard: () -> Void
|
||||
private let onClearBoards: (() -> Void)?
|
||||
|
||||
@State private var mode: PlayMode = .solo
|
||||
|
||||
@@ -84,16 +88,20 @@ public struct BoardBarView: View {
|
||||
/// tap writes this).
|
||||
/// - crossfadeSeconds: Crossfade duration applied to every board switch / toggle.
|
||||
/// - onAddBoard: Called when the trailing **+** button is tapped.
|
||||
/// - onClearBoards: Called when the trailing **Clear** button is tapped. When `nil`
|
||||
/// (the default) no Clear button is shown.
|
||||
public init(
|
||||
shoeGaze: ShoeGaze,
|
||||
editingBoardIndex: Binding<Int>,
|
||||
crossfadeSeconds: Binding<Double>,
|
||||
onAddBoard: @escaping () -> Void
|
||||
onAddBoard: @escaping () -> Void,
|
||||
onClearBoards: (() -> Void)? = nil
|
||||
) {
|
||||
self.shoeGaze = shoeGaze
|
||||
self._editingBoardIndex = editingBoardIndex
|
||||
self._crossfadeSeconds = crossfadeSeconds
|
||||
self.onAddBoard = onAddBoard
|
||||
self.onClearBoards = onClearBoards
|
||||
}
|
||||
|
||||
// MARK: - Body
|
||||
@@ -109,6 +117,11 @@ public struct BoardBarView: View {
|
||||
boardCell(index: pair.offset, board: pair.element)
|
||||
}
|
||||
addButton
|
||||
if let onClearBoards: () -> Void = onClearBoards {
|
||||
Button("Clear") { onClearBoards() }
|
||||
.buttonStyle(.bordered).tint(.red)
|
||||
.help("Remove all boards in the current rig (with the option to save first)")
|
||||
}
|
||||
}
|
||||
.frame(height: BoardBarView.barHeight)
|
||||
}
|
||||
@@ -175,7 +188,10 @@ public struct BoardBarView: View {
|
||||
Button {
|
||||
shoeGaze.toggleRigMuted()
|
||||
} label: {
|
||||
// Fixed width: the slash / wave glyphs differ in width, which would otherwise
|
||||
// shift the whole volume row a few pixels when toggling mute.
|
||||
Image(systemName: shoeGaze.rigMuted ? "speaker.slash.fill" : "speaker.wave.2.fill")
|
||||
.frame(width: BoardBarView.muteIconWidth, height: BoardBarView.muteIconHeight)
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.tint(shoeGaze.rigMuted ? .red : .orange)
|
||||
|
||||
Reference in New Issue
Block a user