mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 11:23:50 +00:00
feat: OSC
This commit is contained in:
@@ -437,6 +437,7 @@ class EventTimer extends Timer {
|
||||
if (end < start) end += this.DAYMS;
|
||||
|
||||
// time stuff changes on wheter we keep the running clock
|
||||
|
||||
if (type === 'load') {
|
||||
this._resetTimers();
|
||||
|
||||
@@ -586,14 +587,14 @@ class EventTimer extends Timer {
|
||||
current = ${this.current}
|
||||
duration = ${this.duration}
|
||||
|
||||
Options
|
||||
------------------------------
|
||||
showNegative = ${this.showNegative}
|
||||
|
||||
Events
|
||||
------------------------------
|
||||
numEvents = ${this.numEvents}
|
||||
selectedEvent = ${this.selectedEvent}
|
||||
numEvents = ${this.numEvents}
|
||||
selectedEvent = ${this.selectedEvent}
|
||||
selectedEventId = ${this.selectedEventId}
|
||||
nextEventId = ${this.nextEventId}
|
||||
selectedPublicEventId = ${this.selectedPublicEventId}
|
||||
nextPublicEventId = ${this.nextPublicEventId}
|
||||
|
||||
Private Titles
|
||||
------------------------------
|
||||
@@ -617,7 +618,6 @@ class EventTimer extends Timer {
|
||||
Subtitle Next = ${this.titlesPublic.subtitleNext}
|
||||
Presenter Next = ${this.titlesPublic.presenterNext}
|
||||
|
||||
|
||||
Messages
|
||||
------------------------------
|
||||
presenter text = ${this.presenter.text}
|
||||
@@ -630,10 +630,15 @@ class EventTimer extends Timer {
|
||||
Private
|
||||
------------------------------
|
||||
finishAt = ${this._finishAt}
|
||||
finished = ${this._finishedAt}
|
||||
startedAt = ${this._startedAt}
|
||||
pausedAt = ${this._pausedAt}
|
||||
pausedInterval = ${this._pausedInterval}
|
||||
pausedTotal = ${this._pausedTotal}
|
||||
|
||||
Socket
|
||||
------------------------------
|
||||
numClients = ${this._numClients}
|
||||
`;
|
||||
}
|
||||
|
||||
|
||||
+14
-3
@@ -54,12 +54,20 @@ class Timer {
|
||||
this.current =
|
||||
this._startedAt + this.duration + this._pausedTotal - now;
|
||||
|
||||
if (this.current <= 0 && this._finishedAt == null)
|
||||
this._finishedAt = now;
|
||||
break;
|
||||
case 'pause':
|
||||
// update paused time
|
||||
this._pausedInterval = now - this._pausedAt;
|
||||
|
||||
if (this._startedAt != null) {
|
||||
// update current timer
|
||||
this.current =
|
||||
this._startedAt +
|
||||
this.duration +
|
||||
this._pausedTotal +
|
||||
this._pausedInterval -
|
||||
now;
|
||||
}
|
||||
break;
|
||||
case 'stop':
|
||||
// nothing here yet
|
||||
@@ -68,6 +76,9 @@ class Timer {
|
||||
console.error('Timer: no playstate on update call', this.state);
|
||||
break;
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
if (this.current <= 0 && this._finishedAt == null) this._finishedAt = now;
|
||||
}
|
||||
|
||||
// helpers
|
||||
@@ -193,7 +204,7 @@ class Timer {
|
||||
|
||||
if (amount < 0 && Math.abs(amount) > this.current) {
|
||||
// if we will make the clock negative
|
||||
this._finishedAt = this._getCurrentTime();
|
||||
if (this._finishedAt == null) this._finishedAt = this._getCurrentTime();
|
||||
} else if (this.current < 0 && this.current + amount > 0) {
|
||||
// clock will go from negative to positive
|
||||
this._finishedAt = null;
|
||||
|
||||
Reference in New Issue
Block a user