From 5644b427222dec9b589501fd2f20df72c8967225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Henrique?= Date: Thu, 10 Sep 2026 13:30:10 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20carregamento=20autom=C3=A1tico=20da=20a?= =?UTF-8?q?n=C3=A1lise=20do=20Scanner=20ao=20abrir=20a=20aba?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - carregamento automático da análise do Scanner ao abrir a aba Refinar - simplificada a aba Editar vídeo para exibir análises disponíveis sem carregamento manual - movida a visualização do tipo de vídeo para a guia Projeto com leitura do banco Resumo: - 10 arquivos alterados - 2 novos - 8 modificados - 0 removidos 8 files changed, 114 insertions(+), 11 deletions(-) Arquivos: - .jhonny/analises.db - code/cep-plugin/abas/projeto/projeto.js - code/cep-plugin/index.html - code/cep-plugin/main.js - code/engine/integracoes/audio/__init__.py - code/engine/integracoes/audio/modelos_de_analise_musical.py - code/engine/integracoes/audio/provider_de_analise_musical_essentia.py - code/engine/testes/test_analisador_de_musica_essentia.py - code/engine/consultar_edicao_concluida.py - code/engine/integracoes/audio/classificador_de_musica_essentia.py --- .jhonny/analises.db | Bin 1089536 -> 1118208 bytes code/cep-plugin/abas/projeto/projeto.js | 42 ++++++ code/cep-plugin/index.html | 14 +- code/cep-plugin/main.js | 9 +- code/engine/consultar_edicao_concluida.py | 56 ++++++++ code/engine/integracoes/audio/__init__.py | 5 +- .../audio/classificador_de_musica_essentia.py | 135 ++++++++++++++++++ .../audio/modelos_de_analise_musical.py | 10 ++ .../provider_de_analise_musical_essentia.py | 22 ++- .../test_analisador_de_musica_essentia.py | 23 +++ 10 files changed, 305 insertions(+), 11 deletions(-) create mode 100644 code/engine/consultar_edicao_concluida.py create mode 100644 code/engine/integracoes/audio/classificador_de_musica_essentia.py diff --git a/.jhonny/analises.db b/.jhonny/analises.db index f3dbc6c7af87a3a57034ced4844bce909ff905e2..3224e6a0012672eac72346c497f1f015b3c4587e 100644 GIT binary patch delta 1989 zcmb_cT}&KR6rOu$c6MfGX3uOPOA%=Y9||P=%xrg|fPkfJqP3}%f<*!h1G^;KQkHbL zl~4&#qy>!$b)(~xVj?8I2xX1)-~)XyZAjYai%o3egNZ*esqr^`F(%$!hTW-aeR7hs zneWWr?|kRyp1GSHbE};zWxfzaAs>}{_)o9b94-w}b*~k>h?9W_>m(iOlsbbkCgD@l}T8_m(+#3YD5`-FV9SxCj5juWurCYX!;I&?+WI6Jvz?7>Qm;#sg}gp;m3G)zluXu{qGx96VAN z)U^J``4cEl(eSSnf#zVSE_k@{pAP1KGFuQ`*9u(7J5PnOS988PHW7(V#UfLCok-}HVv%UvE|X&uAi?g)b0<5) zeM;dG<%N^Vun@28so8P(hxm*zWV=K56*R^n5BKVjqHkc(?5iPO(aRo zgxTJYOSsD2D^!`9ffG_qc6@9>rapwj)<<19j+M;Fi!emN@9;f*1$W4$*@6$?ZCHY7 z7>6OUE!$vL6d6>;W8-2Z7S{u!;6R$_aUfOXvuL*n0g-bcO>{euDzFS+#@m#FD-Se* z$pclO8U9!qZxaeQ^Jy1o0?Gq5bL&OWDYy$aAq{_!wSONj!+FqQ4NO=jiL}G4L=>Q0 z9!{hQPNaHvksX$IB8_t*)h!Yg$j*ax0L|q9Dw6>LWE0ZaPj((yaO9C`2m`k$_zk{= zFX2|&xAF-bmly_>^H^2Yv0!7vh(tS~A(E<;^LrmfQkEPtGIe3#cBaAK!9BQ5_$=u3 zlJh7>$2ZW BDwzNP delta 333 zcmZoz;L>owX@az%Gy?-87Xut{JfEmzEGf;P*CoOV6lCWA2qYQV_y(*9nLMpRmZ8pewsauRh4B6vnvz0w+n?az2n?2AHo#FxNHNX!KMj}0_}_on1GlWh*^M` z6^Pk@m>q~YfS41Axqz4(h5mAr)?APVww(gSoN|50S5r*!CGnn diff --git a/code/cep-plugin/abas/projeto/projeto.js b/code/cep-plugin/abas/projeto/projeto.js index 78336af..861e40b 100644 --- a/code/cep-plugin/abas/projeto/projeto.js +++ b/code/cep-plugin/abas/projeto/projeto.js @@ -71,9 +71,51 @@ function projetoSelecionarSequencia() { }); document.getElementById("btnProjetoContinuar").disabled = false; document.getElementById("btnProjetoSalvar").disabled = false; + projetoCarregarTipoDeVideo(); document.getElementById("projetoInfo").textContent = "A sequência foi carregada. Selecione as faixas e clipes que participarão do plano."; } +function projetoCarregarTipoDeVideo() { + var select = document.getElementById("projetoTipoVideoSelect"); + var info = document.getElementById("projetoTipoVideoInfo"); + select.disabled = true; + runStreamed(SCANNER_PYTHON_BIN, [CONSULTAR_EDICAO_SCRIPT, projetoAtual.id, "--banco", ANALISES_DB_PATH], + function () {}, + function (codigo, ultimoErro, ultimaSaida) { + if (codigo !== 0) { info.textContent = ultimoErro || "Nenhum tipo de vídeo salvo para esta sequência."; return; } + try { + var edicao = JSON.parse(ultimaSaida).edicao; + var tipos = tiposVideoLer().filter(function (item) { return item.ativo !== false; }); + var tipo = tipos.filter(function (item) { return item.id === edicao.tipo_de_video; })[0]; + select.innerHTML = ""; + tipos.forEach(function (item) { + var opcao = document.createElement("option"); + opcao.value = item.id; + opcao.textContent = item.nome; + select.appendChild(opcao); + }); + if (!tipo) { + var tipoDesconhecido = document.createElement("option"); + tipoDesconhecido.value = edicao.tipo_de_video; + tipoDesconhecido.textContent = edicao.tipo_de_video; + select.appendChild(tipoDesconhecido); + } + select.value = edicao.tipo_de_video; + select.disabled = false; + silenceState.tipoVideoId = edicao.tipo_de_video; + silenceState.tipoVideo = tipo || null; + info.textContent = "Tipo carregado da edição concluída mais recente."; + } catch (erro) { info.textContent = "Não foi possível interpretar o tipo salvo: " + erro.message; } + }); +} + +function projetoSelecionarTipoVideo() { + var tipo = tiposVideoLer().filter(function (item) { return item.id === document.getElementById("projetoTipoVideoSelect").value; })[0] || null; + silenceState.tipoVideoId = tipo ? tipo.id : null; + silenceState.tipoVideo = tipo; + document.getElementById("projetoTipoVideoInfo").textContent = tipo ? tipo.nome + " · disponível para a edição." : "Nenhum tipo selecionado."; +} + function projetoSalvar() { if (!projetoAtual) return; var faixas = Array.prototype.slice.call(document.querySelectorAll("[data-projeto-faixa]:checked")).map(function (item) { return item.getAttribute("data-projeto-faixa"); }); diff --git a/code/cep-plugin/index.html b/code/cep-plugin/index.html index b7e39f1..c7b855e 100755 --- a/code/cep-plugin/index.html +++ b/code/cep-plugin/index.html @@ -111,6 +111,11 @@
Faixas
—
Clipes
—
+ + +

O tipo definido na edição concluída será carregado do banco.

Faixas e clipes utilizados

@@ -123,20 +128,19 @@