#!/usr/bin/zx --quiet import { formatDuration } from "./util.mjs"; import Producer from "./producer.mjs"; export default class Project { constructor(fps) { this.producers = []; this.clips = []; this.fps = fps; } addProducer(file) { this.producers.push(new Producer(file)); return this; } async toXML() { return ` ${( await Promise.all(this.producers.map((producer) => producer.toXML(this.fps))) ).join("\n")} 2 2 1 0 1633881496938 [ ] 21.08.1 g 1.02 1 ${this.producers .map((producer) => ``) .join("\n")} 2147483647 continue black 1 color rgb24a 0 1 1 1 1 1 1 1 `; } } const project = new Project(30); project.addProducer("/home/kuba/Videos/5min.mp4"); project.addProducer("/home/kuba/Videos/5min.wav"); await $`echo ${await project.toXML()} > project-generated.kdenlive`;