diff --git a/code/cep-plugin/index.html b/code/cep-plugin/index.html
index e064e4a..21a8f5c 100755
--- a/code/cep-plugin/index.html
+++ b/code/cep-plugin/index.html
@@ -79,18 +79,23 @@
1
Escolher o vídeo
-
Lê o primeiro clipe da sequência aberta no Premiere.
+
Lista as timelines do projeto e lê o primeiro clipe da escolhida.
-
+
+
+
+
+
+
- Sequência
- —
- Arquivo
- —
- Caminho
- —
-
Abra a sequência desejada no Premiere e clique em Detectar.
+
Abra o projeto no Premiere e carregue as timelines.
diff --git a/code/cep-plugin/main.js b/code/cep-plugin/main.js
index 87884f6..0e95295 100755
--- a/code/cep-plugin/main.js
+++ b/code/cep-plugin/main.js
@@ -1323,6 +1323,7 @@ var LANGUAGE_CATALOG = [
var DEFAULT_LANGUAGE = "pt";
var silenceState = {
+ sequenceId: null,
sequenceName: null,
mediaPath: null,
fileBaseName: null,
@@ -1442,21 +1443,108 @@ function slugify(name) {
.replace(/(^-|-$)/g, "") || "video";
}
-function silenceDetectClip() {
+function formatSequenceDuration(seconds) {
+ var total = Math.max(0, Math.round(Number(seconds) || 0));
+ var minutes = Math.floor(total / 60);
+ var remainder = total % 60;
+ return minutes + ":" + String(remainder).padStart(2, "0");
+}
+
+function silenceListSequences() {
setBusy("btnDetectClip", true);
- setStep(1, "running", "Detectando…");
- document.getElementById("silenceClipInfo").textContent = "Lendo a sequência ativa no Premiere…";
+ setStep(1, "running", "Carregando…");
+ document.getElementById("silenceClipInfo").textContent = "Lendo as timelines do projeto…";
cs.evalScript(
"(function(){" +
"try{" +
- "var seq=app.project.activeSequence;" +
- "if(!seq) return JSON.stringify({ok:false,error:'Nenhuma sequência ativa.'});" +
+ "if(!app.project) return JSON.stringify({ok:false,error:'Nenhum projeto aberto.'});" +
+ "var sequences=[];" +
+ "for(var i=0;i