Skip to content

Commit 14194fa

Browse files
committedMar 14, 2025·
wip: timers are as in rundown
1 parent 1218b52 commit 14194fa

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed
 

‎packages/webui/src/client/lib/Components/CounterComponents.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Moment from 'react-moment'
12
import { RundownUtils } from '../rundown'
23

34
interface OverUnderProps {
@@ -17,23 +18,23 @@ export const OverUnderClockComponent = (props: OverUnderProps): JSX.Element => {
1718
export const PlannedEndComponent = (props: OverUnderProps): JSX.Element => {
1819
return (
1920
<span className="counter-component__planned-end">
20-
{RundownUtils.formatTimeToTimecode({ frameRate: 25 }, props.value, false, false, true)}
21+
<Moment interval={0} format="HH:mm:ss" date={props.value} />
2122
</span>
2223
)
2324
}
2425

2526
export const TimeToPlannedEndComponent = (props: OverUnderProps): JSX.Element => {
2627
return (
2728
<span className="counter-component__time-to-planned-end">
28-
{RundownUtils.formatTimeToTimecode({ frameRate: 25 }, props.value, true)}
29+
{RundownUtils.formatDiffToTimecode(props.value, true, true, true)}
2930
</span>
3031
)
3132
}
3233

33-
export const TimesSincePlannedEndComponent = (props: OverUnderProps): JSX.Element => {
34+
export const TimeSincePlannedEndComponent = (props: OverUnderProps): JSX.Element => {
3435
return (
3536
<span className="counter-component__time-since-planned-end">
36-
{RundownUtils.formatTimeToTimecode({ frameRate: 25 }, props.value, true, false, true)}
37+
{RundownUtils.formatDiffToTimecode(props.value, true, true, true)}
3738
</span>
3839
)
3940
}

‎packages/webui/src/client/styles/counterComponents.scss

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
letter-spacing: 0%;
5656
text-align: right;
5757

58-
color: #000000;
5958
font-stretch: 57;
6059
font-variation-settings: 'GRAD' 0, 'XOPQ' 96, 'XTRA' 468, 'YOPQ' 79, 'YTAS' 750, 'YTDE' -203, 'YTFI' 738, 'YTLC' 548,
6160
'YTUC' 712, 'slnt' 0, 'opsz' 44;

‎packages/webui/src/client/ui/ClockView/DirectorScreen.tsx

+16-12
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { CurrentPartOrSegmentRemaining } from '../RundownView/RundownTiming/Curr
3939
import {
4040
OverUnderClockComponent,
4141
PlannedEndComponent,
42-
TimesSincePlannedEndComponent,
42+
TimeSincePlannedEndComponent,
4343
TimeToPlannedEndComponent,
4444
} from '../../lib/Components/CounterComponents'
4545
import { AdjustLabelFit } from '../util/AdjustLabelFit'
@@ -351,33 +351,37 @@ function DirectorScreenRender({
351351
// const currentPartOrSegmentCountdown =
352352
// timingDurations.remainingBudgetOnCurrentSegment ?? timingDurations.remainingTimeOnCurrentPart ?? 0
353353

354-
const expectedStart = PlaylistTiming.getExpectedStart(playlist.timing)
355-
const expectedEnd = PlaylistTiming.getExpectedEnd(playlist.timing) || 0
354+
const expectedStart = PlaylistTiming.getExpectedStart(playlist.timing) || 0
355+
const expectedEnd = PlaylistTiming.getExpectedEnd(playlist.timing)
356+
const expectedDuration = PlaylistTiming.getExpectedDuration(playlist.timing) || 0
357+
const now = timingDurations.currentTime ?? getCurrentTime()
356358

357359
const overUnderClock = getPlaylistTimingDiff(playlist, timingDurations) ?? 0
358360

359361
return (
360362
<div className="director-screen">
361363
<div className="director-screen__top">
362-
<div className="director-screen__top__planned-end">
363-
<div>
364-
<PlannedEndComponent value={expectedEnd} />
364+
{expectedEnd ? (
365+
<div className="director-screen__top__planned-end">
366+
<div>
367+
<PlannedEndComponent value={expectedEnd} />
368+
</div>
369+
PLANNED END
365370
</div>
366-
PLANNED END
367-
</div>
368-
{expectedEnd - overUnderClock < 0 ? (
371+
) : null}
372+
{expectedEnd ? (
369373
<div>
370374
<div>
371-
<TimeToPlannedEndComponent value={expectedEnd - overUnderClock} />
375+
<TimeToPlannedEndComponent value={now - expectedEnd} />
372376
</div>
373377
<span className="director-screen__top__planned-to">TIME TO PLANNED END</span>
374378
</div>
375379
) : (
376380
<div>
377381
<div>
378-
<TimesSincePlannedEndComponent value={expectedEnd - overUnderClock} />
382+
<TimeSincePlannedEndComponent value={getCurrentTime() - (expectedStart + expectedDuration)} />
383+
<span className="director-screen__top__planned-since">TIME SINCE PLANNED END</span>
379384
</div>
380-
<span className="director-screen__top__planned-since">TIME SINCE PLANNED END</span>
381385
</div>
382386
)}
383387
<div>

0 commit comments

Comments
 (0)
Please sign in to comment.