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>
This commit is contained in:
@@ -24,7 +24,7 @@ import LyrebirdUI
|
||||
public struct PedalButton {
|
||||
|
||||
/// Style of button behavior, mirroring `ParameterButton.Style` in `LyrebirdUI`.
|
||||
public enum Style {
|
||||
public enum Style: Equatable {
|
||||
/// Executes `action` on each press.
|
||||
case momentary
|
||||
/// Flips `node` between `0` and `1` on each press.
|
||||
@@ -43,16 +43,25 @@ public struct PedalButton {
|
||||
/// The action run on each press. Non-`nil` only for `.momentary` style.
|
||||
public let action: (() -> Void)?
|
||||
|
||||
/// Optional LED-indicator node for a `.momentary` button. When non-`nil`, the button is
|
||||
/// drawn in the same LED + footswitch style as a `.toggle` button, with the LED lit while
|
||||
/// this node reads `≥ 0.5` — letting a momentary action reflect a persistent state (e.g. a
|
||||
/// looper's Stop lit while stopped, Cue Stop lit while armed). `nil` renders a plain button.
|
||||
public let indicator: UIParamNode?
|
||||
|
||||
/// Creates a momentary action button.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - label: Short label shown on the button.
|
||||
/// - indicator: Optional state node driving an LED (see ``indicator``). Defaults to `nil`
|
||||
/// for a plain button.
|
||||
/// - action: Closure run on each press.
|
||||
public init(label: String, action: @escaping () -> Void) {
|
||||
public init(label: String, indicator: UIParamNode? = nil, action: @escaping () -> Void) {
|
||||
self.label = label
|
||||
self.style = .momentary
|
||||
self.node = nil
|
||||
self.action = action
|
||||
self.indicator = indicator
|
||||
}
|
||||
|
||||
/// Creates a toggle button bound to a `UIParamNode`.
|
||||
@@ -66,5 +75,6 @@ public struct PedalButton {
|
||||
self.style = .toggle
|
||||
self.node = node
|
||||
self.action = nil
|
||||
self.indicator = nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user