fix(amps): recall rebuilds on a rebuildsOnChange switch (channel)

Review blocker: lightweight recall (ShoeGaze.applyState) detected topology change
only via Pedal.rebuildSelectorValues (effectSelectors), so a channel switch —
the first rebuildsOnChange *switch* — flipped during a scene recall wrote the
node value but never rebuilt, leaving the stale channel topology (wrong preamp).

- Rename/extend to Pedal.rebuildTopologyValues: folds in effectSwitches flagged
  rebuildsOnChange alongside the selectors (both NaN-sanitized). Recall call sites
  in ShoeGaze+Preset updated.
- FullertonDrive: rename channel constants to generic switchOff/On (used by the
  Bright switch too).
- Test: applyStateRebuildsBoardWhenChannelSwitchChanges — recall flipping the
  channel rebuilds the board and applies the recalled channel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 13:10:23 -07:00
parent da4d5e23ea
commit e88db04686
4 changed files with 51 additions and 16 deletions
@@ -36,8 +36,8 @@ public final class FullertonDriveAmpPedal: AmpVoicePedal {
private let reverbRange: ClosedRange<Double> = 0.0 ... 1.0
private let driveRange: ClosedRange<Double> = 1.0 ... 30.0
private let cleanValue: Double = 0.0
private let driveValue: Double = 1.0
private let switchOffValue: Double = 0.0
private let switchOnValue: Double = 1.0
public override var toneStackModel: ToneStackModel { .fender }
public override var summaryText: String {
@@ -59,16 +59,16 @@ public final class FullertonDriveAmpPedal: AmpVoicePedal {
label: "Bright",
node: $bright,
options: [
PedalSwitch.Option(title: "Off", value: cleanValue),
PedalSwitch.Option(title: "On", value: driveValue),
PedalSwitch.Option(title: "Off", value: switchOffValue),
PedalSwitch.Option(title: "On", value: switchOnValue),
]
),
PedalSwitch(
label: "Channel",
node: $channel,
options: [
PedalSwitch.Option(title: "Clean", value: cleanValue),
PedalSwitch.Option(title: "Drive", value: driveValue),
PedalSwitch.Option(title: "Clean", value: switchOffValue),
PedalSwitch.Option(title: "Drive", value: switchOnValue),
],
rebuildsOnChange: true
),