feat(amps): channel-switch enabler + drive-channel amps (Phase 4)
Enabler: - PedalSwitch.rebuildsOnChange (mirrors PedalSelectorKnob): a switch that changes graph topology asks the host to rebuild. Wired through PedalSwitchView (onCommit on a changed tap) and PedalView.switchRow → pedalRebuildAction. - AmpVoicePedal.preampStage(_:) overridable hook (default: one TriodeStage at Gain). preCabinetCore feeds it; a channel amp cascades an extra stage on its drive channel. Named preampOversample constant (4). Amps: - Fullerton Drive — American two-channel combo: blackface Clean + an overdrive channel (cascaded TriodeStage set by Drive), spring reverb, Bright. Channel switch is rebuildsOnChange, so only the selected channel's stages are built. - Jazz Clean — add the JC onboard Distortion channel (Clean/Dist switch + Drive knob) via the same preampStage cascade; flows through its stereo wideEffect. Registered Fullerton Drive across 6 sites as .amp. 22 tests across the two amps (channel switch changes output, drive knob, rebuildsOnChange, ceiling on the drive channel, control surface, round-trip, registry). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,9 @@ public struct PedalSwitchView: View {
|
||||
// MARK: - Properties
|
||||
|
||||
private let pedalSwitch: PedalSwitch
|
||||
/// Called once when a tap commits a different position — used to trigger a board rebuild for
|
||||
/// `rebuildsOnChange` switches (e.g. a channel switch). `nil` for plain switches.
|
||||
private let onCommit: (() -> Void)?
|
||||
|
||||
@Environment(\.shoeGazeTempoEnabled) private var tempoEnabled: Bool
|
||||
|
||||
@@ -56,9 +59,13 @@ public struct PedalSwitchView: View {
|
||||
|
||||
/// Creates a segmented switch view.
|
||||
///
|
||||
/// - Parameter pedalSwitch: The discrete switch descriptor to render.
|
||||
public init(_ pedalSwitch: PedalSwitch) {
|
||||
/// - Parameters:
|
||||
/// - pedalSwitch: The discrete switch descriptor to render.
|
||||
/// - onCommit: Called when a tap selects a different position. Used for `rebuildsOnChange`
|
||||
/// switches; `nil` otherwise.
|
||||
public init(_ pedalSwitch: PedalSwitch, onCommit: (() -> Void)? = nil) {
|
||||
self.pedalSwitch = pedalSwitch
|
||||
self.onCommit = onCommit
|
||||
}
|
||||
|
||||
// MARK: - Body
|
||||
@@ -97,7 +104,9 @@ public struct PedalSwitchView: View {
|
||||
|
||||
private func segment(option: PedalSwitch.Option, isActive: Bool) -> some View {
|
||||
Button(action: {
|
||||
let changed: Bool = option.value != pedalSwitch.node.value
|
||||
pedalSwitch.node.update(option.value)
|
||||
if changed { onCommit?() }
|
||||
}) {
|
||||
Text(option.title)
|
||||
.font(.system(size: PedalSwitchView.fontSize, weight: .semibold))
|
||||
|
||||
Reference in New Issue
Block a user