diff --git a/Sources/LyrebirdShoeGazeUI/LooperTimelineView.swift b/Sources/LyrebirdShoeGazeUI/LooperTimelineView.swift index 7935089..b90bc06 100644 --- a/Sources/LyrebirdShoeGazeUI/LooperTimelineView.swift +++ b/Sources/LyrebirdShoeGazeUI/LooperTimelineView.swift @@ -78,7 +78,9 @@ struct LooperTimelineView: View { track stateIndicator } - .task { + // Key the poll on the pedal instance: if a rig load / rebuild swaps in a new LooperPedal, + // `.task` alone would keep polling the old (captured) instance and freeze. Restart on change. + .task(id: ObjectIdentifier(pedal)) { while !Task.isCancelled { position = pedal.playbackPosition01() state = pedal.transportState diff --git a/Sources/LyrebirdShoeGazeUI/PedalView.swift b/Sources/LyrebirdShoeGazeUI/PedalView.swift index 0f69aa4..972dc69 100644 --- a/Sources/LyrebirdShoeGazeUI/PedalView.swift +++ b/Sources/LyrebirdShoeGazeUI/PedalView.swift @@ -309,7 +309,10 @@ public struct PedalView: View { knobGrid selectorRow switchRow + // Keyed on the pedal instance so the buttons' live captions (which poll the pedal + // via `.task`) re-subscribe when a rig load / rebuild swaps in a new pedal instance. transportButtonRow + .id(ObjectIdentifier(pedal)) buttonRow sliderBank(sliders) Spacer(minLength: 0)