Skip to content

Commit cdd3aa7

Browse files
committed
feat(all): added option to keep silent parts
1 parent 1a060cf commit cdd3aa7

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/baseGenerator.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
import {Project, Layer, Cuts} from "./project";
1+
import {Project, Layer, Cuts, Options} from "./project";
22
export abstract class Generator {
33

44
private project: Project;
55
protected layer: Layer;
66
protected cuts: Cuts;
77
protected frameRate: number;
88
protected clipName: string;
9+
protected options: Options;
910

10-
constructor(project: Project) {
11+
12+
constructor(project: Project, options: Options) {
1113
this.project = project;
14+
this.options = options;
1215
this.layer = this.ensureSingleLayer(this.project);
13-
this.cuts = this.fillInGaps(this.ensureCuts(this.layer));
16+
if (this.options.keepSilent) {
17+
this.cuts = this.fillInGaps(this.ensureCuts(this.layer));
18+
} else {
19+
this.cuts = this.ensureCuts(this.layer);
20+
}
1421
this.frameRate = this.project.frameRate;
1522
this.clipName = this.layer.sourceFile;
1623
}

src/project.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ export interface Speed {
2525
silent?: null;
2626
sounded: number;
2727
}
28+
29+
30+
export interface Options{
31+
keepSilent: boolean,
32+
}

0 commit comments

Comments
 (0)