From 06ba45f0c0cabb7fa12ced9a3a3fb881f8afcdfa Mon Sep 17 00:00:00 2001 From: John A Knight Jr Date: Tue, 23 Jul 2024 13:47:59 -0700 Subject: [PATCH] Improve elapsed/remaining time display --- cues.js | 2 ++ package.json | 2 +- qlabfb.js | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cues.js b/cues.js index ef7f403..84870cf 100644 --- a/cues.js +++ b/cues.js @@ -20,6 +20,7 @@ class Cue { autoLoad = false duration = 0 pctElapsed = 0 + elapsed = 0 startedAt = -1 qColor = 0 qColorName = '' @@ -56,6 +57,7 @@ function JSONtoCue(newCue, j, self) { newCue.duration = j.duration newCue.qParent = j.parent newCue.pctElapsed = j.percentActionElapsed + newCue.elapsed = j.actionElapsed if (j.notes) { newCue.Notes = j.notes.slice(0, 20) } diff --git a/package.json b/package.json index 4204f9f..736f418 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "figure53-qlab-advance", - "version": "2.7.3", + "version": "2.7.4", "main": "qlabfb.js", "type": "module", "scripts": { diff --git a/qlabfb.js b/qlabfb.js index 92bfb7c..7d45289 100644 --- a/qlabfb.js +++ b/qlabfb.js @@ -253,7 +253,7 @@ class QLabInstance extends InstanceBase { const tenths = this.config.useTenths ? 0 : 1 const rc = this.runningCue - const tElapsed = rc.duration * rc.pctElapsed + const tElapsed = rc.elapsed // rc.duration * rc.pctElapsed const ehh = pad0(Math.floor(tElapsed / 3600)) const emm = pad0(Math.floor(tElapsed / 60) % 60) @@ -269,7 +269,7 @@ class QLabInstance extends InstanceBase { } eft = eft + ess - let tLeft = rc.duration * (1 - rc.pctElapsed) + let tLeft = rc.duration - tElapsed // * (1 - rc.pctElapsed) if (tLeft > 0) { tLeft += tenths } @@ -542,7 +542,7 @@ class QLabInstance extends InstanceBase { } let rc = this.runningCue - if (rc && rc.pctElapsed > 0) { + if (rc && rc.elapsed > 0) { if (3 == this.qVer) { this.sendOSC('/runningOrPausedCues', []) } else {