Add .stereo mode to the macOS demo app

New DemoMode.stereo: Overdrive → splitStereo(Delay | Ping-Pong) →
collectStereo, finalized to stereo output. DemoRootView renders the
pre-split board + StereoWidthBadge above StereoSplitSectionView, so the
four StereoRoute modes are selectable live. No new files / no .pbxproj
change — the demo already links LyrebirdShoeGazeUI. BUILD SUCCEEDED.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 16:57:09 -07:00
parent 30e96b8ee1
commit 5522109689
3 changed files with 92 additions and 0 deletions
@@ -32,6 +32,10 @@ enum DemoMode: String, CaseIterable, Identifiable {
/// B: Fuzz + Reverb) and recombines them through a shared master stage.
case router = "Router"
/// A board with a ``StereoSplitSection`` (Overdrive → splitStereo(Delay | PingPong) →
/// collectStereo) showcasing the four ``StereoRoute`` modes and stereo output.
case stereo = "Stereo"
var id: String { rawValue }
/// Short human-readable title used in the mode picker.
@@ -41,6 +45,7 @@ enum DemoMode: String, CaseIterable, Identifiable {
case .editor: return "Editor"
case .parallel: return "Parallel"
case .router: return "Router"
case .stereo: return "Stereo"
}
}
}
@@ -79,6 +84,9 @@ final class ShoeGazeDemoController {
/// Non-nil only in `.parallel` mode, after ``buildParallel()`` succeeds.
private(set) var parallelSection: ParallelSection?
/// Non-nil only in `.stereo` mode, after ``buildStereo()`` succeeds.
private(set) var stereoSection: StereoSplitSection?
/// Stores named board snapshots for the `.editor` showcase.
let versionStore: BoardVersionStore = BoardVersionStore()
@@ -165,6 +173,7 @@ final class ShoeGazeDemoController {
shoeGaze.teardown()
router = nil
parallelSection = nil
stereoSection = nil
shoeGaze = ShoeGaze(engine: engine, inputSource: inputSource)
@@ -173,6 +182,7 @@ final class ShoeGazeDemoController {
case .editor: buildEditor()
case .parallel: buildParallel()
case .router: buildRouter()
case .stereo: buildStereo()
}
if wasRunning { start() }
@@ -279,5 +289,29 @@ final class ShoeGazeDemoController {
print("[ShoeGazeDemoController] buildRouter failed: \(error)")
}
}
/// `.stereo` — Overdrive → splitStereo(left: Delay | right: Ping-Pong) → collectStereo.
///
/// Demonstrates the stereo split mechanism: a mono signal fanned into two independently
/// authored chains that become the left and right output channels, with the four
/// ``StereoRoute`` modes (stereo / left / right / bypass) selectable live. Stores the
/// `StereoSplitSection` so `DemoRootView` can display `StereoSplitSectionView`.
private func buildStereo() {
do {
let board: PedalBoard = try shoeGaze.addBoard()
board.label = "Stereo Board"
try board.add(OverdrivePedal())
let section: StereoSplitSection = try board.splitStereo()
try section.left.add(DelayPedal())
try section.right.add(PingPongDelayPedal())
try board.collectStereo(section)
try shoeGaze.finalizeBoard(board)
stereoSection = section
} catch {
print("[ShoeGazeDemoController] buildStereo failed: \(error)")
}
}
}
#endif