Skip to content

Commit

Permalink
Merge pull request #135 from istnv/fix/elapsed
Browse files Browse the repository at this point in the history
Improve elapsed/remaining time display
  • Loading branch information
istnv authored Jul 24, 2024
2 parents e315f11 + 06ba45f commit b00f55c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cues.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Cue {
autoLoad = false
duration = 0
pctElapsed = 0
elapsed = 0
startedAt = -1
qColor = 0
qColorName = ''
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "figure53-qlab-advance",
"version": "2.7.3",
"version": "2.7.4",
"main": "qlabfb.js",
"type": "module",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions qlabfb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b00f55c

Please sign in to comment.