@@ -11,12 +11,24 @@ impl WalksnailOsdTool {
1111 ui. add_space ( 5.0 ) ;
1212 ui. horizontal ( |ui| {
1313 self . start_stop_render_button ( ui) ;
14+ self . out_path_label ( ui) ;
1415 self . render_progress ( ui) ;
1516 } ) ;
1617 ui. add_space ( 2.0 ) ;
1718 } ) ;
1819 }
1920
21+ fn out_path_label ( & mut self , ui : & mut Ui ) {
22+ if self . render_status . is_not_in_progress ( ) {
23+ if let Some ( out_path) = & self . out_path {
24+ let path = out_path. as_path ( ) . to_string_lossy ( ) ;
25+ ui. label ( path) ;
26+ } else {
27+ ui. label ( "-" ) ;
28+ }
29+ }
30+ }
31+
2032 fn start_stop_render_button ( & mut self , ui : & mut Ui ) {
2133 let button_size = vec2 ( 110.0 , 40.0 ) ;
2234 if self . render_status . is_not_in_progress ( ) {
@@ -30,7 +42,8 @@ impl WalksnailOsdTool {
3042 {
3143 tracing:: info!( "Start render button clicked" ) ;
3244 self . render_status . start_render ( ) ;
33- if let ( Some ( video_path) , Some ( osd_file) , Some ( font_file) , Some ( video_info) , Some ( srt_file) ) = (
45+ if let ( Some ( out_path) , Some ( video_path) , Some ( osd_file) , Some ( font_file) , Some ( video_info) , Some ( srt_file) ) = (
46+ & self . out_path ,
3447 & self . video_file ,
3548 & self . osd_file ,
3649 & self . font_file ,
@@ -47,7 +60,7 @@ impl WalksnailOsdTool {
4760 match start_video_render (
4861 & self . dependencies . ffmpeg_path ,
4962 video_path,
50- & get_output_video_path ( video_path) ,
63+ & get_output_video_path ( out_path , video_path) ,
5164 osd_file. frames . clone ( ) ,
5265 srt_file. frames . clone ( ) ,
5366 font_file. clone ( ) ,
@@ -111,7 +124,13 @@ impl WalksnailOsdTool {
111124 }
112125 Status :: Completed => {
113126 ui. vertical ( |ui| {
114- ui. add ( ProgressBar :: new ( 1.0 ) . text ( "Done" ) ) ;
127+ if let ( Some ( out_path) , Some ( input_video_path) ) = ( & self . out_path , & self . video_file )
128+ {
129+ let out = & get_output_video_path ( out_path, input_video_path) ;
130+ let path = out. as_path ( ) . to_string_lossy ( ) ;
131+ let name: String = out. file_name ( ) . unwrap ( ) . to_string_lossy ( ) . into ( ) ;
132+ ui. hyperlink_to ( name, path) ;
133+ }
115134 } ) ;
116135 }
117136 Status :: Cancelled { progress_pct } => {
0 commit comments