mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 02:43:50 +00:00
rename
This commit is contained in:
@@ -717,7 +717,9 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert
|
||||
const hasImmediateChanges = hasNewLoaded || justStarted || hasChangedPlayback || offsetModeChanged;
|
||||
|
||||
// we would like the wall clock to tick on a regular rate
|
||||
const beutyClockUpdate = getShouldClockUpdate(RuntimeService.previousClockUpdate, state.clock);
|
||||
const normalClockUpdate =
|
||||
getShouldClockUpdate(RuntimeService.previousClockUpdate, state.clock) ||
|
||||
getForceUpdate(RuntimeService.previousClockUpdate, state.clock);
|
||||
|
||||
/**
|
||||
* Timer should be updated if
|
||||
@@ -743,7 +745,7 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert
|
||||
* Then check if there is actually a change in the data
|
||||
*/
|
||||
const shouldRuntimeUpdate =
|
||||
(beutyClockUpdate ||
|
||||
(normalClockUpdate ||
|
||||
hasImmediateChanges ||
|
||||
shouldUpdateTimer ||
|
||||
getForceUpdate(RuntimeService.previousRuntimeUpdate, state.clock)) &&
|
||||
@@ -759,7 +761,7 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert
|
||||
* so if any of them are updated we also need to send the clock
|
||||
* in case nothing else is updating the clock will be updated at the notification rate
|
||||
*/
|
||||
const shouldUpdateClock = shouldRuntimeUpdate || shouldBlockUpdate || beutyClockUpdate;
|
||||
const shouldUpdateClock = shouldRuntimeUpdate || shouldBlockUpdate || normalClockUpdate;
|
||||
|
||||
//Now we set all the updates on the eventstore and update the previous value
|
||||
if (hasChangedPlayback) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import { timerConfig } from '../../setup/config.js';
|
||||
|
||||
/**
|
||||
* Checks whether we should update the clock value
|
||||
* - clock has slid
|
||||
* - we have rolled into a new seconds unit
|
||||
* this is different from the timer update as it looks at the clock as counting up
|
||||
*/
|
||||
export function getShouldClockUpdate(previousUpdate: number, now: number): boolean {
|
||||
const newSeconds = millisToSeconds(now, TimerType.CountUp) !== millisToSeconds(previousUpdate, TimerType.CountUp);
|
||||
@@ -18,10 +18,6 @@ export function getShouldClockUpdate(previousUpdate: number, now: number): boole
|
||||
* - we have rolled into a new seconds unit
|
||||
*/
|
||||
export function getShouldTimerUpdate(previousValue: MaybeNumber, currentValue: MaybeNumber): boolean {
|
||||
if (currentValue === null) {
|
||||
return false;
|
||||
}
|
||||
// we avoid trigger ahead since it can cause duplicate triggers
|
||||
const shouldUpdateTimer = millisToSeconds(currentValue) !== millisToSeconds(previousValue);
|
||||
return shouldUpdateTimer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user