Files
ShoeGaze/Sources/LyrebirdShoeGaze/Pedals/LooperTransportState.swift
T
josh 465e3e6dfd Looper: multi-slot + timeline + stop/cue-stop, quantized transport
Checkpoint before the multitrack redesign. Adds 4 loop slots (one player
swapped via setBuffer), a play-head timeline with A/B/C/D dots, Loop/Stop/
Cue Stop/Reverse stomp toggles below the knobs, beat-quantized transport,
overdub undo, reverse, and feedback-decay overdub — all reviewed for RT
safety (transportGeneration guards on deferred beat/undo/cue callbacks).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 14:14:46 -07:00

34 lines
1.2 KiB
Swift

// LooperTransportState.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
/// Publicly-observable transport phase of ``LooperPedal``, surfaced for the UI so it can
/// colour the record LED, animate the "waiting for the next beat" armed states, and drive
/// the loop timeline.
///
/// The two `armed…` cases exist only when the pedal has a tempo ``LyrebirdClock`` — a
/// transport action then waits for the next beat boundary before it takes effect. Without a
/// clock the pedal transitions straight between ``empty``, ``recording`` and ``playing``.
public enum LooperTransportState: Sendable, Equatable {
/// No take recorded yet. `Record` begins recording (or arms it, with a clock).
case empty
/// A `Record` has been requested and the pedal is waiting for the next beat to start.
case armedRecord
/// Actively recording the primary take.
case recording
/// A stop has been requested and the pedal is waiting for the next beat to close the loop.
case armedStop
/// Looping playback of the recorded take (overdub / reverse / mute apply here).
case playing
/// Playback halted by a stop, but a recorded loop is still loaded (ready to resume).
case stopped
}