From ff0609458ab50dd627b13b604f7c8c42af9a67b3 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 24 Jul 2021 15:27:56 +0200 Subject: video source settings beginnings --- pages/editor.tsx | 97 ++++++++++++++++++++------------------------------------ 1 file changed, 35 insertions(+), 62 deletions(-) (limited to 'pages') diff --git a/pages/editor.tsx b/pages/editor.tsx index fac8899..5a63cb4 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -8,18 +8,17 @@ import { v4 as uuid } from 'uuid'; import FadeThroughTransition from '../components/fadethrough'; import { - BracketsRoundedIcon, FullScreenControlsRoundedIcon, MenuBarControlsRoundedIcon, PressureIcon, - SlashIconRounded, + SlashRoundedIcon, SlideKeyframe, } from '../components/icons'; import KeybindSelector from '../components/keybindselector'; import PlaySkipIconAni from '../components/play-skip'; import Selection from '../components/selection'; import TimecodeInput from '../components/timeinput'; -import Project, { LocalVideo } from '../project'; +import Project, { LocalVideo, VideoSources, VideoSourceType } from '../project'; import timeline, { anySlide, clickThroughBehaviours, @@ -34,11 +33,8 @@ import { TimedVideoPlayer } from './present'; import AppBar from '@material-ui/core/AppBar'; import Button from '@material-ui/core/Button'; -import Dialog from '@material-ui/core/Dialog'; -import MuiDialogTitle from '@material-ui/core/DialogTitle'; import Fab from '@material-ui/core/Fab'; import FormControl from '@material-ui/core/FormControl'; -import IconButton from '@material-ui/core/IconButton'; import InputLabel from '@material-ui/core/InputLabel'; import MenuItem from '@material-ui/core/MenuItem'; import Select from '@material-ui/core/Select'; @@ -54,18 +50,13 @@ import Icon from '@mdi/react'; import AddRoundedIcon from '@material-ui/icons/AddRounded'; import ArrowDropDownRoundedIcon from '@material-ui/icons/ArrowDropDownRounded'; -import CloseIcon from '@material-ui/icons/Close'; import FullscreenRoundedIcon from '@material-ui/icons/FullscreenRounded'; -import KeyboardArrowDownRoundedIcon from '@material-ui/icons/KeyboardArrowDownRounded'; import NavigateBeforeRoundedIcon from '@material-ui/icons/NavigateBeforeRounded'; import NavigateNextRoundedIcon from '@material-ui/icons/NavigateNextRounded'; -import SettingsRoundedIcon from '@material-ui/icons/SettingsRounded'; import SkipPreviousRoundedIcon from '@material-ui/icons/SkipPreviousRounded'; import { mdiCursorDefault } from '@mdi/js'; import DescriptionRoundedIcon from '@material-ui/icons/DescriptionRounded'; -import GetAppRoundedIcon from '@material-ui/icons/GetAppRounded'; -import VideoLabelRoundedIcon from '@material-ui/icons/VideoLabelRounded'; var keyframeInAnimations: { [key: string]: { x: number; y: number; }; } = {}; var slideAPIs: { [key: string]: any; }[] = []; @@ -92,9 +83,6 @@ interface globalState { right: slideTypes | null; }; }; - dialog: { - projectSettings: boolean; - }; settings: { node: ReactNode; name: string; @@ -130,9 +118,6 @@ var global = createState({ right: null, }, }, - dialog: { - projectSettings: false, - }, ready: { timeline: false, video: { @@ -981,50 +966,17 @@ function TimelineEditor() { ; } -function DialogBox(props: { - open?: boolean; - close: () => any; - children: ReactNode; - title: string; -}) { - return - - {props.title} - } /> - -
- {props.children} -
-
; -} - -function ProjectSettings() { - var proj = useHookstate(project).timeline; - var open = useHookstate(global).dialog.projectSettings; - - function close() { - global.update.refreshLiveTimeline.value(); - open.set(false); - } - - return -
- This is being worked on :tada: -
-
; -} - function DefaultSettings() { var [nextSlideKeybinds, setNextSlideKeybinds] = useState(['Space', 'n', 'Enter']); var [previousSlideKeybinds, setPreviousSlideKeybinds] = useState(['Backspace', 'p']); var [showMenuKeybinds, setShowMenuKeybinds] = useState(['Escape', 'm']); + var [videoSourceType, setVideoSourceType] = useState(VideoSources[0].type); + var proj = useHookstate(project).timeline; var ready = useHookstate(global).ready; - return <> -

Presentation settings

@@ -1094,6 +1046,34 @@ function DefaultSettings() { />
+
+ Source + + Video source + + + {(() => { + if (!projectFile.video) return null; + var SourceSettings = VideoSources.find(s => s.type == projectFile.video.type).settings; + return ; + })()} +
+
+ Remotes +
+ Allow anonymous remotes + +
+
Cool temporary buttons -
; @@ -1451,7 +1430,7 @@ function TitleBar() {

pressure

My presentations - + proj.name.set((nameRef.current as HTMLSpanElement).textContent.trim())} children={proj.name.get()} /> - { - global.dialog.projectSettings.set(true); - }} - />
; -- cgit v1.2.3