<% let cueKeys = allCues[cue.uniqueID]; %> <% let playbackPosition = workspace.playbackPosition==cue.uniqueID ? "playback-position" : "" %> <% let selected = workspace.selected.includes(cue.uniqueID) ? "selected": "" %> <% if(cueKeys && cueKeys.parent){ %>
<% if(cueKeys.isBroken){ %> <% }else if(cueKeys.isRunning){ %> <% }else if(cueKeys.isPaused){ %> <% }else if(cueKeys.isLoaded){ %> <% }else if(cueKeys.isFlagged){ %> <% }else{ %> <% } %>
<% if(cueKeys.type == "Group" && cueKeys.mode){ %> <% }else{ %> <% } %>
<%= cueKeys.number || " " %>
<% let nextCue = cueKeys.cueInWorkspace.parent.cues[cueKeys.cueInWorkspace.sortIndex+1]; %> <% for(let i=0; i <% let parent = cueKeys.parentKeys[i+1]; %> <% %> <% if(cueKeys.type=="Group" && cueKeys.cues.length==0 && i==cueKeys.parentKeys.length-1){ %> <% }else if(cueKeys.type=="Group" && i==cueKeys.parentKeys.length-1){ %> <%}else if(parent){%> <% let parentCues = parent.cueInWorkspace.cues %> <% let lastCueInMe = parentCues[parentCues.length-1]%> <% while(lastCueInMe.type=="Group" && lastCueInMe.cues.length){ parentCues = lastCueInMe.cues; lastCueInMe = parentCues[parentCues.length-1]; } %> <% if(lastCueInMe.uniqueID == cueKeys.uniqueID){ %> <% }else{ %> <% } %> <% }else if(cueKeys.parentKeys[i]){ %> <% let nextCue2 = cueKeys.parentKeys[i].cues[cueKeys.cueInWorkspace.sortIndex+1]; %> <% if(!nextCue2){ %> <% }else{ %> <% } %> <% } %> <% } %> <% if(cue.type=="Group"){ %> <% if(cue.cues && cue.cues.length==0){ %> <%= cueKeys.listName %> <% }else{ %> <%= cueKeys.listName %> <% } %> <% }else if(!nextCue){ %> <%= cueKeys.listName %> <% }else{ %> <%= cueKeys.listName %> <% } %> <% if(cueKeys.currentCueTarget){ %> <%= allCues[cueKeys.currentCueTarget].number || allCues[cueKeys.currentCueTarget].listName %> <% }else{ %> <% } %> <% if(cueKeys.preWait){ %> <%= elapsedTime(cueKeys.preWait, cueKeys.preWaitElapsed, "preWait", cueKeys) %> <% }else{ %> 00:00.00 <% } %> <% let cueTypesWithAction = ["Audio", "Mic", "Video", "Camera", "Text", "Light", "Fade", "Network", "MIDI File", "Timecode", "Wait"]; %> <% if((cueKeys.type=="Group" && cueKeys.mode==3) || (cueKeys.type=="Group" && cueKeys.mode==6) || cueTypesWithAction.includes(cueKeys.type)){ %> <%= elapsedTime(cueKeys.duration, cueKeys.actionElapsed, "action", cueKeys) %> <% }else{ %> <% } %> <% if(cueKeys.postWait){ %> <%= elapsedTime(cueKeys.postWait, cueKeys.postWaitElapsed, "postWait", cueKeys) %> <% }else{ %> 00:00.00 <% } %> <% if(cueKeys.continueMode==2){ %>
<% }else if(cueKeys.continueMode==1){ %>
<% }else{ %> <% } %> <% }else{ %>
<%= cue.number || " " %>
<%= cue.listName %> 00:00.00 00:00.00 <% } %> <% function prettyFormatTime(seconds){ if(!seconds){ return "00:00.00"; } var startIndex = 14; if(seconds>=3600){ startIndex = 11; } var string = new Date(seconds * 1000).toISOString() return string.substring(startIndex, string.length-2) } function elapsedTime(def, value, type, cue){ if(type=="action" && cue.isPaused){ value-=cue.preWait; } let border, fill; if(cue.isPaused){ border = "#f6e737"; fill = "rgba(255, 240, 60, 0.7)"; }else{ border = "#48ba41"; fill = "rgba(0, 200, 50, 0.5)"; } if(value>0){ let percent = value/def*100; let bg = `style='background: black; background: linear-gradient(90deg, ${fill} ${percent}%, transparent ${percent}%);`; if(cue.isPaused){ bg+= "outline-color: "+border+";"; bg+= "color: white;"; } bg+="'"; return `
${prettyFormatTime(Math.min(def, value))}`; }else if(type=="postWait" && cue.continueMode==0){ return `${prettyFormatTime(def)}`; }else{ return prettyFormatTime(def); } } %>