show selected file

This commit is contained in:
2025-11-17 16:13:33 -07:00
parent ccf4499f89
commit 55347be232
3 changed files with 16 additions and 6 deletions

View File

@@ -52,7 +52,7 @@ pub fn main() {
SelectionUiError::SelectionListEmpty => {
draw_text_center(
&mut display,
"No Wavs were found in /gifs",
"No Wavs were found in /music",
MonoTextStyle::new(&FONT_6X10, Rgb565::RED),
)
.expect("Display Error");
@@ -64,6 +64,13 @@ pub fn main() {
assert!(selection.is_some());
draw_text_center(
&mut display,
&format!("Now playing {}", wavs[selection.unwrap()]),
MonoTextStyle::new(&FONT_6X10, Rgb565::WHITE),
)
.expect("Display Error");
let file_name = format!("/music/{}", wavs[selection.unwrap()]);
let file = File::new(String::from(file_name));
let mut wav = Wav::new(file).unwrap();