Files
Lyrebird/Demos/LyrebirdGUIDemo/Sources/LyrebirdGUIDemoKit/DemoSelection.swift
T
josh 06bdcbbe92 v2.3.1 release: cross-platform LyrebirdGUIDemo + Linux demo ports + doc refresh
- New Demos/LyrebirdGUIDemo: one shared source (synths + node-based views) that
  bootstraps SwiftUI on macOS and GTK4/SwiftOpenUI on Linux; LYREBIRD_DEMO=vector|sine.
- The four CLI demos (Quickstart/Demo/NRT/Score) now build and run on Linux.
- README + Linux getting-started refreshed; LyrebirdATK row removed from the
  Extensions section pending collaborator sign-off.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-29 11:34:24 -08:00

34 lines
1.1 KiB
Swift

// DemoSelection.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import Foundation
/// Which synthesizer the demo runs, chosen by the `LYREBIRD_DEMO` environment
/// variable. Both front ends (AppKit on macOS, GTK4 on Linux) read the same
/// selection so one binary covers every patch.
public enum DemoSelection: String, Sendable {
/// Vector oscillator with an XY blend pad (the default).
case vector
/// Stereo sine tone with frequency / amplitude / pan controls.
case sine
/// Resolve the selection from `LYREBIRD_DEMO` (defaults to `.vector`).
public static func fromEnvironment() -> DemoSelection {
let raw: String = ProcessInfo.processInfo.environment["LYREBIRD_DEMO"]?.lowercased() ?? "vector"
return DemoSelection(rawValue: raw) ?? .vector
}
/// Title-bar text for the window hosting this demo.
public var windowTitle: String {
switch self {
case .vector: return "Lyrebird — Vector Oscillator"
case .sine: return "Lyrebird — Sine Tone"
}
}
}