feat: adiciona suporte para sobrescrever arquivos de saída no FFmpeg e atualiza ícones de estado na interface

This commit is contained in:
2026-02-28 20:53:19 -03:00
parent d69ce92e32
commit 3e38c51e3a
4 changed files with 12 additions and 7 deletions
+4
View File
@@ -14,6 +14,10 @@ impl FfmpegCommandBuilder {
pub fn build(project: &Project) -> Vec<String> {
let mut args: Vec<String> = Vec::new();
// Sobrescreve o arquivo de saída sem prompt interativo.
// Sem isso o FFmpeg aguarda [y/N] no stdin e o processo trava.
args.push("-y".to_string());
// ── Inputs ──────────────────────────────────────────────────────────────
// Input 0: arquivo fonte (sempre sem itsoffset próprio)
args.push("-i".to_string());
+1
View File
@@ -13,6 +13,7 @@ pub async fn run_ffmpeg_async(
) -> Result<()> {
let mut child = Command::new("ffmpeg")
.args(&args)
.stdin(std::process::Stdio::null())
.stderr(std::process::Stdio::piped())
.stdout(std::process::Stdio::null())
.spawn()
+5 -5
View File
@@ -187,11 +187,11 @@ impl BatchPanel {
let (icon, color) = match &item.state {
ExecutionState::Idle => ("", egui::Color32::GRAY),
ExecutionState::Running => ("", egui::Color32::YELLOW),
ExecutionState::Success => ("", egui::Color32::GREEN),
ExecutionState::Success => ("", egui::Color32::GREEN),
ExecutionState::Cancelled => {
("", egui::Color32::from_rgb(255, 200, 0))
}
ExecutionState::Error(_) => ("", egui::Color32::RED),
ExecutionState::Error(_) => ("", egui::Color32::RED),
};
ui.colored_label(color, icon);
ui.label(format!("#{}{} >> {}", idx + 1, source_name, output_name));
@@ -300,7 +300,7 @@ impl BatchPanel {
events.push(BatchPanelEvent::ProcessAll);
}
} else if all_finished && !items.is_empty() {
ui.colored_label(egui::Color32::GREEN, " Lote concluído.");
ui.colored_label(egui::Color32::GREEN, " Lote concluído.");
}
});
}
@@ -483,9 +483,9 @@ impl BatchPanel {
let can_add = self.form_video.is_some() && self.form_output.is_some();
let confirm_label = if is_edit {
"Salvar alterações"
"Salvar alterações"
} else {
"Adicionar "
"Adicionar ao carrinho"
};
if ui
+2 -2
View File
@@ -76,13 +76,13 @@ impl ExecutionPanel {
ui.label("Processando...");
}
ExecutionState::Success => {
ui.colored_label(egui::Color32::GREEN, " Arquivo gerado com sucesso!");
ui.colored_label(egui::Color32::GREEN, " Arquivo gerado com sucesso!");
}
ExecutionState::Cancelled => {
ui.colored_label(egui::Color32::YELLOW, "⊘ Geração cancelada pelo usuário.");
}
ExecutionState::Error(msg) => {
ui.colored_label(egui::Color32::RED, " Erro durante o processamento:");
ui.colored_label(egui::Color32::RED, " Erro durante o processamento:");
ui.add(
egui::TextEdit::multiline(&mut msg.as_str())
.desired_rows(4)