Skip to content

Commit e23f935

Browse files
authored
Merge pull request #3 from JumpCutter/dk949/kep-silent-opt
Added an option to keep or remove silent parts of thevideo
2 parents bdcc6a8 + c51e04d commit e23f935

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## [0.0.4](https://github.com/JumpCutter/JC-ProjectExportAPI/compare/v0.0.3...v0.0.4) (2021-10-18)
4+
### Changes
5+
- __BREAKING__: Constructor of Generator now takes second parameter - an `Options` object
6+
- __added__: Options object
7+
- __added__: Option to keep or remove silent parts in export (has to be specified)
8+
39
## [0.0.3](https://github.com/JumpCutter/JC-ProjectExportAPI/compare/v0.0.2...v0.0.3) (2021-10-18)
410
### Changes
511
- __release__: Third time's the charm

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)