// What knobs.spec.ts edits (video knobs, plans/video-knobs-ui.md): // // knobs-fixture the clip editor's three clips (clip-editor-fixture.mjs, // its own copy) with a claim on r002 and r003 (k1, r003 // stamps it), a "build" in out/ (the cached window, as // out/knobs-fixture.mp4) and the build's sync report // (out/sourced/sync.json: r002 -469 ms, the rest in sync) // -- the Count & stamp box, the Audio box, Make variants // (the encoder stubbed: variants.e2e.mjs) and the Sync table // knobs-deck-fixture the deck on (make-fixture.mjs deckManifest), two clips // -- the Markers editor // markers-cap-fixture the deck on, sixteen clips -- past twelve markers, // subsections // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; import path from "node:path"; import { makeClipEditorFixture } from "./clip-editor-fixture.mjs"; /** * @param {{ reports: string, manifest: Function, deckManifest: Function, cachedWindow: string, cues: Array<[number, number, string]> }} o */ export function makeKnobsFixture({ reports, manifest, deckManifest, cachedWindow, cues }) { const { dir } = makeClipEditorFixture({ reports, manifest, cachedWindow, cues, name: "knobs-fixture", title: "The Knobs Fixture" }); const file = path.join(dir, "video.manifest.json"); const m = JSON.parse(readFileSync(file, "utf8")); for (const e of m.timeline) if (e.id === "r002" || e.id === "r003") e.claim = { id: "k1", verdict: "CONTRADICTED" }; writeFileSync(file, JSON.stringify(m, null, 2) + "\n"); mkdirSync(path.join(dir, "out", "sourced"), { recursive: true }); copyFileSync(cachedWindow, path.join(dir, "out", "knobs-fixture.mp4")); writeFileSync( path.join(dir, "out", "sourced", "sync.json"), JSON.stringify({ fps: 15, items: [{ id: "r001", start: 0, lagMs: 0, peak: 0.92 }, { id: "r002", start: 2.1, lagMs: -469, peak: 0.81 }, { id: "r003", start: 4.2, lagMs: 12, peak: 0.88 }] }, null, 2) + "\n", ); const deckDir = path.join(reports, "knobs-deck-fixture"); mkdirSync(deckDir, { recursive: true }); writeFileSync( path.join(deckDir, "video.manifest.json"), JSON.stringify( deckManifest("knobs-deck-fixture", "The Knobs Deck Fixture", [ { type: "clip", id: "c01", video: "vid1", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "and because" }, { type: "clip", id: "c02", video: "vid1", start: 9.0, end: 12.0, cite: 9, section: 0, lock: true, quote: "another whole sentence" }, ]), null, 2, ) + "\n", ); // markers-cap-fixture: the deck on, sixteen clips -- the Markers editor past // the old twelve, a subsection row, and a leading one refused // (markers-cap.spec.ts). const capDir = path.join(reports, "markers-cap-fixture"); mkdirSync(capDir, { recursive: true }); writeFileSync( path.join(capDir, "video.manifest.json"), JSON.stringify( deckManifest( "markers-cap-fixture", "The Markers Cap Fixture", Array.from({ length: 16 }, (_, i) => ({ type: "clip", id: `m${String(i + 1).padStart(2, "0")}`, video: "vid1", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "and because", })), ), null, 2, ) + "\n", ); return { dir, deckDir, capDir }; }