feat: align legacy operator and playout behavior
This commit is contained in:
@@ -62,9 +62,20 @@
|
||||
|
||||
function nextLabel(playout) {
|
||||
if (!playout || playout.nextKind === "none") return "";
|
||||
if (playout.nextKind === "endOfPlaylist") return " · 마지막 항목";
|
||||
return playout.nextKind === "pageNext" ? " · 다음 페이지" : " · 다음 항목";
|
||||
}
|
||||
|
||||
function canTakeInFromState(playout, hasPlaylist) {
|
||||
return playout.phase === "prepared" ||
|
||||
hasPlaylist && (playout.phase === "idle" || playout.phase === "program");
|
||||
}
|
||||
|
||||
function canAdvanceFromState(playout) {
|
||||
return playout.phase === "program" &&
|
||||
playout.nextKind !== "none" && playout.nextKind !== "endOfPlaylist";
|
||||
}
|
||||
|
||||
function render(state) {
|
||||
currentState = state || currentState;
|
||||
const playout = currentState && currentState.playout;
|
||||
@@ -79,7 +90,8 @@
|
||||
}
|
||||
|
||||
const commandAvailable = playout.isCommandAvailable === true &&
|
||||
playout.outcomeUnknown !== true;
|
||||
playout.outcomeUnknown !== true &&
|
||||
playout.isTakeOutCompletionPending !== true;
|
||||
const hasPlaylist = Array.isArray(currentState.playlist) &&
|
||||
currentState.playlist.some(function (row) { return row.isEnabled === true; });
|
||||
const liveTakeInAllowed = playout.mode !== "live" ||
|
||||
@@ -93,15 +105,15 @@
|
||||
prepare.classList.toggle("active", playout.phase !== "idle");
|
||||
prepare.disabled = busy || !commandAvailable || !canPrepareToggle ||
|
||||
playout.isPlayCompletionPending === true;
|
||||
const canTakeIn = playout.phase === "prepared" ||
|
||||
(playout.phase === "idle" && hasPlaylist);
|
||||
const canTakeIn = canTakeInFromState(playout, hasPlaylist);
|
||||
takeIn.disabled = busy || !commandAvailable || !liveTakeInAllowed ||
|
||||
!canTakeIn || playout.isPlayCompletionPending === true;
|
||||
next.disabled = busy || !commandAvailable ||
|
||||
playout.phase !== "program" || playout.nextKind === "none" ||
|
||||
!canAdvanceFromState(playout) ||
|
||||
playout.isPlayCompletionPending === true;
|
||||
takeOut.disabled = busy || !commandAvailable ||
|
||||
(playout.phase !== "prepared" && playout.phase !== "program");
|
||||
// MainForm's Escape path called StopAll whenever the Tornado player existed,
|
||||
// even if its local m_TakeIn flag had already drifted back to IDLE.
|
||||
takeOut.disabled = busy || !commandAvailable;
|
||||
backgroundNone.disabled = busy || playout.canChangeBackground !== true;
|
||||
backgroundFile.disabled = busy || playout.canChangeBackground !== true;
|
||||
fadeDuration.disabled = busy || playout.canChangeBackground !== true;
|
||||
@@ -142,7 +154,7 @@
|
||||
});
|
||||
|
||||
document.addEventListener("keydown", function (event) {
|
||||
if (event.repeat || hasOpenDialog()) return;
|
||||
if (event.defaultPrevented || event.repeat || hasOpenDialog()) return;
|
||||
if (event.key === "F2") {
|
||||
event.preventDefault();
|
||||
if (!backgroundFile.disabled) backgroundFile.click();
|
||||
|
||||
Reference in New Issue
Block a user