diff --git a/src/main.rs b/src/main.rs index 9c478b5..a2089ad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,7 @@ fn run(config: &Config) -> Result<()> { let ttf_context = ttf::init().map_err(|e| anyhow::anyhow!("TTF init failed: {}", e))?; let font: Option = ttf_context - .load_font("/System/Library/Fonts/Supplemental/Arial.ttf", 20) + .load_font("/System/Library/Fonts/Supplemental/Arial.ttf", 18) .ok(); let window = video_subsystem @@ -121,6 +121,9 @@ fn run(config: &Config) -> Result<()> { .event_pump() .map_err(|e| anyhow::anyhow!("Event pump failed: {}", e))?; + let font_size = 18; + let info_height: i32 = 50; + info!("Main loop started - waiting for events..."); let mut running = true; @@ -170,59 +173,47 @@ fn run(config: &Config) -> Result<()> { sdl2::keyboard::Keycode::M => { player_state.muted = !player_state.muted; } - sdl2::keyboard::Keycode::F => { - // Fullscreen toggle - skip for now to avoid borrow issues - } sdl2::keyboard::Keycode::Left => { - if shift { - if let Some(ref mut dec) = decoder { - let current = player_state.current_frame.saturating_sub(60); - dec.seek( - ((current as f64 / player_state.fps) * 1000.0) as u64, - )?; - player_state.current_frame = current; - } - } else { - if let Some(ref mut dec) = decoder { - let current = player_state.current_frame.saturating_sub(1); - dec.seek( - ((current as f64 / player_state.fps) * 1000.0) as u64, - )?; - player_state.current_frame = current; - } + let step = if shift { 60 } else { 1 }; + if let Some(ref mut dec) = decoder { + let current = player_state.current_frame.saturating_sub(step); + dec.seek( + ((current as f64 / player_state.fps) * 1000.0) as u64, + )?; + player_state.current_frame = current; } } sdl2::keyboard::Keycode::Right => { - if shift { - if let Some(ref mut dec) = decoder { - let current = player_state.current_frame + 60; - dec.seek( - ((current as f64 / player_state.fps) * 1000.0) as u64, - )?; - player_state.current_frame = current; - } - } else { - if let Some(ref mut dec) = decoder { - let current = player_state.current_frame + 1; - dec.seek( - ((current as f64 / player_state.fps) * 1000.0) as u64, - )?; - player_state.current_frame = current; - } + let step = if shift { 60 } else { 1 }; + if let Some(ref mut dec) = decoder { + let current = player_state.current_frame + step; + dec.seek( + ((current as f64 / player_state.fps) * 1000.0) as u64, + )?; + player_state.current_frame = current; + } + } + sdl2::keyboard::Keycode::Up => { + if player_state.zoom > 1.0 { + player_state.pan_y = (player_state.pan_y - 50.0).max(-500.0); + } + } + sdl2::keyboard::Keycode::Down => { + if player_state.zoom > 1.0 { + player_state.pan_y = (player_state.pan_y + 50.0).min(500.0); } } sdl2::keyboard::Keycode::Equals | sdl2::keyboard::Keycode::KpPlus => { - player_state.zoom = (player_state.zoom * 1.2).min(5.0); + player_state.zoom = (player_state.zoom * 1.2).min(10.0); } sdl2::keyboard::Keycode::Minus | sdl2::keyboard::Keycode::KpMinus => { player_state.zoom = (player_state.zoom / 1.2).max(0.5); + if player_state.zoom == 1.0 { + player_state.pan_x = 0.0; + player_state.pan_y = 0.0; + } } - sdl2::keyboard::Keycode::Backquote => { - player_state.zoom = 1.0; - player_state.pan_x = 0.0; - player_state.pan_y = 0.0; - } - sdl2::keyboard::Keycode::R => { + sdl2::keyboard::Keycode::Backquote | sdl2::keyboard::Keycode::R => { player_state.zoom = 1.0; player_state.pan_x = 0.0; player_state.pan_y = 0.0; @@ -231,6 +222,17 @@ fn run(config: &Config) -> Result<()> { } } } + sdl2::event::Event::MouseWheel { y, .. } => { + if y > 0 { + player_state.zoom = (player_state.zoom * 1.1).min(10.0); + } else if y < 0 { + player_state.zoom = (player_state.zoom / 1.1).max(0.5); + if player_state.zoom == 1.0 { + player_state.pan_x = 0.0; + player_state.pan_y = 0.0; + } + } + } _ => {} } } @@ -266,55 +268,57 @@ fn run(config: &Config) -> Result<()> { } } - if let Some(ref mut tex) = texture { - let dst = if player_state.zoom != 1.0 { - let info = video_info.as_ref().unwrap(); - let w = (info.width as f32 * player_state.zoom) as u32; - let h = (info.height as f32 * player_state.zoom) as u32; - let x = ((config.width as i32 - w as i32) / 2) as i32 + player_state.pan_x as i32; - let y = ((config.height as i32 - h as i32) / 2) as i32 + player_state.pan_y as i32; - Rect::new(x, y, w, h) - } else { - Rect::new(0, 0, 0, 0) - }; + let (vid_width, vid_height) = video_info + .as_ref() + .map(|i| (i.width, i.height)) + .unwrap_or((config.width, config.height)); - if player_state.zoom == 1.0 { - canvas.copy(tex, None, None).ok(); - } else { - canvas.copy(tex, None, Some(dst)).ok(); - } + let scale: f64 = if player_state.zoom != 1.0 { + player_state.zoom as f64 + } else { + let scale_x = config.width as f64 / vid_width as f64; + let scale_y = (config.height as i32 - info_height) as f64 / vid_height as f64; + scale_x.min(scale_y).min(1.0) + }; + + let scaled_w = (vid_width as f64 * scale) as u32; + let scaled_h = (vid_height as f64 * scale) as u32; + let offset_x = + ((config.width as i32 - scaled_w as i32) / 2) as i32 + player_state.pan_x as i32; + let offset_y = ((config.height as i32 - info_height - scaled_h as i32) / 2) as i32 + + player_state.pan_y as i32; + + if let Some(ref mut tex) = texture { + let dst = Rect::new(offset_x, offset_y, scaled_w, scaled_h); + canvas.copy(tex, None, Some(dst)).ok(); } if player_state.show_yolo { if let Some(ref mut yolo_loader) = yolo { let detections = yolo_loader.get_detections(player_state.current_frame); for det in detections { - let x1 = (det.x1 as f32 * player_state.zoom) as i32 - + player_state.pan_x as i32 - + ((config.width as i32 - - video_info.as_ref().map(|i| i.width as i32).unwrap_or(0)) - / 2); - let y1 = (det.y1 as f32 * player_state.zoom) as i32 - + player_state.pan_y as i32 - + ((config.height as i32 - - video_info.as_ref().map(|i| i.height as i32).unwrap_or(0)) - / 2); - let w = ((det.x2 - det.x1) as f32 * player_state.zoom) as u32; - let h = ((det.y2 - det.y1) as f32 * player_state.zoom) as u32; + let x1 = (det.x1 * scale) as i32 + offset_x; + let y1 = (det.y1 * scale) as i32 + offset_y; + let w = ((det.x2 - det.x1) * scale) as u32; + let h = ((det.y2 - det.y1) * scale) as u32; canvas.set_draw_color(sdl2::pixels::Color::RGB(0, 255, 0)); let _ = canvas.draw_rect(Rect::new(x1, y1, w, h)); - if let Some(ref f) = font { - let label = format!("{} {:.0}%", det.class_name, det.confidence * 100.0); - if let Ok(surface) = - f.render(&label).solid(sdl2::pixels::Color::RGB(0, 255, 0)) - { - let tex_label = - texture_creator.create_texture_from_surface(&surface).ok(); - if let Some(tex_label) = tex_label { - let label_rect = Rect::new(x1, y1 - 24, w.min(150), 24); - canvas.copy(&tex_label, None, Some(label_rect)).ok(); + if w > 30 && h > 10 { + if let Some(ref f) = font { + let label = + format!("{} {:.0}%", det.class_name, det.confidence * 100.0); + if let Ok(surface) = + f.render(&label).solid(sdl2::pixels::Color::RGB(0, 255, 0)) + { + if let Ok(tex_label) = + texture_creator.create_texture_from_surface(&surface) + { + let lw = surface.width().min(w as u32); + let label_rect = Rect::new(x1, y1.saturating_sub(20), lw, 18); + canvas.copy(&tex_label, None, Some(label_rect)).ok(); + } } } } @@ -330,19 +334,19 @@ fn run(config: &Config) -> Result<()> { .render(&text) .blended(sdl2::pixels::Color::RGBA(255, 255, 255, 255)) { - let tex_label = - texture_creator.create_texture_from_surface(&surface).ok(); - if let Some(tex_label) = tex_label { + if let Ok(tex_label) = + texture_creator.create_texture_from_surface(&surface) + { let query = tex_label.query(); let x = (config.width - query.width) / 2; - let y = config.height - query.height - 40; + let y = config.height - query.height - 20; let rect = Rect::new(x as i32, y as i32, query.width, query.height); - canvas.set_draw_color(sdl2::pixels::Color::RGBA(0, 0, 0, 180)); + canvas.set_draw_color(sdl2::pixels::Color::RGBA(0, 0, 0, 200)); let _ = canvas.fill_rect(Rect::new( - rect.x() - 10, - rect.y() - 5, - rect.width() + 20, - rect.height() + 10, + rect.x() - 8, + rect.y() - 4, + rect.width() + 16, + rect.height() + 8, )); canvas.copy(&tex_label, None, Some(rect)).ok(); } @@ -354,54 +358,40 @@ fn run(config: &Config) -> Result<()> { if let Some(ref f) = font { let time_str = format_time(player_state.current_time_ms); - let frame_str = format!( - "Frame: {}/{} ({:.1}fps)", - player_state.current_frame, player_state.total_frames, player_state.fps + let line1 = format!( + "Time: {} Frame: {}/{} FPS: {:.1}", + time_str, player_state.current_frame, player_state.total_frames, player_state.fps ); - let status_parts = vec![ - format!("Time: {}", time_str), - frame_str, + let line2 = format!( + "[S]ubtitle:{} [Y]OLO:{} [C]hunks [M]ute [+/-]Zoom{:.1}x [`]Reset", if player_state.show_subtitle { - "Subtitle: ON".to_string() + " ON " } else { - String::new() + " OFF" }, if player_state.show_yolo { - "YOLO: ON".to_string() + " ON " } else { - String::new() + " OFF" }, - if player_state.zoom != 1.0 { - format!("Zoom: {:.1}x", player_state.zoom) - } else { - String::new() - }, - ]; + player_state.zoom + ); - let y_offset = 10; - for (i, part) in status_parts.iter().enumerate() { - if !part.is_empty() { - if let Ok(surface) = f - .render(part) - .solid(sdl2::pixels::Color::RGB(200, 200, 200)) - { - let tex_label = texture_creator.create_texture_from_surface(&surface).ok(); - if let Some(tex_label) = tex_label { - let rect = Rect::new( - 10, - y_offset + (i as i32 * 22), - surface.width(), - surface.height(), - ); - canvas.copy(&tex_label, None, Some(rect)).ok(); - } + for (i, line) in [line1, line2].iter().enumerate() { + if let Ok(surface) = f + .render(line) + .solid(sdl2::pixels::Color::RGB(180, 180, 180)) + { + if let Ok(tex_label) = texture_creator.create_texture_from_surface(&surface) { + let rect = + Rect::new(10, 8 + (i as i32 * 20), surface.width(), surface.height()); + canvas.copy(&tex_label, None, Some(rect)).ok(); } } } } canvas.present(); - std::thread::sleep(std::time::Duration::from_millis(16)); } diff --git a/target/release/.fingerprint/momentry_playground-d0e10ec51fcac34b/dep-bin-momentry b/target/release/.fingerprint/momentry_playground-d0e10ec51fcac34b/dep-bin-momentry index ee2dc61..20cec89 100644 Binary files a/target/release/.fingerprint/momentry_playground-d0e10ec51fcac34b/dep-bin-momentry and b/target/release/.fingerprint/momentry_playground-d0e10ec51fcac34b/dep-bin-momentry differ diff --git a/target/release/.fingerprint/momentry_playground-d0e10ec51fcac34b/output-bin-momentry b/target/release/.fingerprint/momentry_playground-d0e10ec51fcac34b/output-bin-momentry index 2222237..169bae9 100644 --- a/target/release/.fingerprint/momentry_playground-d0e10ec51fcac34b/output-bin-momentry +++ b/target/release/.fingerprint/momentry_playground-d0e10ec51fcac34b/output-bin-momentry @@ -2,6 +2,7 @@ {"$message_type":"diagnostic","message":"unused imports: `PlaybackState` and `PlayerState`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/player/mod.rs","byte_start":154,"byte_end":167,"line_start":10,"line_end":10,"column_start":17,"column_end":30,"is_primary":true,"text":[{"text":"pub use state::{PlaybackState, PlayerState};","highlight_start":17,"highlight_end":30}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/player/mod.rs","byte_start":169,"byte_end":180,"line_start":10,"line_end":10,"column_start":32,"column_end":43,"is_primary":true,"text":[{"text":"pub use state::{PlaybackState, PlayerState};","highlight_start":32,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"src/player/mod.rs","byte_start":138,"byte_end":183,"line_start":10,"line_end":11,"column_start":1,"column_end":1,"is_primary":true,"text":[{"text":"pub use state::{PlaybackState, PlayerState};","highlight_start":1,"highlight_end":45},{"text":"pub use video::VideoPlayer;","highlight_start":1,"highlight_end":1}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused imports: `PlaybackState` and `PlayerState`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/player/mod.rs:10:17\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m10\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub use state::{PlaybackState, PlayerState};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^\u001b[0m\n\n"} {"$message_type":"diagnostic","message":"unused import: `video::VideoPlayer`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/player/mod.rs","byte_start":191,"byte_end":209,"line_start":11,"line_end":11,"column_start":9,"column_end":27,"is_primary":true,"text":[{"text":"pub use video::VideoPlayer;","highlight_start":9,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"src/player/mod.rs","byte_start":183,"byte_end":211,"line_start":11,"line_end":11,"column_start":1,"column_end":29,"is_primary":true,"text":[{"text":"pub use video::VideoPlayer;","highlight_start":1,"highlight_end":29}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `video::VideoPlayer`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/player/mod.rs:11:9\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m11\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub use video::VideoPlayer;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^\u001b[0m\n\n"} {"$message_type":"diagnostic","message":"unused import: `bridge::WebBridge`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/web/mod.rs","byte_start":60,"byte_end":77,"line_start":5,"line_end":5,"column_start":9,"column_end":26,"is_primary":true,"text":[{"text":"pub use bridge::WebBridge;","highlight_start":9,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"src/web/mod.rs","byte_start":52,"byte_end":79,"line_start":5,"line_end":5,"column_start":1,"column_end":28,"is_primary":true,"text":[{"text":"pub use bridge::WebBridge;","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `bridge::WebBridge`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/web/mod.rs:5:9\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m5\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub use bridge::WebBridge;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^\u001b[0m\n\n"} +{"$message_type":"diagnostic","message":"unused variable: `font_size`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/main.rs","byte_start":3856,"byte_end":3865,"line_start":124,"line_end":124,"column_start":9,"column_end":18,"is_primary":true,"text":[{"text":" let font_size = 18;","highlight_start":9,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/main.rs","byte_start":3856,"byte_end":3865,"line_start":124,"line_end":124,"column_start":9,"column_end":18,"is_primary":true,"text":[{"text":" let font_size = 18;","highlight_start":9,"highlight_end":18}],"label":null,"suggested_replacement":"_font_size","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused variable: `font_size`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/main.rs:124:9\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m124\u001b[0m \u001b[1m\u001b[94m|\u001b[0m let font_size = 18;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^\u001b[0m \u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_font_size`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default\n\n"} {"$message_type":"diagnostic","message":"fields `language` and `language_probability` are never read","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/overlay/asr.rs","byte_start":286,"byte_end":293,"line_start":15,"line_end":15,"column_start":12,"column_end":19,"is_primary":false,"text":[{"text":"pub struct AsrData {","highlight_start":12,"highlight_end":19}],"label":"fields in this struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/overlay/asr.rs","byte_start":304,"byte_end":312,"line_start":16,"line_end":16,"column_start":9,"column_end":17,"is_primary":true,"text":[{"text":" pub language: Option,","highlight_start":9,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/overlay/asr.rs","byte_start":338,"byte_end":358,"line_start":17,"line_end":17,"column_start":9,"column_end":29,"is_primary":true,"text":[{"text":" pub language_probability: Option,","highlight_start":9,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`AsrData` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"`#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: fields `language` and `language_probability` are never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/overlay/asr.rs:16:9\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m15\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct AsrData {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-------\u001b[0m \u001b[1m\u001b[94mfields in this struct\u001b[0m\n\u001b[1m\u001b[94m16\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub language: Option,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m17\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub language_probability: Option,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `AsrData` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default\n\n"} {"$message_type":"diagnostic","message":"methods `get_all_segments` and `duration` are never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/overlay/asr.rs","byte_start":480,"byte_end":494,"line_start":26,"line_end":26,"column_start":1,"column_end":15,"is_primary":false,"text":[{"text":"impl AsrLoader {","highlight_start":1,"highlight_end":15}],"label":"methods in this implementation","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/overlay/asr.rs","byte_start":1223,"byte_end":1239,"line_start":49,"line_end":49,"column_start":12,"column_end":28,"is_primary":true,"text":[{"text":" pub fn get_all_segments(&self) -> &[AsrSegment] {","highlight_start":12,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/overlay/asr.rs","byte_start":1395,"byte_end":1403,"line_start":57,"line_end":57,"column_start":12,"column_end":20,"is_primary":true,"text":[{"text":" pub fn duration(&self) -> f64 {","highlight_start":12,"highlight_end":20}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: methods `get_all_segments` and `duration` are never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/overlay/asr.rs:49:12\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m26\u001b[0m \u001b[1m\u001b[94m|\u001b[0m impl AsrLoader {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m--------------\u001b[0m \u001b[1m\u001b[94mmethods in this implementation\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m49\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn get_all_segments(&self) -> &[AsrSegment] {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m57\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn duration(&self) -> f64 {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m\n\n"} {"$message_type":"diagnostic","message":"field `class_id` is never read","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/overlay/yolo.rs","byte_start":292,"byte_end":301,"line_start":13,"line_end":13,"column_start":12,"column_end":21,"is_primary":false,"text":[{"text":"pub struct Detection {","highlight_start":12,"highlight_end":21}],"label":"field in this struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/overlay/yolo.rs","byte_start":312,"byte_end":320,"line_start":14,"line_end":14,"column_start":9,"column_end":17,"is_primary":true,"text":[{"text":" pub class_id: u32,","highlight_start":9,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`Detection` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `class_id` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/overlay/yolo.rs:14:9\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m13\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct Detection {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m---------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m14\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub class_id: u32,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `Detection` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis\n\n"} @@ -22,4 +23,4 @@ {"$message_type":"diagnostic","message":"struct `DetectionResponse` is never constructed","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/web/bridge.rs","byte_start":1341,"byte_end":1358,"line_start":67,"line_end":67,"column_start":12,"column_end":29,"is_primary":true,"text":[{"text":"pub struct DetectionResponse {","highlight_start":12,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: struct `DetectionResponse` is never constructed\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/web/bridge.rs:67:12\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m67\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct DetectionResponse {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^\u001b[0m\n\n"} {"$message_type":"diagnostic","message":"struct `WebBridge` is never constructed","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/web/bridge.rs","byte_start":1496,"byte_end":1505,"line_start":76,"line_end":76,"column_start":12,"column_end":21,"is_primary":true,"text":[{"text":"pub struct WebBridge;","highlight_start":12,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: struct `WebBridge` is never constructed\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/web/bridge.rs:76:12\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m76\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct WebBridge;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^\u001b[0m\n\n"} {"$message_type":"diagnostic","message":"associated functions `new`, `encode_message`, `decode_message`, and `encode_response` are never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/web/bridge.rs","byte_start":1508,"byte_end":1522,"line_start":78,"line_end":78,"column_start":1,"column_end":15,"is_primary":false,"text":[{"text":"impl WebBridge {","highlight_start":1,"highlight_end":15}],"label":"associated functions in this implementation","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/web/bridge.rs","byte_start":1536,"byte_end":1539,"line_start":79,"line_end":79,"column_start":12,"column_end":15,"is_primary":true,"text":[{"text":" pub fn new() -> Self {","highlight_start":12,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/web/bridge.rs","byte_start":1583,"byte_end":1597,"line_start":83,"line_end":83,"column_start":12,"column_end":26,"is_primary":true,"text":[{"text":" pub fn encode_message(msg: &BridgeMessage) -> String {","highlight_start":12,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/web/bridge.rs","byte_start":1704,"byte_end":1718,"line_start":87,"line_end":87,"column_start":12,"column_end":26,"is_primary":true,"text":[{"text":" pub fn decode_message(raw: &str) -> Option {","highlight_start":12,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/web/bridge.rs","byte_start":1814,"byte_end":1829,"line_start":91,"line_end":91,"column_start":12,"column_end":27,"is_primary":true,"text":[{"text":" pub fn encode_response(resp: &BridgeResponse) -> String {","highlight_start":12,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: associated functions `new`, `encode_message`, `decode_message`, and `encode_response` are never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/web/bridge.rs:79:12\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m78\u001b[0m \u001b[1m\u001b[94m|\u001b[0m impl WebBridge {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m--------------\u001b[0m \u001b[1m\u001b[94massociated functions in this implementation\u001b[0m\n\u001b[1m\u001b[94m79\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn new() -> Self {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m83\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn encode_message(msg: &BridgeMessage) -> String {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m87\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn decode_message(raw: &str) -> Option {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m91\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn encode_response(resp: &BridgeResponse) -> String {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^\u001b[0m\n\n"} -{"$message_type":"diagnostic","message":"24 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: 24 warnings emitted\u001b[0m\n\n"} +{"$message_type":"diagnostic","message":"25 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: 25 warnings emitted\u001b[0m\n\n"} diff --git a/target/release/deps/momentry-d0e10ec51fcac34b b/target/release/deps/momentry-d0e10ec51fcac34b index 4b4f7ef..cb7b922 100755 Binary files a/target/release/deps/momentry-d0e10ec51fcac34b and b/target/release/deps/momentry-d0e10ec51fcac34b differ diff --git a/target/release/momentry b/target/release/momentry index 4b4f7ef..cb7b922 100755 Binary files a/target/release/momentry and b/target/release/momentry differ