/**
 * The subtitle bus — THE SPEAKER captions THE SCREEN.
 *
 * The flagship cross-organ trick (round 5 order 6): when the radio is tuned to a talking
 * station, the sky's chyron subtitles the audio. Both organs are LANE-SCREEN, so this is a
 * sanctioned in-lane channel: THE SPEAKER (src/audio) writes, THE SCREEN (src/screen) reads.
 * A module-level singleton keeps it out of the contract — main.ts never has to marshal it.
 *
 * Deliberately trivial and dependency-free so both sides can import it without coupling to
 * each other's guts.
 */

let current = '';

/** Set the line the sky should be showing (''/empty clears it). Called by the tuned station. */
export function setSubtitle(line: string): void {
  current = line ?? '';
}

/** Read the current caption. Called by THE SCREEN each frame when building its chyron. */
export function getSubtitle(): string {
  return current;
}
