@@ -3,52 +3,114 @@ import fs from "fs";
33import path from "path" ;
44
55
6- let generators = { } ;
7-
86
97const project = JSON . parse ( fs . readFileSync ( path . join ( "JC-examples" , "./yoga.json" ) ) . toString ( ) ) ;
108
119project [ "layers" ] [ 0 ] [ 0 ] [ "sourceFile" ] = "../JC-examples/yoga.mp4"
1210
13- describe ( "generating vegasEDL for importing into Sony Vegas Pro" , ( ) => {
14- it ( "should create a generator object that takes project as an argument" , ( ) => {
15- let tmp = project ;
16- generators [ "VegasEDL" ] = ( new PEAPI . VegasEDL ( tmp ) ) ;
11+ describe ( "generating vegasEDL for importing into Vegas Pro" , ( ) => {
12+ {
13+ let gen : PEAPI . VegasEDL ;
14+ it ( "should create a generator object. Specifies project and that all parts of the clip need to be exported" , ( ) => {
15+ gen = new PEAPI . VegasEDL ( project , { keepSilent : true } ) ;
16+ } ) ;
17+ it ( "generate a string representing a project in the EDL format Vegas supports" , ( ) => {
18+ fs . writeFileSync ( path . join ( __dirname , "./keep_silent_test.txt" ) , gen . generate ( ) ) ;
19+ } ) ;
20+ it ( "should match the ground truth file" , ( ) => {
21+ let groundTruth = fs . readFileSync ( path . join ( __dirname , "./keep_silent_test.txt.gt" ) ) ;
22+ let test = fs . readFileSync ( path . join ( __dirname , "./keep_silent_test.txt" ) ) ;
23+ if ( ! groundTruth . equals ( test ) ) {
24+ throw new Error ( ) ;
25+ }
26+ } ) ;
27+ }
28+
29+ {
30+ let gen : PEAPI . VegasEDL ;
31+ it ( "should create a generator object. Specifies project and that only loud parts should be exported" , ( ) => {
32+ gen = new PEAPI . VegasEDL ( project , { keepSilent : false } ) ;
1733 } ) ;
18- it ( "generate a string representing a project in the EDL format Sony vegas supports" , ( ) => {
19- fs . writeFileSync ( path . join ( __dirname , "./test .txt" ) , generators [ "VegasEDL" ] . generate ( ) ) ;
34+ it ( "generate a string representing a project in the EDL format Vegas supports" , ( ) => {
35+ fs . writeFileSync ( path . join ( __dirname , "./remove_silent_test .txt" ) , gen . generate ( ) ) ;
2036 } ) ;
37+ }
38+
2139} ) ;
2240
2341describe ( "generating EDL for importing into DaVinci Resolve" , ( ) => {
24- it ( "should create a generator object that takes project as an argument" , ( ) => {
25- let tmp = project ;
26- generators [ "ResolveEDL" ] = ( new PEAPI . ResolveEDL ( tmp ) ) ;
27- } ) ;
28- it ( "generate a string representing a project in the EDL format" , ( ) => {
29- fs . writeFileSync ( path . join ( __dirname , "./test.edl" ) , generators [ "ResolveEDL" ] . generate ( ) ) ;
30- } ) ;
42+ {
43+ let gen : PEAPI . ResolveEDL ;
44+ it ( "should create a generator object. Specifies project and that all parts of the clip need to be exported" , ( ) => {
45+ gen = new PEAPI . ResolveEDL ( project , { keepSilent : true } ) ;
46+ } ) ;
47+ it ( "generate a string representing a project in the EDL format DaVinci Resoleve supports" , ( ) => {
48+ fs . writeFileSync ( path . join ( __dirname , "./keep_silent_test.edl" ) , gen . generate ( ) ) ;
49+ } ) ;
50+
51+ it ( "should match the ground truth file" , ( ) => {
52+ let groundTruth = fs . readFileSync ( path . join ( __dirname , "./keep_silent_test.edl.gt" ) ) ;
53+ let test = fs . readFileSync ( path . join ( __dirname , "./keep_silent_test.edl" ) ) ;
54+ if ( ! groundTruth . equals ( test ) ) {
55+ throw new Error ( ) ;
56+ }
57+ } ) ;
58+ }
59+
60+ {
61+ let gen : PEAPI . ResolveEDL ;
62+ it ( "should create a generator object. Specifies project and that only loud parts should be exported" , ( ) => {
63+ gen = new PEAPI . ResolveEDL ( project , { keepSilent : false } ) ;
64+ } ) ;
65+ it ( "generate a string representing a project in the EDL format DaVinci Resolve supports" , ( ) => {
66+ fs . writeFileSync ( path . join ( __dirname , "./remove_silent_test.edl" ) , gen . generate ( ) ) ;
67+ } ) ;
68+ }
3169} ) ;
3270
3371
3472describe ( "generating FCPXML for importing into FinalCut Pro" , ( ) => {
35- it ( "should create a generator object that takes project as an argument" , ( ) => {
36- let tmp = project ;
37- generators [ "FCPXML" ] = ( new PEAPI . FCPXML ( tmp ) ) ;
38- } ) ;
39- it ( "generate a string representing a project in the FCPXML format" , ( ) => {
40- fs . writeFileSync ( path . join ( __dirname , "./test.fcpxml" ) , generators [ "FCPXML" ] . generate ( ) ) ;
41- } ) ;
73+ {
74+ let gen : PEAPI . FCPXML ;
75+ it ( "should create a generator object. Specifies project and that all parts of the clip need to be exported" , ( ) => {
76+ gen = new PEAPI . FCPXML ( project , { keepSilent : true } ) ;
77+ } ) ;
78+ it ( "generate a string representing a project in the FCPXML format" , ( ) => {
79+ fs . writeFileSync ( path . join ( __dirname , "./keep_silent_test.fcpxml" ) , gen . generate ( ) ) ;
80+ } ) ;
81+ }
82+
83+ {
84+ let gen : PEAPI . FCPXML ;
85+ it ( "should create a generator object. Specifies project and that only loud parts should be exported" , ( ) => {
86+ gen = new PEAPI . FCPXML ( project , { keepSilent : false } ) ;
87+ } ) ;
88+ it ( "generate a string representing a project in the FCPXML format" , ( ) => {
89+ fs . writeFileSync ( path . join ( __dirname , "./remove_silent_test.fcpxml" ) , gen . generate ( ) ) ;
90+ } ) ;
91+ }
4292} ) ;
4393
4494
4595
4696describe ( "generating XML for importing into Premiere Pro" , ( ) => {
47- it ( "should create a generator object that takes project as an argument" , ( ) => {
48- let tmp = project ;
49- generators [ "XML" ] = ( new PEAPI . XML ( tmp ) ) ;
50- } ) ;
51- it ( "generate a string representing a project in the EDL format Sony vegas supports" , ( ) => {
52- fs . writeFileSync ( path . join ( __dirname , "./test.xml" ) , generators [ "XML" ] . generate ( ) ) ;
53- } ) ;
97+ {
98+ let gen : PEAPI . XML ;
99+ it ( "should create a generator object. Specifies project and that all parts of the clip need to be exported" , ( ) => {
100+ gen = new PEAPI . XML ( project , { keepSilent : true } ) ;
101+ } ) ;
102+ it ( "generate a string representing a project in the XML format" , ( ) => {
103+ fs . writeFileSync ( path . join ( __dirname , "./keep_silent_test.xml" ) , gen . generate ( ) ) ;
104+ } ) ;
105+ }
106+
107+ {
108+ let gen : PEAPI . XML ;
109+ it ( "should create a generator object. Specifies project and that only loud parts should be exported" , ( ) => {
110+ gen = new PEAPI . XML ( project , { keepSilent : false } ) ;
111+ } ) ;
112+ it ( "generate a string representing a project in the XML format" , ( ) => {
113+ fs . writeFileSync ( path . join ( __dirname , "./remove_silent_test.xml" ) , gen . generate ( ) ) ;
114+ } ) ;
115+ }
54116} ) ;
0 commit comments