Events
The backend sends 13 events, plus one in development builds only. Each is emitted with app.emit, so every window receives it. Windows subscribe with listen() from src/lib/api.ts. In the browser preview, events travel on a BroadcastChannel named altar-mock.
Live and outputs
| Event | Payload | Sent when | Listened to by |
|---|---|---|---|
live:frame | Frame | After every coordinator change, and when outputs open, close or are lost | Audience and confidence windows (useLiveFrame in src/output/AudienceApp.tsx) |
live:state | LiveState | After every coordinator change, and after live_preview | The control window (usePresent.init in src/state/present.ts) |
live:ack | {role, revision, at} | An output window acknowledged a revision | Nothing at present. The control window sees acknowledgements through LiveState.audience.ackRevision and .confidence.ackRevision on the next live:state. |
output:lost | {role, monitor} | The display watch found an assigned display missing | The control window: cancels the Enter gesture and shows a 15-second warning |
Listening
Sent by speech.rs for Listen on this computer. Every payload except speech:download carries the session from SpeechStatus, so events from a stopped session can be ignored.
| Event | Payload | Sent when | Listened to by |
|---|---|---|---|
speech:status | SpeechStatus (see Backend commands) | Listening starts, loads, stops or fails | useSpeech (src/state/speech.ts) |
speech:transcript | {session, utterance, text, final} | Text is recognised. Partial results repeat the utterance number with the whole text so far, until final is true. | useSpeech, which finds references in the text (src/lib/spokenRefs.ts) for the Heard list |
speech:level | {session, level, silent} | Regularly while listening. level is 0–1 (−60 to 0 dBFS). silent is true after 3 seconds of digital silence (or no audio at all): microphone access blocked, or the input muted. | useSpeech: the meter and the No sound warning |
speech:download | {id, received, total} | A few times a second during speech_model_download | useSpeech: the download progress |
Autopilot
Sent by autopilot.rs and autopilot_net.rs.
| Event | Payload | Sent when | Listened to by |
|---|---|---|---|
autopilot:status | AutopilotStatus (see Backend commands) | Anything in it changes: phase, connection, modes, pause, listening, track record, network mode | useAutopilot (src/state/autopilot.ts) |
autopilot:request | {kind: "open", requestId, passage, fromVerse, live} or {kind: "slide", requestId, itemId, index, live} | Autopilot asked to open a passage, return to a Word slide, or suggest a slide. Rust has already decided Live (live: true) or Preview. | src/state/autopilotBridge.ts, which lays it out and calls live_go with autopilot set to the requestId, or puts it in Preview and calls autopilot_request_done. Unanswered requests expire after 6 seconds. |
autopilot:transcript | {utterance, text, final} | Autopilot heard text. While Autopilot is on, Listen is off, and this feeds the Heard list instead. | useSpeech |
autopilot:following | {itemId, slide, line} | Autopilot's position in the live item changed. line is the line being sung, or null. | useAutopilot: the "Autopilot hears" line under the Live monitor, and the sung line |
autopilot:paired | the paired computer's name | Pairing with another computer succeeded | useAutopilot: a "Paired with …" toast |
autopilot:dev-demo | "demo", "demo2" or "demo3" | Development builds only, when ALTAR_AUTOPILOT_DEV asks for a demo | autopilotBridge.ts: puts the sample sermon Live, then a passage or "Amazing Grace" |
Sent by the control window
One event comes from the interface, not the backend. The control window emits it with Tauri's emit, and every window receives it.
| Event | Payload | Sent when | Listened to by |
|---|---|---|---|
live:sung | {itemId, index, slideId, line, color} or null | The line being sung changes, while the sung-line setting is on and Autopilot follows a song (src/state/sungLine.ts). Repeated every 3 seconds while a line is coloured, so an output opened mid-song catches up. | Every window (src/render/sungLine.ts): the audience screen and the Live monitor colour that line |
Frame
What an output window draws. Defined in coordinator.rs and mirrored in src/lib/types.ts.
| Field | Description |
|---|---|
revision | Scene revision |
take | Counts every Go Live and slide jump, so an output can tell a re-take of the slide already on screen (a lower third builds on again) |
mode | "content", "black" or "logo" |
clearText | Text hidden |
hideOverlays | Lower thirds hidden |
slide | The slide to draw. During a timed transition, this is the breaker slide. |
nextSlide | The next slide (for the confidence display). During a transition, the queued item's first slide. |
itemId, itemTitle, index, count | The live item and position |
overlays | Lower-third cues on air |
logo | The logo slide |
transition | The running timed transition, if any |
media | Media transport state, including nonce and restartNonce |
countdownEnd | Countdown end time (epoch ms) |
message | Stage message |
LiveState
The full coordinator state sent to the control window.
| Field | Description |
|---|---|
revision, take | Scene revision and take count, as in Frame |
preview, previewRevision | The Preview target and its own revision counter |
live | The live target |
mode, clearText, hideOverlays, overlays, logo, transition, media, countdownEnd, message | As in Frame |
audience, confidence | OutputInfo: {role, session, monitor, monitorName, ackRevision, ackAt} or null |
The coordinator also keeps fields that aren't sent: when the operator and Autopilot last acted, whether the last move was Autopilot's, and the Word context. See The live coordinator for how revisions and acknowledgements fit together, and for Autopilot's rules.