mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
Keep offset when taking over playback with roll v2 (#1184)
* pass on offset * account for offset in roll * prevent roll from overtime * add test
This commit is contained in:
committed by
GitHub
parent
1b1823e0fe
commit
ee1b5b7fdd
@@ -1,13 +1,13 @@
|
||||
import { Playback } from 'ontime-types';
|
||||
import { Playback, TimerPhase } from 'ontime-types';
|
||||
|
||||
/**
|
||||
* Simple rules to determine whether a playback action is valid
|
||||
*/
|
||||
export function validatePlayback(currentPlayback: Playback) {
|
||||
export function validatePlayback(currentPlayback: Playback, timerPhase: TimerPhase) {
|
||||
return {
|
||||
start: currentPlayback !== Playback.Stop,
|
||||
pause: currentPlayback === Playback.Play,
|
||||
roll: currentPlayback !== Playback.Roll,
|
||||
roll: currentPlayback !== Playback.Roll && timerPhase !== TimerPhase.Overtime,
|
||||
stop: currentPlayback !== Playback.Stop,
|
||||
reload: currentPlayback !== Playback.Stop && currentPlayback !== Playback.Roll,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user