// PedalLane.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT /// Addresses where a linear pedal edit applies: the board's main chain, or one branch of a /// split region (stereo split or parallel section). /// /// `region` is the index of the region's segment within the board's top-level segment list /// (`board.captureState().segments`). For a `.stereoSplit` segment, `.left`/`.right` map to its /// left/right branches; for a `.parallel` segment they map to branch A/B. public enum PedalLane: Equatable, Sendable { /// The board's top-level linear chain (the `.pedal` segments). case main /// The left branch (stereo) / branch A (parallel) of the region segment at `region`. case left(region: Int) /// The right branch (stereo) / branch B (parallel) of the region segment at `region`. case right(region: Int) /// The region segment index this lane targets, or `nil` for ``main``. public var regionIndex: Int? { switch self { case .main: return nil case .left(let region), .right(let region): return region } } /// `true` for the left / A branch; `false` for the right / B branch. `false` for ``main``. public var isLeftBranch: Bool { if case .left = self { return true } return false } }