Replace stringly-typed pedal API with PedalType tokens

appendPedal(type: String, to:) is replaced by appendPedal(_ kind: PedalType, to:),
where PedalType is an extensible RawRepresentable struct with static members for
the built-in pedals:

    try shoeGaze.appendPedal(.overdrive, to: board)

Discoverable/autocompleting call sites, still open for custom pedals
(PedalType("My Pedal")). rawValue == the pedal's displayName, so PedalRegistry
and the rig JSON format are unchanged — saved rigs load exactly as before.

Named PedalType (not PedalKind) to avoid colliding with Lyrebird's score-notation
PedalKind enum, which is visible when both modules are imported. The UI palette
wraps its registry-key strings as PedalType(key); demos/tests use the static
members. PedalRegistry.makePedal(type:) stays string-keyed as the serialization
boundary used by loadRig.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 20:34:45 -07:00
parent 24ce4564e8
commit 21b9123a87
11 changed files with 109 additions and 34 deletions
@@ -443,7 +443,7 @@ public struct BoardFlowView: View {
private func append(type: String, lane: PedalLane) {
guard let board: PedalBoard = board else { return }
do { _ = try shoeGaze.appendPedal(type: type, to: board, lane: lane) }
do { _ = try shoeGaze.appendPedal(PedalType(type), to: board, lane: lane) }
catch { print("[BoardFlowView] appendPedal failed: \(error)") }
}