Skip to main content

Module sfx_routes

Module sfx_routes 

Source
Expand description

The timeline editor’s JSON routes, with the contracts of _register_sfx_routes in xil_gui.py, plus two routes of our own for the Timeline’s dialogue-edit modal:

  • GET /xil/get-sfx?slug=&tag=&key= → {effect, defaults, natural_s}
  • POST /xil/update-sfx → sets or clears one cue’s four sound fields
  • POST /xil/update-sfx-defaults → sets or clears one layer’s defaults
  • GET /xil/get-parsed-entry?slug=&tag=&seq= → {speaker, text, speakers}
  • POST /xil/update-parsed-entry → {slug, tag, seq, speaker, text}

Every save rewrites sfx_{tag}.json and appends to its _edits.jsonl journal; a journal failure never fails the save. The two parsed-entry routes are a thin JSON front end over crate::entries, which the dashboard’s Dialogue sub-tab also calls — one shared save, two callers.

Constants§

CUE_FIELDS 🔒
DEFAULT_FIELDS 🔒

Functions§

body_repr 🔒
Python’s repr() of a JSON request body, for the debug log.
body_str 🔒
get_parsed_entry
GET /xil/get-parsed-entry?slug=&tag=&seq=: the Timeline modal’s one fetch to open — the entry’s current fields plus the speaker dropdown options, so no second round trip is needed.
get_sfx
GET /xil/get-sfx.
read_config 🔒
reply 🔒
sfx_config_path 🔒
The episode’s sfx config, or the error response to send instead.
source_duration_s 🔒
_source_duration_s(source): a cue’s source file length, or None for a generated cue or an unreadable file. Relative sources are workspace paths.
speakers_json 🔒
update_parsed_entry
POST /xil/update-parsed-entry: {slug, tag, seq, speaker, text} → the same validate/save/journal path entries::save_entry runs for the dashboard’s Dialogue sub-tab.
update_sfx
POST /xil/update-sfx.
update_sfx_defaults
POST /xil/update-sfx-defaults: the {layer}_{field} defaults.
write_config 🔒