From 447fede0ff34893e3fc9bb26c267646362c937f4 Mon Sep 17 00:00:00 2001 From: cv <34649812+cpvalente@users.noreply.github.com> Date: Tue, 25 May 2021 22:35:38 +0200 Subject: [PATCH] style: clarify OSC triggers - show path for goto - show path for gotoid --- client/src/features/editors/list/EventBlock.jsx | 10 +++++++--- client/src/features/editors/list/EventList.jsx | 14 ++++++++++++-- client/src/features/editors/list/EventListItem.jsx | 2 ++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/client/src/features/editors/list/EventBlock.jsx b/client/src/features/editors/list/EventBlock.jsx index 62cf829b5..6cc78f21d 100644 --- a/client/src/features/editors/list/EventBlock.jsx +++ b/client/src/features/editors/list/EventBlock.jsx @@ -14,7 +14,8 @@ import { SelectCollapse, HandleCollapse } from 'app/context/collapseAtom'; import { useAtom } from 'jotai'; const ExpandedBlock = (props) => { - const { provided, data, next, delay, delayValue, actionHandler } = props; + const { provided, data, eventIndex, next, delay, delayValue, actionHandler } = + props; const oscid = data.id.length > 4 ? '...' : data.id; @@ -80,7 +81,9 @@ const ExpandedBlock = (props) => { actionHandler('update', { field: 'note', value: v }) } /> - {`OSC ID: ${oscid}`} + + {`/ontime/goto ${eventIndex} << OSC >> /ontime/gotoid ${oscid}`} + { }; export default function EventBlock(props) { - const { data, selected, delay, index, actionHandler } = props; + const { data, selected, delay, index, eventIndex, actionHandler } = props; // const [collapsed, setCollapsed] = useState(checkLocalStorage(data.id)); @@ -200,6 +203,7 @@ export default function EventBlock(props) { ) : ( {events.map((e, index) => { let isCursor = cursor === index; - if (index === 0) cumulativeDelay = 0; + if (index === 0) { + cumulativeDelay = 0; + eventIndex = -1; + } if (e.type === 'delay' && e.duration != null) { cumulativeDelay += e.duration; - } else if (e.type === 'block') cumulativeDelay = 0; + } else if (e.type === 'block') { + cumulativeDelay = 0; + } else if (e.type === 'event') { + eventIndex++; + } + return (
{ const { type, index, + eventIndex, data, selected, next, @@ -71,6 +72,7 @@ const EventListItem = (props) => { return (