summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/commands/timeline/tracks-snapshot.ts
blob: d397431cd05bcab60f627f62fccf81bb5f8acad0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Command } from "@/lib/commands/base-command";
import type { TimelineTrack } from "@/lib/timeline";
import { EditorCore } from "@/core";

export class TracksSnapshotCommand extends Command {
	constructor(
		private before: TimelineTrack[],
		private after: TimelineTrack[],
	) {
		super();
	}

	execute(): void {
		EditorCore.getInstance().timeline.updateTracks(this.after);
	}

	undo(): void {
		EditorCore.getInstance().timeline.updateTracks(this.before);
	}
}