diff options
| author | monoguitari <113245090+monoguitari@users.noreply.github.com> | 2023-08-22 17:30:17 -0400 |
|---|---|---|
| committer | monoguitari <113245090+monoguitari@users.noreply.github.com> | 2023-08-22 17:30:17 -0400 |
| commit | f710353318543a43349944f9c0a96ce3f3388270 (patch) | |
| tree | 409417e70c93994c67cba414dea04e4592496ed4 /src/client/views/nodes/RecordingBox | |
| parent | 072cf7eca410e860e0b4e1e22495756fc3884515 (diff) | |
topbar Audio progress
Logically works, need to consider how to add to doc
Diffstat (limited to 'src/client/views/nodes/RecordingBox')
| -rw-r--r-- | src/client/views/nodes/RecordingBox/RecordingBox.tsx | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/client/views/nodes/RecordingBox/RecordingBox.tsx b/src/client/views/nodes/RecordingBox/RecordingBox.tsx index 5502a1e08..d6e4bd304 100644 --- a/src/client/views/nodes/RecordingBox/RecordingBox.tsx +++ b/src/client/views/nodes/RecordingBox/RecordingBox.tsx @@ -11,7 +11,7 @@ import { DocumentType } from '../../../documents/DocumentTypes'; import { Presentation } from '../../../util/TrackMovements'; import { Doc, DocListCast } from '../../../../fields/Doc'; import { Id } from '../../../../fields/FieldSymbols'; -import { BoolCast, DocCast } from '../../../../fields/Types'; +import { BoolCast, Cast, DocCast } from '../../../../fields/Types'; import { ScriptingGlobals } from '../../../util/ScriptingGlobals'; import { DocumentManager } from '../../../util/DocumentManager'; import { Docs } from '../../../documents/Documents'; @@ -22,6 +22,8 @@ import { SettingsManager } from '../../../util/SettingsManager'; import { PropertiesView } from '../../PropertiesView'; import { PropertiesSection } from '../../PropertiesSection'; import { PropertiesDocContextSelector } from '../../PropertiesDocContextSelector'; +import { listSpec } from '../../../../fields/Schema'; +import { DragManager } from '../../../util/DragManager'; @observer export class RecordingBox extends ViewBoxBaseComponent<FieldViewProps>() { @@ -146,17 +148,26 @@ ScriptingGlobals.add(function toggleRecPlayback(value: Doc) { console.log(value) value.overlayX = 100; value.overlayY = 100; + if (!Doc.UserDoc().isAddRecToDocMode) { Doc.AddToMyOverlay(value); - DocumentManager.Instance.AddViewRenderedCb(value, docView => { - docval = - Doc.UserDoc().currentRecording = docView.ComponentView as VideoBox; - // docval.Play(); - }) + DocumentManager.Instance.AddViewRenderedCb(value, docView => { + docval = + Doc.UserDoc().currentRecording = docView.ComponentView as VideoBox; + // docval.Play(); + })} else { + let recordingIndex = Array.from(Doc.UserDoc().workspaceRecordings).indexOf(value); + DragManager.StartDropdownDrag([document.createElement('div')],new DragManager.DocumentDragData([value]), 1, 1, recordingIndex); + + } + // let ffView = Array.from(DocumentManager.Instance.DocumentViews).find(view => view.ComponentView instanceof CollectionFreeFormView); // (ffView?.ComponentView as CollectionFreeFormView).props.addDocument?.(value); }); -ScriptingGlobals.add(function addRectoWorkspace() { +ScriptingGlobals.add(function addRectoWorkspace(value: VideoBox) { console.log("adding rec to doc"); + console.log(value.rootDoc); + Doc.UserDoc().isAddRecToDocMode = true; + }) ScriptingGlobals.add(function playWorkspaceRec(value: VideoBox) { |
