20 lines
720 B
Swift
20 lines
720 B
Swift
// PedalBoard+Preset.swift
|
|
// Lyrebird
|
|
//
|
|
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
extension PedalBoard {
|
|
|
|
/// Captures the current state of this board's label and pedal chain as a `BoardState`.
|
|
///
|
|
/// Each pedal's `displayName`, knob values, and bypass flag are snapshotted in
|
|
/// signal-flow order. The engine graph is not modified; this is a read-only operation.
|
|
///
|
|
/// - Returns: A `BoardState` reflecting the board's current label and pedal parameters.
|
|
public func captureState() -> BoardState {
|
|
let pedalStates: [PedalState] = pedals.map { $0.captureState() }
|
|
return BoardState(label: label, pedals: pedalStates)
|
|
}
|
|
}
|