diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/apis/recording/recordingApi.ts | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/client/apis/recording/recordingApi.ts b/src/client/apis/recording/recordingApi.ts index bdeeb79ea..9ad7b5165 100644 --- a/src/client/apis/recording/recordingApi.ts +++ b/src/client/apis/recording/recordingApi.ts @@ -1,6 +1,6 @@ import { CollectionFreeFormView } from "../../views/collections/collectionFreeForm"; import React, { useState } from "react"; -import { observable } from "mobx"; +import { observable, observe } from "mobx"; type Movement = { time: number, @@ -28,7 +28,14 @@ export class RecordingApi { private absoluteStart: number; + // create static instance and getter for global use + @observable static _instance: RecordingApi; + public static get instance(): RecordingApi { return RecordingApi._instance } constructor() { + // init the global instance + RecordingApi._instance = this; + + // init the instance variables this.currentPresentation = RecordingApi.NULL_PRESENTATION this.isRecording = false; this.absoluteStart = -1; @@ -53,10 +60,8 @@ export class RecordingApi { // (2) assign meta content if it exists this.currentPresentation.meta = meta || {} - // (3) assign start date to currentPresenation this.currentPresentation.startDate = startDate - // (4) set isRecording true to allow trackMovements this.isRecording = true } @@ -146,4 +151,13 @@ export class RecordingApi { }) } + // observer that can be updated to track the relevant FreeFormView + // public setFreeFormView = (view: CollectionFreeFormView): void => { + // observe(view, 'Document', (change) => { + // if (change.name === '_panX') { + // this.trackMovements(view.Document._panX, view.Document._panY) + // } + // } + // } + }
\ No newline at end of file |