Change the words of a spoken line by hand

This commit is contained in:
gator 2026-09-19 19:21:09 +00:00
parent 7ce8085384
commit 9ada432a4b

View file

@ -1186,13 +1186,16 @@
+ '<p class="cont">' + esc(String(s.rough || "").slice(0, 300)) + '</p></div></div>'; + '<p class="cont">' + esc(String(s.rough || "").slice(0, 300)) + '</p></div></div>';
} }
var lines = (s.audio || []).map(function (a) { var lines = (s.audio || []).map(function (a, ai) {
var who = voice[a.character_id] || {}; var who = voice[a.character_id] || {};
return '<div class="line">' return '<div class="line">'
+ '<button type="button" class="play" data-shot="' + esc(s.id) + '">&#9654;</button>' + '<button type="button" class="play" data-shot="' + esc(s.id) + '">&#9654;</button>'
+ '<div class="say"><span class="who">' + esc(who.name || a.character_id) + '</span> ' + '<div class="say"><span class="who">' + esc(who.name || a.character_id) + '</span> '
+ (a.lip_sync ? '<span class="lip">on camera</span>' : '<span class="vobadge">voice over</span>') + (a.lip_sync ? '<span class="lip">on camera</span>' : '<span class="vobadge">voice over</span>')
+ '<br>' + esc(a.text || "") + '<br>' + esc(a.text || "")
+ ' <details style="display:inline"><summary style="cursor:pointer;color:var(--muted);font-size:12px;display:inline">change the words</summary>'
+ '<input type="text" maxlength="400" style="width:100%;margin:4px 0" data-linetext="' + esc(s.id) + '|' + ai + '" value="' + esc(a.text || "") + '">'
+ '<button type="button" class="btn" data-lineset="' + esc(s.id) + '|' + ai + '">Save these words</button></details>'
+ (a.delivery ? '<br><span class="dir">' + esc(a.delivery) + '</span>' : '') + (a.delivery ? '<br><span class="dir">' + esc(a.delivery) + '</span>' : '')
+ '</div><span class="dur" data-dur="' + esc(s.id) + '"></span></div>'; + '</div><span class="dur" data-dur="' + esc(s.id) + '"></span></div>';
}).join(""); }).join("");
@ -1513,6 +1516,14 @@
+ "automatically. This takes a few minutes." : (r.note || "Already checked."), "ok"); await refresh(); } + "automatically. This takes a few minutes." : (r.note || "Already checked."), "ok"); await refresh(); }
return; return;
} }
if ((el = hit("data-lineset"))) {
var lk = el.getAttribute("data-lineset"), lp = lk.split("|");
var lin = document.querySelector('[data-linetext="' + lk + '"]');
el.disabled = true;
r = await act("set_line", { draft_id: CUR, shot_id: lp[0], index: Number(lp[1]), text: lin ? lin.value : "" });
if (r) { showMsg("msg", "Saved. The voice will be recorded again with the new words the next time it is played or filmed.", "ok"); await refresh(); }
return;
}
if ((el = hit("data-findprops"))) { if ((el = hit("data-findprops"))) {
el.disabled = true; el.disabled = true;
r = await act("find_props", { draft_id: CUR }); r = await act("find_props", { draft_id: CUR });