From b6c1b793366f2655385f5a311c9896b42d814ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Henrique?= Date: Wed, 9 Sep 2026 10:03:25 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20adicionada=20sele=C3=A7=C3=A3o=20de=20t?= =?UTF-8?q?imeline=20do=20projeto=20na=20guia=20Editar=20v=C3=ADd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - adicionada seleção de timeline do projeto na guia Editar vídeo Resumo: - 3 arquivos alterados - 0 novos - 3 modificados - 0 removidos 3 files changed, 116 insertions(+), 17 deletions(-) Arquivos: - code/cep-plugin/index.html - code/cep-plugin/main.js - code/cep-plugin/styles.css --- code/cep-plugin/index.html | 11 +++- code/cep-plugin/main.js | 120 ++++++++++++++++++++++++++++++++----- code/cep-plugin/styles.css | 2 + 3 files changed, 116 insertions(+), 17 deletions(-) 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 @@

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.

Comece aqui
- + + -

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= 0 ? activeIndex : 0; + picker.hidden = false; + document.getElementById("silenceSequenceListInfo").textContent = + result.sequences.length + " timeline(s) encontrada(s)."; + silenceSelectSequence(); + } + ); +} + +function silenceSelectSequence() { + var select = document.getElementById("silenceSequenceSelect"); + var option = select && select.options[select.selectedIndex]; + if (!option || !option.dataset.sequence) return; + var sequence = JSON.parse(option.dataset.sequence); + setBusy("btnDetectClip", true); + setStep(1, "running", "Lendo timeline…"); + document.getElementById("silenceClipInfo").textContent = "Lendo o primeiro clipe da timeline escolhida…"; + var sequenceId = JSON.stringify(String(sequence.id)); + cs.evalScript( + "(function(){" + + "try{" + + "var sequenceId=" + sequenceId + ";" + + "var seq=null;" + + "for(var i=0;i