39 lines
1.3 KiB
Swift
39 lines
1.3 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
|
|
|
|
/// 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.
|
|
case conductor
|
|
|
|
/// Resolve the selection from `LYREBIRD_DEMO` (defaults to `.vector`).
|
|
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"
|
|
}
|
|
}
|
|
}
|