-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve: video export and move it to its own controller
- Loading branch information
Showing
11 changed files
with
207 additions
and
206 deletions.
There are no files selected for viewing
180 changes: 0 additions & 180 deletions
180
s/context/controllers/timeline/tools/VideoExport/worker.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// function get_overlapping_effects(effect: Xeffect, effects: Xeffect[]): Overlapping[] { | ||
// let overlapping: Overlapping[] = [] | ||
// const excluded = effects.filter(c => c.id !== effect.id) | ||
|
||
// excluded.forEach((c) => { | ||
// const from = Math.max(effect.start_at_position, c.start_at_position) | ||
// const to = Math.min(effect.start_at_position + effect.duration, c.start_at_position + c.duration) | ||
// if(from <= to) | ||
// overlapping.push({effect, between: [from, to]}) | ||
// }) | ||
|
||
// return overlapping | ||
// } | ||
// | ||
// interface Overlapping { | ||
// effect: effectX | ||
// between: V2 | ||
// } |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
s/context/controllers/video-export/worker/utils/get_effects_at_timestamp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {AnyEffect} from "../../../timeline/types.js" | ||
import {sort_effects_by_track} from "./sort_effects_by_track.js" | ||
|
||
export function get_effects_at_timestamp(effects: AnyEffect[], timestamp: number) { | ||
const filtered_effects = effects.filter(effect => effect.start_at_position <= timestamp && effect.start_at_position + effect.duration >= timestamp) | ||
const sorted_by_track = sort_effects_by_track(filtered_effects) | ||
return sorted_by_track.length > 0 ? sorted_by_track : undefined | ||
} |
10 changes: 10 additions & 0 deletions
10
s/context/controllers/video-export/worker/utils/sort_effects_by_track.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {AnyEffect} from "../../../timeline/types.js" | ||
|
||
export function sort_effects_by_track(effects: AnyEffect[]) { | ||
// so that effects on first track draw on top of things that are on second track | ||
const sorted_effects = effects.sort((a, b) => { | ||
if(a.track < b.track) return 1 | ||
else return -1 | ||
}) | ||
return sorted_effects | ||
} |
Oops, something went wrong.