diff options
| author | bobzel <zzzman@gmail.com> | 2022-03-22 11:32:47 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-03-22 11:32:47 -0400 |
| commit | 810f86195188503b04d64f9d58ea4dfc3a639398 (patch) | |
| tree | 2e0f252147dd65f36069426df4fe5369423427dc /src/client/views/collections/CollectionStackedTimeline.tsx | |
| parent | 0885f2b6ea10bdc54f587040ea8e6dc90ef5b0f3 (diff) | |
fixed temporal media merge that had reverted a lot of things.
Diffstat (limited to 'src/client/views/collections/CollectionStackedTimeline.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionStackedTimeline.tsx | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx index bd7d0083b..e0b947211 100644 --- a/src/client/views/collections/CollectionStackedTimeline.tsx +++ b/src/client/views/collections/CollectionStackedTimeline.tsx @@ -11,7 +11,7 @@ import { computedFn } from "mobx-utils"; import { Doc, DocListCast } from "../../../fields/Doc"; import { Id } from "../../../fields/FieldSymbols"; import { List } from "../../../fields/List"; -import { listSpec, makeInterface } from "../../../fields/Schema"; +import { listSpec } from "../../../fields/Schema"; import { ComputedField, ScriptField } from "../../../fields/ScriptField"; import { Cast, NumCast } from "../../../fields/Types"; import { @@ -25,7 +25,7 @@ import { Docs } from "../../documents/Documents"; import { DocumentManager } from "../../util/DocumentManager"; import { DragManager } from "../../util/DragManager"; import { LinkManager } from "../../util/LinkManager"; -import { Scripting } from "../../util/Scripting"; +import { ScriptingGlobals } from "../../util/ScriptingGlobals"; import { SelectionManager } from "../../util/SelectionManager"; import { SnappingManager } from "../../util/SnappingManager"; import { Transform } from "../../util/Transform"; @@ -43,21 +43,6 @@ import { import { LabelBox } from "../nodes/LabelBox"; import "./CollectionStackedTimeline.scss"; - - -/** - * CollectionStackedTimeline - * Main component: CollectionStackedTimeline.tsx - * Supporting Components: AudioWaveform - * - * CollectionStackedTimeline is a collection view used for audio and video nodes to display a timeline of the temporal media documents with an audio waveform and markers for links and annotations - * The actual media is handled in the containing classes (AudioBox, VideoBox) but the timeline deals with rendering and updating timecodes, links, and trimming. - * When trimming there are two pairs of times that are tracked: trimStart and trimEnd are the bounds of the trim controls, clipStart and clipEnd are the actual trimmed playback bounds of the clip - */ - - -type PanZoomDocument = makeInterface<[]>; -const PanZoomDocument = makeInterface(); export type CollectionStackedTimelineProps = { Play: () => void; Pause: () => void; @@ -82,12 +67,9 @@ export enum TrimScope { @observer -export class CollectionStackedTimeline extends CollectionSubView< - PanZoomDocument, - CollectionStackedTimelineProps ->(PanZoomDocument) { - @observable static SelectingRegion: CollectionStackedTimeline | undefined; // timeline selection region - @observable public static CurrentlyPlaying: Doc[]; // tracks all currently playing audio and video docs +export class CollectionStackedTimeline extends CollectionSubView<CollectionStackedTimelineProps>() { + @observable static SelectingRegion: CollectionStackedTimeline | undefined = undefined; + @observable public static CurrentlyPlaying: Doc[]; static RangeScript: ScriptField; static LabelScript: ScriptField; @@ -983,7 +965,9 @@ class StackedTimelineAnchor extends React.Component<StackedTimelineAnchorProps> <div key="right" className="collectionStackedTimeline-resizer" - onPointerDown={(e) => this.onAnchorDown(e, this.props.mark, false)} + onPointerDown={(e) => + this.onAnchorDown(e, this.props.mark, false) + } /> </> )} @@ -991,12 +975,12 @@ class StackedTimelineAnchor extends React.Component<StackedTimelineAnchorProps> ); } } -Scripting.addGlobal(function formatToTime(time: number): any { +ScriptingGlobals.add(function formatToTime(time: number): any { return formatTime(time); }); -Scripting.addGlobal(function min(num1: number, num2: number): number { +ScriptingGlobals.add(function min(num1: number, num2: number): number { return Math.min(num1, num2); }); -Scripting.addGlobal(function max(num1: number, num2: number): number { +ScriptingGlobals.add(function max(num1: number, num2: number): number { return Math.max(num1, num2); });
\ No newline at end of file |
