Files
Lyrebird/Sources/Lyrebird/NodeTree/NodePosition.swift
T
josh 560724d116 v1.3.0 release: graceful-release fix, quickstart template + demo, documentation accuracy pass
- Fixed: SynthesizerBase subclasses' release/free now dispatch correctly (gated
  synths were hard-freed instead of released).
- New: quickstart project template + LyrebirdQuickstartDemo.
- Docs: every example typechecked or provably illustrative (426->542); ~20
  wrong-API examples fixed; root docs brought under the compile guard.
- Fixed: NRT/Score demo Package.swift build from terminal again.

See RELEASES.md for details.
2026-07-17 14:05:01 -07:00

31 lines
1.1 KiB
Swift

// NodePosition.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
/// Describes where to insert a new Synthesizer node in the signal graph.
///
/// ```swift
/// let group = Group()
/// try engine.add(group)
///
/// let tone = SineTone()
/// try engine.add(tone, position: .head(of: group)) // insert at front of group
///
/// let lead = LeadSynth()
/// try engine.add(lead, position: .after(tone)) // insert immediately after tone
/// ```
public enum NodePosition {
/// Insert at the front of the specified group (evaluated first within that group).
case head(of: Group)
/// Insert at the back of the specified group (evaluated last within that group).
case tail(of: Group)
/// Insert immediately before the specified synthesizer in whichever group contains it.
/// Falls back to `mainGroup` head insertion if the target is not found.
case before(any Synthesizer)
/// Insert immediately after the specified synthesizer in whichever group contains it.
/// Falls back to `mainGroup` head insertion if the target is not found.
case after(any Synthesizer)
}