// FactoryRigBuild.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT /// How a ``FactoryRig`` builds its graph at seed time. public enum FactoryRigBuild: Sendable { /// Appends pedals to a single pre-made, empty board; the seeding driver calls `addBoard` before /// and `finalizeBoard` after. case singleBoard(@MainActor (_ session: ShoeGaze, _ board: PedalBoard) throws -> Void) /// Builds the whole graph against the session (boards and/or routers), owning its own /// `addBoard`/`finalizeBoard` and `makeChainRouter`/`finalize` lifecycle. case session(@MainActor (_ session: ShoeGaze) throws -> Void) /// Ships a pre-captured ``ShoeGazeState`` directly — the entry is built from it with no live /// session. Use for a complex, hand-authored rig captured from the app, where transcribing the /// exact `PedalState` arrays (mix, sliders, selectors, advanced values) is more faithful than /// re-deriving them through typed setters. The closure returns the state so the case stays /// `Sendable` without requiring `ShoeGazeState` itself to be `Sendable`. case state(@MainActor () -> ShoeGazeState) }