// THE GAP MARK (module `gap-cue`, region `gap-cue`): "» 27 s" at the join a // clip's gap leaves. Wherever a deck is drawn it is THIS page -- one short page // per mark, laid at its own second over the frame (chrome-gap-cue.mjs; the // marks, their seconds and their place: the schedule's `gapCue` slice, // gap-cue-slice.mjs) -- so turning the mark on, moving it, restyling it or // changing its words re-renders chrome only, never a clip segment. Where no // chrome is laid over the picture (the plain cut, --no-chrome, a bare vertical // cut, --desktop, --short) the build draws it into the clip's segment instead // (gap-mark.mjs, gapMarkByChrome says which); never both on one frame. The // settings, the label and the timing: common lib/report/gapCue.mjs. import path from "node:path"; import { GAP_CUE_BORDER_FALLBACK, GAP_CUE_CORNERS, GAP_CUE_DEFAULTS, GAP_CUE_LABEL_MAX, GAP_CUE_MIN, GAP_CUE_PLACES, GAP_REASON_MAX, validateGapCue, } from "yt-dlp-transcript-common/lib/report/gapCue.mjs"; import { snapWindow } from "../deck.mjs"; import { GAP_CUE_ID_RE, gapCueHtml, gapCueWindows } from "../chrome-gap-cue.mjs"; import { assertRegion, defineModule } from "./contract.mjs"; export default defineModule({ id: "gap-cue", version: 2, // Over the popup posts (30), under the stamps (40). z: 35, kind: "overlay-window", slot: "footage", // Its form in the stacked vertical deck (vertical-deck.mjs): over the picture. vertical: { slot: "picture" }, title: "Gap mark", summary: "A small mark at each join a clip's gap leaves, saying how much was skipped: a page per mark, at its own seconds.", configKey: "render.gapCue", defaults: { ...GAP_CUE_DEFAULTS }, validate: (_value, { manifest }) => validateGapCue(manifest), ui: [ { key: "mark", type: "boolean", label: "Mark the gaps' joins", default: GAP_CUE_DEFAULTS.mark }, { key: "min", type: "number", min: GAP_CUE_MIN.min, max: GAP_CUE_MIN.max, step: 0.5, label: "Shortest gap marked (s)", default: GAP_CUE_DEFAULTS.min }, { key: "place", type: "enum", options: [...GAP_CUE_PLACES], label: "Where (over the footage, or in the deck)", default: GAP_CUE_DEFAULTS.place }, { key: "corner", type: "enum", options: [...GAP_CUE_CORNERS], label: "Corner (over the footage)", default: GAP_CUE_DEFAULTS.corner }, { key: "label", type: "text", label: "Label ({s} the time skipped, {why} the reason, [ ] only with one)", default: GAP_CUE_DEFAULTS.label }, { key: "border", type: "text", label: "Border (accent: the deck's accent colour, or #rrggbb)", default: GAP_CUE_DEFAULTS.border }, ], docs: { heading: "Gap mark", intro: "The full reference is [Gaps inside a clip](#gaps-inside-a-clip) (the mark at the join). Under a deck the mark is this module's page, one per mark; with no chrome over the picture it is drawn into the clip's segment.", rows: [ ["`render.gapCue.mark`", "`true` · `false` · default `false` (off: every cut renders as it did)", "`umtool look
gapCue='{\"mark\":true}'` · a take: `--set render.gapCue.mark=true`"], ["`render.gapCue.min`", `${GAP_CUE_MIN.min}–${GAP_CUE_MIN.max} s · default ${GAP_CUE_DEFAULTS.min} (a shorter gap draws nothing)`, "`umtool look
gapCue='{\"min\":4}'`"], ["`render.gapCue.place`", "`footage` (over the footage, at its corner) · `deck` (in the deck's band, at the end of the source line, left of the QR -- over the footage where the row has no room, in the stacked vertical deck and in a cut with no deck; the page measures the line in its own faces and never stands the mark on it) · default `footage`", "`umtool look
gapCue='{\"place\":\"deck\"}'`"], ["`render.gapCue.corner`", "`auto` (the layout's free corner) · `tl` · `tr` · `bl` · `br` · default `auto`", "`umtool look
gapCue='{\"corner\":\"br\"}'`"], ["`render.gapCue.label`", `text holding \`{s}\` (the time skipped: \`27 s\`, from a minute \`1:12\`) and maybe \`{why}\` (the gap's reason); a part in \`[ ]\` is drawn only when the gap has one; at most ${GAP_CUE_LABEL_MAX} characters · default \`${GAP_CUE_DEFAULTS.label}\` (\`» 27 s\`, \`» 26 s · dead air\`)`, "`umtool look
gapCue='{\"label\":\"{s} later\"}'`"], ["`render.gapCue.border`", `\`accent\` (the deck's accent colour, \`render.palette.accent\`: its rule and dots; a render with none ${GAP_CUE_BORDER_FALLBACK}) · a \`#rrggbb\` colour · default \`accent\` (the border at full opacity, the box near-black at 90 %, the text white)`, "`umtool look
gapCue='{\"border\":\"#3aa0ff\"}'`"], ["a clip's `gapCue`", "the same keys, over the project's", "`umtool set