aboutsummaryrefslogtreecommitdiff
path: root/timeline.ts
diff options
context:
space:
mode:
Diffstat (limited to 'timeline.ts')
-rw-r--r--timeline.ts37
1 files changed, 26 insertions, 11 deletions
diff --git a/timeline.ts b/timeline.ts
index 5d0f51c..b39d55d 100644
--- a/timeline.ts
+++ b/timeline.ts
@@ -1,26 +1,41 @@
+import { v4 as uuid } from 'uuid';
+
export type slideTypes = 'default' | 'delay' | 'speedChange' | 'loop';
export type anySlide = slide | delaySlide | speedChangeSlide | loopSlide;
-export interface slide {
- frame: number;
- clickThroughBehaviour: 'ImmediatelySkip' | 'PlayOut';
- type: slideTypes;
+export class slide {
+ clickThroughBehaviour: 'ImmediatelySkip' | 'PlayOut' = 'ImmediatelySkip';
+ type: slideTypes = 'default';
id: string;
+
+ constructor(public frame: number) {
+ this.id = uuid();
+ }
}
-export interface delaySlide extends slide {
- delay: number;
+export class delaySlide extends slide {
+ type = 'delay' as slideTypes;
+ delay: number = 1;
}
-export interface speedChangeSlide extends slide {
- newFramerate: number;
+export class speedChangeSlide extends slide {
+ type = 'speedChange' as slideTypes;
+ newFramerate: number = 60;
}
-export interface loopSlide extends slide {
- beginFrame: number;
- playbackType: 'PingPong' | 'Normal';
+export class loopSlide extends slide {
+ type = 'loop' as slideTypes;
+ beginFrame: number = this.frame - 30;
+ playbackType: 'PingPong' | 'Normal' = 'Normal';
}
+export var toolToSlide = {
+ default: slide,
+ delay: delaySlide,
+ speedChange: speedChangeSlide,
+ loop: loopSlide,
+};
+
export interface presentationSettings {
controlType: 'FullScreen';
}