@@ -1948,8 +1948,9 @@ impl<'a> VulkanEngine<'a> {
19481948 egui:: RichText :: new ( format ! ( "Visualization Shader (GPU): {:.2} ms" , total_vis_us / 1000.0 ) )
19491949 . color ( egui:: Color32 :: LIGHT_BLUE )
19501950 ) ;
1951+ let buffer_label = if state. duration_seconds <= 0.0 { "Network Buffer" } else { "Audio Buffer" } ;
19511952 ui. label (
1952- egui:: RichText :: new ( format ! ( "Audio Buffer : {:.1}%" , state. stats. audio_buffer_fill_pct) )
1953+ egui:: RichText :: new ( format ! ( "{} : {:.1}%" , buffer_label , state. stats. audio_buffer_fill_pct) )
19531954 . color ( if state. stats . audio_buffer_fill_pct < 5.0 { egui:: Color32 :: RED } else if state. stats . audio_buffer_fill_pct > 95.0 { egui:: Color32 :: YELLOW } else { egui:: Color32 :: GREEN } )
19541955 ) ;
19551956 if state. video_frame_rx . is_some ( ) {
@@ -2937,12 +2938,27 @@ impl<'a> VulkanEngine<'a> {
29372938 columns[ 2 ] . style_mut ( ) . visuals . override_text_color = Some ( egui:: Color32 :: from_gray ( 235 ) ) ; // Slightly lighter for contrast
29382939 columns[ 2 ] . heading ( "Track Info" ) ;
29392940 columns[ 2 ] . separator ( ) ;
2940- let title_path = std:: path:: Path :: new ( & state. song_title ) ;
2941- let file_name = title_path. file_name ( ) . unwrap_or_default ( ) . to_string_lossy ( ) . to_string ( ) ;
2942- let file_dir = title_path. parent ( ) . unwrap_or ( std:: path:: Path :: new ( "" ) ) . to_string_lossy ( ) . to_string ( ) ;
2941+ let current_path_str = if state. playlist_index < state. playlist . len ( ) {
2942+ state. playlist [ state. playlist_index ] . clone ( )
2943+ } else {
2944+ state. song_title . clone ( )
2945+ } ;
2946+
2947+ let is_network = current_path_str. starts_with ( "http://" ) || current_path_str. starts_with ( "https://" ) ;
2948+ let file_name = if is_network {
2949+ state. song_title . clone ( )
2950+ } else {
2951+ std:: path:: Path :: new ( & state. song_title ) . file_name ( ) . unwrap_or_default ( ) . to_string_lossy ( ) . to_string ( )
2952+ } ;
2953+ let file_dir = if is_network {
2954+ current_path_str
2955+ } else {
2956+ std:: path:: Path :: new ( & current_path_str) . parent ( ) . unwrap_or ( std:: path:: Path :: new ( "" ) ) . to_string_lossy ( ) . to_string ( )
2957+ } ;
2958+
29432959 columns[ 2 ] . horizontal ( |ui| { ui. label ( "File/Title" ) ; ui. label ( & file_name) ; } ) ;
29442960 columns[ 2 ] . horizontal ( |ui| { ui. label ( "Artist" ) ; ui. label ( & state. artist ) ; } ) ;
2945- columns[ 2 ] . horizontal ( |ui| { ui. label ( " Path") ; ui. label ( & file_dir) ; } ) ;
2961+ columns[ 2 ] . horizontal ( |ui| { ui. label ( if is_network { "URL" } else { " Path" } ) ; ui. label ( & file_dir) ; } ) ;
29462962 if state. playlist . len ( ) > 1 {
29472963 columns[ 2 ] . horizontal ( |ui| { ui. label ( "Playlist" ) ; ui. label ( format ! ( "{} / {}" , state. playlist_index + 1 , state. playlist. len( ) ) ) ; } ) ;
29482964 }
0 commit comments