Feat/countdown style (#290)

* feat: Countdown Style

---------

Co-authored-by: Fabian Posenau <fabian@fphome.de>
Co-authored-by: cv <34649812+cpvalente@users.noreply.github.com>
Co-authored-by: Fabian Posenau <19673098+kellhogs@users.noreply.github.com>
This commit is contained in:
Fabian Posenau
2023-02-26 19:53:26 +01:00
committed by GitHub
parent 6d138ce9f1
commit c405698813
16 changed files with 228 additions and 139 deletions
+7 -2
View File
@@ -1,4 +1,4 @@
import { TimerLifeCycle } from 'ontime-types';
import { TimerLifeCycle, TimerType } from 'ontime-types';
import { eventStore } from '../stores/EventStore.js';
import { PlaybackService } from './PlaybackService.js';
@@ -27,6 +27,7 @@ export class TimerService {
secondaryTimer: number | null;
selectedEventId: string | null;
duration: number | null;
timerType: TimerType | null;
};
/**
@@ -91,6 +92,7 @@ export class TimerService {
secondaryTimer: null,
selectedEventId: null,
duration: null,
timerType: null,
};
this.loadedTimerId = null;
this._pausedInterval = 0;
@@ -121,6 +123,7 @@ export class TimerService {
// update relevant information and force update
this.timer.duration = timer.duration;
this.timer.timerType = timer.timerType;
// this might not be ideal
this.timer.finishedAt = null;
@@ -138,7 +141,8 @@ export class TimerService {
* @param {number} timer.timeStart
* @param {number} timer.timeEnd
* @param {number} timer.duration
* @param {string} timer.timeType
* @param {string} timer.timerBehaviour
* @param {string} timer.timerType
* @param {boolean} timer.skip
*/
load(timer) {
@@ -152,6 +156,7 @@ export class TimerService {
this.timer.duration = timer.duration;
this.timer.current = timer.duration;
this.playback = 'armed';
this.timer.timerType = timer.timerType;
this._pausedInterval = 0;
this._pausedAt = 0;