Files
Lyrebird/Demos/LyrebirdGUIDemo/Sources/LyrebirdGUIDemoKit/DemoSelection.swift
T
josh ec72bd3a4c v2.4.1 release: scratchpad polish + demo cleanup
Maintenance release, no framework API changes.

Scratchpad: Kill All Sound (⌘K) rename, mode-switch desync fix,
code-completion prefix filtering restored (⌃Space Show Completions).
Demos: GUIDemo voices + CLI EventPattern BlipVoice moved into
Synthesizers/, EventPattern demo split into makeLead/makeBass, GUIDemo
doc drift fixed (conductor default). LyrebirdScratch gains a SwiftPM
package so the workspace shows it like GUIDemo (.xcodeproj kept for
distribution). Linux live-coding scratchpad documented.
2026-12-03 11:39:40 -08:00

40 lines
1.4 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.
case vector
/// Stereo sine tone with frequency / amplitude / pan controls.
case sine
/// Live event ensemble: engine start/stop plus top and bottom parts driven by an
/// ``EventConductor``. The view owns the engine, so nothing starts at launch.
/// This is the default — it showcases the headline event system.
case conductor
/// Resolve the selection from `LYREBIRD_DEMO` (defaults to `.conductor`).
public static func fromEnvironment() -> DemoSelection {
let raw: String = ProcessInfo.processInfo.environment["LYREBIRD_DEMO"]?.lowercased() ?? "conductor"
return DemoSelection(rawValue: raw) ?? .conductor
}
/// 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"
case .conductor: return "Lyrebird — Event Conductor"
}
}
}