feat: implementa funcionalidade de exportação de faixas de áudio e legenda
This commit is contained in:
@@ -7,6 +7,8 @@ use std::collections::HashMap;
|
||||
/// Evento emitido por interações com a lista de faixas existentes.
|
||||
pub enum ExistingTrackEvent {
|
||||
OffsetChanged(TrackId, SyncOffset),
|
||||
/// O usuário solicitou exportar a faixa identificada por `TrackId`.
|
||||
ExportRequested(TrackId),
|
||||
}
|
||||
|
||||
/// Lista as faixas detectadas no arquivo de vídeo e permite editar o offset de cada uma.
|
||||
@@ -47,13 +49,14 @@ impl ExistingTrackList {
|
||||
}
|
||||
|
||||
egui::Grid::new("existing_tracks_grid")
|
||||
.num_columns(4)
|
||||
.num_columns(5)
|
||||
.striped(true)
|
||||
.show(ui, |ui| {
|
||||
ui.strong("#");
|
||||
ui.strong("Tipo");
|
||||
ui.strong("Codec");
|
||||
ui.strong("Atraso");
|
||||
ui.strong("");
|
||||
ui.end_row();
|
||||
|
||||
for track in tracks {
|
||||
@@ -86,6 +89,18 @@ impl ExistingTrackList {
|
||||
}
|
||||
}
|
||||
|
||||
// Botão de exportar (somente Áudio e Legenda)
|
||||
match track.kind {
|
||||
TrackKind::Audio | TrackKind::Subtitle => {
|
||||
if ui.small_button("⬇ Exportar").clicked() {
|
||||
events.push(ExistingTrackEvent::ExportRequested(track.id));
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
ui.label(""); // célula vazia para alinhamento
|
||||
}
|
||||
}
|
||||
|
||||
ui.end_row();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user