mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 17:33:55 +00:00
create addTime function in simple timer (#1363)
* create addTime function in simple timer
This commit is contained in:
committed by
GitHub
parent
e6aa7404f7
commit
607bc40673
@@ -37,6 +37,14 @@ export class SimpleTimer {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public addTime(millis: number): SimpleTimerState {
|
||||
this.state.duration += millis;
|
||||
// the value of current will be overridden when update is called,
|
||||
// but if we are in pause or stop state it will not be changed so we do it here
|
||||
this.state.current += millis;
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public setDirection(direction: SimpleDirection, timeNow: number): SimpleTimerState {
|
||||
// if we are playing, we need to reset the targets
|
||||
if (this.state.playback === SimplePlayback.Start) {
|
||||
|
||||
Reference in New Issue
Block a user