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:
@@ -55,11 +55,11 @@ struct ShoeGazeMultiBoardTests {
|
||||
let shoeGazeA: ShoeGaze = ShoeGaze(engine: engineA)
|
||||
let board1: PedalBoard = try shoeGazeA.addBoard()
|
||||
board1.label = "Lead"
|
||||
try shoeGazeA.appendPedal(type: "Overdrive", to: board1)
|
||||
try shoeGazeA.appendPedal(.overdrive, to: board1)
|
||||
try shoeGazeA.finalizeBoard(board1)
|
||||
let board2: PedalBoard = try shoeGazeA.addBoard()
|
||||
board2.label = "Clean"
|
||||
try shoeGazeA.appendPedal(type: "Graphic EQ", to: board2)
|
||||
try shoeGazeA.appendPedal(.graphicEQ, to: board2)
|
||||
try shoeGazeA.finalizeBoard(board2)
|
||||
|
||||
let snapshot: Data = try shoeGazeA.rigData()
|
||||
|
||||
Reference in New Issue
Block a user