Skip to content

Commit 551f90f

Browse files
committed
fix(xml): added resolution to xml generator
1 parent 78e5d5a commit 551f90f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/XML/genXML.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ import path from "path";
22
import {Generator} from "../baseGenerator";
33
import {xmlBuilder} from "./helpersXML";
44

5+
// https://fcp.co/final-cut-pro/tutorials/1912-demystifying-final-cut-pro-xmls-by-philip-hodgetts-and-gregory-clarke
56
export class XML extends Generator {
67
generate(): string {
78
const builder = new xmlBuilder();
8-
builder.buildContext(path.parse(this.clipName).name, this.frameRate, this.cuts[this.cuts.length - 1].end, () => {
9+
const [width, height] = (() => {
10+
const split = this.resolution?.split('x');
11+
return split ? split.map(parseInt) : [null, null];
12+
})();
13+
builder.buildContext(path.parse(this.clipName).name, width, height, this.frameRate, this.cuts[this.cuts.length - 1].end, () => {
914
this.cuts.forEach((cut) => {
10-
builder.putClipitem(this.clipName, cut.start, cut.end, 720, 1270); // FIXME: needs resolution!!!!!!!
15+
builder.putClipitem(this.clipName, cut.start, cut.end);
1116
});
1217
});
1318
return builder.data;

0 commit comments

Comments
 (0)