From c2e01467bda6775e0405e9858c75849c68b064d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 30 Sep 2026 15:46:06 +0300 Subject: [PATCH] fix(app): a refused file names the refusal on its library row `engine::decode::probe` answers a stream this machine has no seat for with an `Err` carrying the plugin's own words. `Player::refill` took `engine::decode::probe(&path).ok()`, so the refusal and "a file with no decoder to name" both became a missing map entry -- and a missing entry drew an empty second line, the same line a song draws. A file that cannot be decoded therefore looked exactly like a file that needs no word, and the freeze that followed looked like the end of the film. The map now holds a `Decoder` that can say all three things: asked and not answered, the seat it will open on, or the refusal in the words the decoder used. The row's existing detail line carries it; no second label mechanism, and no change to what import or open does with the file. Witness: `a_refused_file_names_the_refusal_on_its_row` drives the real `engine::decode::probe` -- a `.mkv` that is not a container, refused by the demuxer with no plugin and no hardware -- and asserts the row detail equals the refusal. Red before (the row drew ""), green after, and red again with `Decoder::detail`'s refusal arm reverted, and with `From>` mapping `Err` back to `Pending`. --- crates/app/src/library_meta.rs | 49 ++++++- crates/app/src/main.rs | 19 +-- crates/app/src/player/export.rs | 19 ++- crates/app/src/tests/editing.rs | 237 ++++++++++++++++++++++---------- crates/app/src/tests/mod.rs | 59 ++++---- 5 files changed, 264 insertions(+), 119 deletions(-) diff --git a/crates/app/src/library_meta.rs b/crates/app/src/library_meta.rs index ddbe126..07fc572 100644 --- a/crates/app/src/library_meta.rs +++ b/crates/app/src/library_meta.rs @@ -64,7 +64,7 @@ pub(crate) struct Row { pub(crate) fn library_rows( sources: &[Source], streams: &HashMap>, - decoders: &HashMap, Backend)>>, + decoders: &HashMap, timeline_audio: Option<(u32, u16)>, frames: impl Fn(&Path) -> u32, ) -> Vec { @@ -89,9 +89,7 @@ pub(crate) fn library_rows( detail: join_detail( &decoders .get(&source.path) - .copied() - .flatten() - .map_or_else(String::new, |(codec, backend)| decode_label(codec, backend)), + .map_or_else(|| Decoder::Pending.detail(), Decoder::detail), &info .filter(|_| of_file.len() > 1) .map_or_else(String::new, stream_detail), @@ -196,6 +194,49 @@ pub(crate) fn decode_label(codec: Option, backend: Backend) -> String { } } +/// What the one-shot probe said about a file: the seat it will open on, or -- +/// when the decoder itself refused -- the refusal, in the decoder's own words. +/// +/// Three answers, not two, because "asked" and "refused" are not the same +/// answer. Both used to be a missing entry, and a missing entry drew an empty +/// second line -- the same line a song draws -- so a file this machine cannot +/// decode was indistinguishable from one that needs no word at all. +#[derive(Debug, Clone, PartialEq)] +pub(crate) enum Decoder { + /// Asked and not yet answered: the probe is still walking the file. A + /// real wait, and one that claims nothing while it lasts. + Pending, + /// The codec (`None` for a still, which has no coded stream) and the seat + /// the engine picked for it. + Seat(Option, Backend), + /// The decoder refused this file, and these are its words. Not a message + /// of this program's own making: the probe is `engine::decode::probe`, + /// and the refusal is the one opening the file would give. + Refused(String), +} + +impl From, Backend)>> for Decoder { + fn from(probed: engine::Result<(Option, Backend)>) -> Self { + match probed { + Ok((codec, backend)) => Self::Seat(codec, backend), + Err(why) => Self::Refused(why.to_string()), + } + } +} + +impl Decoder { + /// What the row's second line says about the file's decoder: the seat for + /// a file that opens, the refusal for one that does not, and nothing for a + /// probe still running. + pub(crate) fn detail(&self) -> String { + match self { + Self::Pending => String::new(), + Self::Seat(codec, backend) => decode_label(*codec, *backend), + Self::Refused(why) => why.clone(), + } + } +} + /// How a row names its file: the file alone when it has one audio stream or /// none, and the file plus which stream this row is when it has several -- /// counted from 1, the way a player numbers tracks. diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 0656641..7d91cb8 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -68,11 +68,11 @@ use engine::transform::TransformParams; use engine::{Clip, Codec, ExportHandle, Frame, MediaBitrate, PlaybackSession}; use gpui::{ AnyElement, App, Application, Bounds, ClickEvent, Context, Corners, CursorStyle, Div, - DragMoveEvent, FocusHandle, KeyDownEvent, MouseButton, MouseDownEvent, - MouseExitEvent, MouseMoveEvent, MouseUpEvent, PathBuilder, Pixels, Point, RenderImage, - ScrollDelta, ScrollHandle, ScrollWheelEvent, SharedString, Size, Stateful, TextAlign, - TitlebarOptions, Window, WindowBounds, WindowOptions, canvas, div, point, prelude::*, px, - relative, rgb, rgba, size, + DragMoveEvent, FocusHandle, KeyDownEvent, MouseButton, MouseDownEvent, MouseExitEvent, + MouseMoveEvent, MouseUpEvent, PathBuilder, Pixels, Point, RenderImage, ScrollDelta, + ScrollHandle, ScrollWheelEvent, SharedString, Size, Stateful, TextAlign, TitlebarOptions, + Window, WindowBounds, WindowOptions, canvas, div, point, prelude::*, px, relative, rgb, rgba, + size, }; struct Player { @@ -278,13 +278,14 @@ struct Player { /// must stay in the map or every repaint would ask again. syncs: HashMap>, /// Which decoder each source will run on, probed once at import and kept: - /// the codec (`None` for a still) and the seat the engine picked for it. + /// the codec (`None` for a still) and the seat the engine picked for it -- + /// or, where the decoder refused the file, the refusal in its own words. /// What a library row says *before* anything plays; the running answer is /// the session's own (`PlaybackSession::decode_backend`), which follows a /// fallback this cannot. Filled like `sizes`: presence means "asked", and - /// `None` is a source with no decoder to name -- a song, or one the probe - /// refused -- which must stay in the map or every repaint would ask again. - decoders: HashMap, Backend)>>, + /// `Decoder::Pending` is that asked-but-unanswered window -- which must + /// stay in the map or every repaint would ask again. + decoders: HashMap, /// What an export of the picked settings would open -- the picture's seat /// or the copy that means it opens none, and the sound's -- and what it was /// asked about: the settings, the canvas and the *cuts*, since where they diff --git a/crates/app/src/player/export.rs b/crates/app/src/player/export.rs index 75423f3..c9983ed 100644 --- a/crates/app/src/player/export.rs +++ b/crates/app/src/player/export.rs @@ -180,13 +180,15 @@ impl Player { // a frame of it plays. Off the render thread like the streams above: a // stream the plugin takes costs one VA-API init (~90 ms) to answer. for path in unseen_paths(session.sources(), &self.decoders) { - self.decoders.insert(path.clone(), None); + self.decoders.insert(path.clone(), Decoder::Pending); let probed = cx.background_executor().spawn({ let path = path.clone(); - // A song and a source no decoder here takes are both `None`: - // the row says nothing about them rather than guessing, and - // import refused the second at the door anyway. - async move { engine::decode::probe(&path).ok() } + // A refusal is kept in the decoder's own words, and the row + // shows them: a file this machine cannot decode is the one + // whose second line has to say so. A song is a different + // answer entirely -- it has no coded stream, and the probe + // says so by naming the still seat. + async move { Decoder::from(engine::decode::probe(&path)) } }); cx.spawn(async move |this, cx| { let probed = probed.await; @@ -644,7 +646,12 @@ impl Player { /// /// Escape retreats one step at a time (DESIGN.md:146): the field first, /// the moment second. - pub(crate) fn export_moment_key(&mut self, key: &str, shift: bool, cx: &mut Context) -> bool { + pub(crate) fn export_moment_key( + &mut self, + key: &str, + shift: bool, + cx: &mut Context, + ) -> bool { if !self.export_open { return false; } diff --git a/crates/app/src/tests/editing.rs b/crates/app/src/tests/editing.rs index ce1ecf6..ba71a0c 100644 --- a/crates/app/src/tests/editing.rs +++ b/crates/app/src/tests/editing.rs @@ -109,9 +109,11 @@ fn a_song_opens_the_window_by_itself() { // ...and it places, on the audio lane, through the door `insert_source` // uses: a second copy of the song at the playhead. session.seek(1.0); - assert!(session - .place_stream_at(1.0, &path, 0, Some(Lane::A1)) - .expect("its own file is on this timeline")); + assert!( + session + .place_stream_at(1.0, &path, 0, Some(Lane::A1)) + .expect("its own file is on this timeline") + ); assert_eq!(session.lane_clips(Lane::A1).len(), 2); assert!(session.lane_clips(Lane::V1).is_empty(), "still no picture"); @@ -256,6 +258,63 @@ fn every_audio_stream_of_a_file_is_a_row_usable_or_not() { assert_eq!(rows[1].tint, 1, "the other file is the other tint"); } +/// A file the decoder refuses says so on its own row, in the decoder's own +/// words. The refusal is the only thing a person can act on for a file that +/// will not play, and before this the row drew an empty second line -- the +/// same line a song draws, which claims nothing and means nothing. +/// +/// Dumped through the real [`engine::decode::probe`], not a hand-written +/// `Err`: a `.mkv` that is not a container is refused by the demuxer, with no +/// plugin and no hardware involved, so the words under test are the ones the +/// engine really produces. +#[test] +fn a_refused_file_names_the_refusal_on_its_row() { + let junk = std::env::temp_dir().join("edith-lane-j-refused.mkv"); + std::fs::write(&junk, b"not a container, and never will be").expect("write the junk file"); + let words = engine::decode::probe(&junk) + .expect_err("a file that is not a stream is refused") + .to_string(); + assert!( + !words.is_empty(), + "a refusal that says nothing says nothing" + ); + + let mut decoders = HashMap::new(); + decoders.insert(junk.clone(), Decoder::from(engine::decode::probe(&junk))); + let rows = library_rows( + &[Source { + path: junk.clone(), + audio_stream: 0, + }], + &HashMap::new(), + &decoders, + None, + |_| 0, + ); + assert_eq!( + rows[0].detail, words, + "the row carries the refusal verbatim" + ); + + // A probe still running says nothing, and must keep saying nothing: an + // empty second line is a real answer here, not a missing one. + let mut pending = HashMap::new(); + pending.insert(junk.clone(), Decoder::Pending); + let rows = library_rows( + &[Source { + path: junk.clone(), + audio_stream: 0, + }], + &HashMap::new(), + &pending, + None, + |_| 0, + ); + assert_eq!(rows[0].detail, "", "an unasked decoder claims nothing"); + + std::fs::remove_file(&junk).ok(); +} + /// What the clip menu offers, and where it hangs. The two items that act on /// the playhead rather than on the clicked clip are the ones that can be /// inapplicable, and a menu at the edge of the window has to come back inside @@ -343,11 +402,13 @@ fn a_caption_is_deleted_by_the_same_row_and_stroke_every_box_is() { ); // ...and the same reading with a clip under it is the clip menu, untouched: // the flag is off wherever a `Clip` was clicked. - assert!(menu_items(Ctx { - timeline: true, - ..Ctx::default() - }) - .contains(&ActionId::Cut)); + assert!( + menu_items(Ctx { + timeline: true, + ..Ctx::default() + }) + .contains(&ActionId::Cut) + ); } /// A timeline with a subtitle palette and an empty subtitle lane: what a @@ -949,14 +1010,16 @@ fn the_clip_menu_dims_what_the_playhead_is_not_on_and_stays_in_the_window() { } assert!(!whole(ActionId::Delete, live).yes()); assert!(!whole(ActionId::Paste, live).yes()); - assert!(whole( - ActionId::Paste, - Ctx { - clipboard: true, - ..live - } - ) - .yes()); + assert!( + whole( + ActionId::Paste, + Ctx { + clipboard: true, + ..live + } + ) + .yes() + ); assert!(!whole(ActionId::CancelExport, live).yes()); let busy = Ctx { exporting: true, @@ -1176,14 +1239,16 @@ fn a_menu_offers_only_what_applies_and_is_drawn_inside_the_window() { assert!(row_enable(RowItem::RemoveWithClips, placed).yes()); let unplaced = row_items(live); assert!(unplaced.contains(&RowItem::Remove) && !unplaced.contains(&RowItem::RemoveWithClips)); - assert!(!row_enable( - RowItem::RemoveWithClips, - RowCtx { - exporting: true, - ..placed - } - ) - .yes()); + assert!( + !row_enable( + RowItem::RemoveWithClips, + RowCtx { + exporting: true, + ..placed + } + ) + .yes() + ); assert!(!row_enable(RowItem::Add, RowCtx::default()).yes()); // Every refusal is short enough to sit in the hint column beside its // label, the clip menu's rule. @@ -1617,9 +1682,11 @@ fn adding_a_row_drops_the_whole_source_in_at_the_playhead() { let frames = session.file_frames(&second); // Through the engine door `insert_source` uses, with the row's own // stream: the button, the drop and this are one call. - assert!(session - .place_stream_at(2.0, &second, 0, None) - .expect("av2 is already on the timeline")); + assert!( + session + .place_stream_at(2.0, &second, 0, None) + .expect("av2 is already on the timeline") + ); // The whole of source 1 went in and nothing was painted over: the // timeline is longer by exactly that file. assert_eq!(session.timeline_duration(), 9.0); @@ -1646,9 +1713,11 @@ fn adding_a_row_drops_the_whole_source_in_at_the_playhead() { let path = session.sources()[0].path.clone(); let frames = session.file_frames(&path); let end = session.timeline_duration(); - assert!(session - .place_stream_at(end, &path, 1, None) - .expect("the French track shares the timeline's parameters")); + assert!( + session + .place_stream_at(end, &path, 1, None) + .expect("the French track shares the timeline's parameters") + ); assert_eq!(session.sources()[1].audio_stream, 1); assert_eq!(session.timeline_duration(), end * 2.0); // Both rows are the same file, so both rows are that file's length -- @@ -1698,9 +1767,11 @@ fn a_row_dropped_on_the_open_bed_lands_under_the_pointer() { // ...and what the release does with it: the frame back through the same // rate every box is drawn at, into the door the Add button uses too. - assert!(session - .place_stream_at(f64::from(at) / fps, &second, 0, None) - .expect("av2 is already on this timeline")); + assert!( + session + .place_stream_at(f64::from(at) / fps, &second, 0, None) + .expect("av2 is already on this timeline") + ); let head = |lane| { session .lane_clips(lane) @@ -1734,9 +1805,11 @@ fn removing_a_row_is_refused_while_it_plays_and_takes_the_row_away() { session.import(&asset("test_av2.mp4")).expect("av2 matches"); let second = session.sources()[1].path.clone(); let end = session.timeline_duration(); - assert!(session - .place_stream_at(end, &second, 0, None) - .expect("a file just imported is on this timeline")); + assert!( + session + .place_stream_at(end, &second, 0, None) + .expect("a file just imported is on this timeline") + ); let streams = HashMap::new(); let rows = |session: &PlaybackSession| { library_rows(session.sources(), &streams, &HashMap::new(), None, |_| 0).len() @@ -1957,7 +2030,7 @@ fn trim_to_playhead_moves_the_selected_clips_edge_and_undoes_in_one_step() { /// it makes. #[test] fn the_windows_settings_caches_follow_the_session_across_undo_and_redo() { - use crate::player::actions::{history_step, HistoryBefore, SessionCaches}; + use crate::player::actions::{HistoryBefore, SessionCaches, history_step}; let mut session = PlaybackSession::open(asset("test_av.mp4")).expect("open the fixture"); session.set_gain(0.0); @@ -2037,7 +2110,7 @@ fn the_windows_settings_caches_follow_the_session_across_undo_and_redo() { /// keyed by where a cue sits -- but because the step moves the cues under it. #[test] fn the_subtitle_pick_follows_its_track_across_an_undo_of_a_removal() { - use crate::player::actions::{history_step, HistoryBefore, SessionCaches}; + use crate::player::actions::{HistoryBefore, SessionCaches, history_step}; let mut session = PlaybackSession::open(asset("test_av.mp4")).expect("open the fixture"); session.set_gain(0.0); @@ -2268,9 +2341,11 @@ fn a_track_can_be_added_dropped_on_edited_and_taken_back() { // A library row let go over that row: the same door the Add button // uses, told which lane it was let go over. let path = session.sources()[0].path.clone(); - assert!(session - .place_stream_at(1.0, &path, 0, Some(v2)) - .expect("its own file is on this timeline")); + assert!( + session + .place_stream_at(1.0, &path, 0, Some(v2)) + .expect("its own file is on this timeline") + ); assert_eq!(session.lane_clips(v2).len(), 1, "the drop landed on V2"); assert_eq!(session.lane_clips(v2)[0].start, 30, "at the playhead"); // ...with the sound it came with, on the row of its own the drop added: @@ -2357,18 +2432,22 @@ fn a_selection_drag_moves_every_pick_by_the_same_delta() { // clip0 on V1 at the fixture's own start; clip1 on V1 ten seconds in, // appended to the open bed and rippling nothing. - assert!(session - .place_stream_at(10.0, &second, 0, None) - .expect("av2 is on this timeline")); + assert!( + session + .place_stream_at(10.0, &second, 0, None) + .expect("av2 is on this timeline") + ); let clip0 = session.lane_clips(Lane::V1)[0]; let clip1 = session.lane_clips(Lane::V1)[1]; assert_eq!((clip0.start, clip1.start), (0, 300)); // clipC on a second video row, well past both of the above. let v2 = session.add_lane(LaneKind::Video); - assert!(session - .place_stream_at(20.0, &path, 0, Some(v2)) - .expect("test_av.mp4 is on this timeline")); + assert!( + session + .place_stream_at(20.0, &path, 0, Some(v2)) + .expect("test_av.mp4 is on this timeline") + ); let clip_c = session.lane_clips(v2)[0]; assert_eq!(clip_c.start, 600); @@ -2421,22 +2500,28 @@ fn a_selection_drag_refuses_as_one_set_when_any_pick_cannot_land() { session.import(&asset("test_av2.mp4")).expect("av2 matches"); let second = session.sources()[1].path.clone(); - assert!(session - .place_stream_at(10.0, &second, 0, None) - .expect("av2 is on this timeline")); + assert!( + session + .place_stream_at(10.0, &second, 0, None) + .expect("av2 is on this timeline") + ); let clip0 = session.lane_clips(Lane::V1)[0]; let clip1 = session.lane_clips(Lane::V1)[1]; let v2 = session.add_lane(LaneKind::Video); - assert!(session - .place_stream_at(0.0, &path, 0, Some(v2)) - .expect("test_av.mp4 is on this timeline")); + assert!( + session + .place_stream_at(0.0, &path, 0, Some(v2)) + .expect("test_av.mp4 is on this timeline") + ); let clip_c = session.lane_clips(v2)[0]; // A clip clip1 is not picked, blocking the road on V2 the drag is about // to try: clip1 dragged onto V2 lands its head inside this one. - assert!(session - .place_stream_at(10.0, &second, 0, Some(v2)) - .expect("av2 is on this timeline")); + assert!( + session + .place_stream_at(10.0, &second, 0, Some(v2)) + .expect("av2 is on this timeline") + ); let blocker = session.lane_clips(v2)[1]; assert_eq!(blocker.start, 300); @@ -2491,16 +2576,20 @@ fn a_three_pick_copy_paste_preserves_gaps_and_lane_assignment() { session.import(&asset("test_av2.mp4")).expect("av2 matches"); let second = session.sources()[1].path.clone(); - assert!(session - .place_stream_at(10.0, &second, 0, None) - .expect("av2 is on this timeline")); + assert!( + session + .place_stream_at(10.0, &second, 0, None) + .expect("av2 is on this timeline") + ); let clip0 = session.lane_clips(Lane::V1)[0]; let clip1 = session.lane_clips(Lane::V1)[1]; let v2 = session.add_lane(LaneKind::Video); - assert!(session - .place_stream_at(20.0, &path, 0, Some(v2)) - .expect("test_av.mp4 is on this timeline")); + assert!( + session + .place_stream_at(20.0, &path, 0, Some(v2)) + .expect("test_av.mp4 is on this timeline") + ); let clip_c = session.lane_clips(v2)[0]; // Copied in click order, out of the lanes each was clicked in -- exactly @@ -2548,16 +2637,20 @@ fn a_colliding_set_paste_refuses_whole() { session.import(&asset("test_av2.mp4")).expect("av2 matches"); let second = session.sources()[1].path.clone(); - assert!(session - .place_stream_at(10.0, &second, 0, None) - .expect("av2 is on this timeline")); + assert!( + session + .place_stream_at(10.0, &second, 0, None) + .expect("av2 is on this timeline") + ); let clip0 = session.lane_clips(Lane::V1)[0]; let clip1 = session.lane_clips(Lane::V1)[1]; let v2 = session.add_lane(LaneKind::Video); - assert!(session - .place_stream_at(20.0, &path, 0, Some(v2)) - .expect("test_av.mp4 is on this timeline")); + assert!( + session + .place_stream_at(20.0, &path, 0, Some(v2)) + .expect("test_av.mp4 is on this timeline") + ); let clip_c = session.lane_clips(v2)[0]; let items = [(Lane::V1, clip0), (Lane::V1, clip1), (v2, clip_c)]; @@ -2612,9 +2705,11 @@ fn a_grouped_clip_on_an_added_lane_closes_its_hole_with_its_caption() { let (mut session, sub_lane) = with_subtitle_lane(); let v2 = session.add_lane(LaneKind::Video); let path = session.sources()[0].path.clone(); - assert!(session - .place_stream_at(0.0, &path, 0, Some(v2)) - .expect("its own file is on this timeline")); + assert!( + session + .place_stream_at(0.0, &path, 0, Some(v2)) + .expect("its own file is on this timeline") + ); session .place_sub(sub_lane, 0, one_second(0)) .expect("the caption goes down"); diff --git a/crates/app/src/tests/mod.rs b/crates/app/src/tests/mod.rs index ce51f9e..8661872 100644 --- a/crates/app/src/tests/mod.rs +++ b/crates/app/src/tests/mod.rs @@ -10,55 +10,56 @@ mod media; mod view; use super::{ - active_lane, auto_bps, band_label, bitrate_detail, clipboard_after_remove, color_snap, - containers, destructive, enable, enable_lane, envelope, eq_card_w, eq_freq, eq_freq_label, - eq_graph_h, eq_spectrum, eq_x, eq_y, estimated_bytes, export_path, export_settings, - format_refusal, fps_choices, fps_label, frac_along, frac_down, frame_at, frame_rate_ladder, - histogram, inserted_band, is_project, keymap, keys_rows, keys_rows_matching, lane_items, - lanes_h, marked, menu_at, menu_items, menu_rows_h, next_container, normalise, nothing_to_play, - notice_tone, panel_h, parse_budget, project_path, proxies_to_start, push_notice, px_below, - range_word, rate_label, retarget, row_enable, row_items, scrub_due, secs_label, should_resync, + ACCENT_PRIMARY, AUDIO_KBPS, BENCH_ITEMS, BG_RAISED, BPS_COARSE, BPS_FINE, BPS_MAX, BPS_MIN, + COLOR_BANDS, COLOR_BAR_W, COLOR_STEP, COLOR_W, CONTROL_H, Clip, ColorEdit, Ctx, + DEFAULT_AUDIO_KBPS, Decoder, EQ_BANDS_MAX, EQ_CURVE_STEPS, EQ_FFT, EQ_FREQ_HIGH, EQ_FREQ_LOW, + EQ_FREQ_STEP, EQ_GAIN_LIMIT, EQ_GRAPH_H, EQ_HANDLE, EQ_Q_HIGH, EQ_Q_LOW, EQ_Q_STEP, + EQ_SPECTRUM_DB, EQ_TICKS, EQ_W_MAX, ESCAPE, EXPORT_DONE, EXPORT_MOMENT_H, Enable, EncoderSeat, + FORMATS, Format, HEADER_H, HIST_BINS, HIST_H, HIST_SAMPLES, HIT_MIN, KEYS_ROW_H, KEYS_W, + KeyRow, LABEL_H, LANE_H, LANES_MAX, LATE_RESYNC, LIBRARY_MAX_W, LIBRARY_MIN_W, Lane, MB_FLOOR, + MENU_ITEMS, MENU_PAD, MENU_ROW_H, MENU_W, NO_FILE, NOTICES_MAX, NumberEdit, OVERLAID, PANEL_H, + RESYNC_GAP, ROW_ITEMS, RULER_HIT_H, RowCtx, RowItem, SCROLL_NOTCH_SHARE, SILENCE_ROWS, + SOURCE_TINTS, SPEED_PRESETS, SPEED_STEP, STATUS_ERROR, STATUS_SUCCESS, STATUS_WARNING, + SUB_PLAN_CHARS, Source, Speed, StreamInfo, SubPickKey, TIMELINE_SHARE, Transport, VOLUME_W, + VizSlot, Volume, WAVE_BPS, WAVE_COL, WAVE_COLS_MAX, Wave, ZOOM_MIN_FRAMES, active_lane, + auto_bps, band_label, bitrate_detail, clipboard_after_remove, color_snap, containers, + destructive, enable, enable_lane, envelope, eq_card_w, eq_freq, eq_freq_label, eq_graph_h, + eq_spectrum, eq_x, eq_y, estimated_bytes, export_path, export_settings, format_refusal, + fps_choices, fps_label, frac_along, frac_down, frame_at, frame_rate_ladder, histogram, + inserted_band, is_project, keymap, keys_rows, keys_rows_matching, lane_items, lanes_h, marked, + menu_at, menu_items, menu_rows_h, next_container, normalise, nothing_to_play, notice_tone, + panel_h, parse_budget, project_path, proxies_to_start, push_notice, px_below, range_word, + rate_label, retarget, row_enable, row_items, scrub_due, secs_label, should_resync, silence_rate, size_label, snap_cue, snap_marks, snapped, source_tint, span_partner, speed_at, sub_pick_after_removal, sub_pick_after_restore, subtitle_plan, timecode, timeline_fixed_h, tip_may_paint, transport, typed, unseen_paths, unseen_sources, viz_held_paint, whole_take, - window_title, Clip, ColorEdit, Ctx, Enable, EncoderSeat, Format, KeyRow, Lane, NumberEdit, - RowCtx, RowItem, Source, Speed, StreamInfo, SubPickKey, Transport, VizSlot, Volume, Wave, - ACCENT_PRIMARY, AUDIO_KBPS, BENCH_ITEMS, BG_RAISED, BPS_COARSE, BPS_FINE, BPS_MAX, BPS_MIN, - COLOR_BANDS, COLOR_BAR_W, COLOR_STEP, COLOR_W, CONTROL_H, DEFAULT_AUDIO_KBPS, EQ_BANDS_MAX, - EQ_CURVE_STEPS, EQ_FFT, EQ_FREQ_HIGH, EQ_FREQ_LOW, EQ_FREQ_STEP, EQ_GAIN_LIMIT, EQ_GRAPH_H, - EQ_HANDLE, EQ_Q_HIGH, EQ_Q_LOW, EQ_Q_STEP, EQ_SPECTRUM_DB, EQ_TICKS, EQ_W_MAX, ESCAPE, - EXPORT_DONE, EXPORT_MOMENT_H, FORMATS, HEADER_H, HIST_BINS, HIST_H, HIST_SAMPLES, HIT_MIN, - KEYS_ROW_H, KEYS_W, LABEL_H, LANES_MAX, LANE_H, LATE_RESYNC, LIBRARY_MAX_W, LIBRARY_MIN_W, - MB_FLOOR, MENU_ITEMS, MENU_PAD, MENU_ROW_H, MENU_W, NOTICES_MAX, NO_FILE, OVERLAID, PANEL_H, - RESYNC_GAP, ROW_ITEMS, RULER_HIT_H, SCROLL_NOTCH_SHARE, SILENCE_ROWS, SOURCE_TINTS, - SPEED_PRESETS, SPEED_STEP, STATUS_ERROR, STATUS_SUCCESS, STATUS_WARNING, SUB_PLAN_CHARS, - TIMELINE_SHARE, VOLUME_W, WAVE_BPS, WAVE_COL, WAVE_COLS_MAX, ZOOM_MIN_FRAMES, + window_title, }; use super::{ - arrival, audio_rate_choices, av1_hw_warning, clip_width, clock, encoder_choices, encoder_label, + ActionId, Choice, EDGE_W, ETA_SPAN, Edge, FITS, FRAME_RATES, IMPORT_STALL, Import, ImportStage, + Landing, LaneKind, PPS_DEFAULT, PPS_MIN, Preset, RESOLUTIONS, Repeat, SAMPLE_RATES, SEEK_STALL, + Scale, ScanKey, ScanPlan, SilenceScan, SubClip, View, ZOOM_OUT_MARGIN, ZOOM_STEP, arrival, + audio_rate_choices, av1_hw_warning, clip_width, clock, encoder_choices, encoder_label, eta_secs, file_name, file_uri, fit_choices, frames_of_us, full_scan_key, import_line, landing, lane_refuses, launch_queue, library_rows, live_idx, next_fit, next_resolution, note_progress, pending_fps_choices, pending_resolution_choices, px_along, read_ahead, repeats, resolution_choices, resolution_ladder, sample_rate_choices, scan_plan, seek_line, silence_cached, silence_line, slice_whole_levels, source_secs, stash_or_write, tone_choices, - tone_label, trimmed_clip, trimmed_sub, trims, unscannable, unusable, ActionId, Choice, Edge, - Import, ImportStage, Landing, LaneKind, Preset, Repeat, Scale, ScanKey, ScanPlan, SilenceScan, - SubClip, View, EDGE_W, ETA_SPAN, FITS, FRAME_RATES, IMPORT_STALL, PPS_DEFAULT, PPS_MIN, - RESOLUTIONS, SAMPLE_RATES, SEEK_STALL, ZOOM_OUT_MARGIN, ZOOM_STEP, + tone_label, trimmed_clip, trimmed_sub, trims, unscannable, unusable, }; use super::{ - carries_subtitles, cue_box, cues_at, file_tint, is_subtitle, lang_human, sub_bottom, - sub_pick_name, subtitle_detail, subtitle_notice, subtitle_rows, subtitle_tail, - subtitle_toggle_notice, walk_subtitles, Subs, SUB_BOTTOM, SUB_CUE_MIN_W, SUB_LINE_H, SUB_TEXT, + SUB_BOTTOM, SUB_CUE_MIN_W, SUB_LINE_H, SUB_TEXT, Subs, carries_subtitles, cue_box, cues_at, + file_tint, is_subtitle, lang_human, sub_bottom, sub_pick_name, subtitle_detail, + subtitle_notice, subtitle_rows, subtitle_tail, subtitle_toggle_notice, walk_subtitles, }; use engine::PlaybackSession; use engine::scale::FitPolicy; -use gpui::{point, px, size, Bounds, Pixels}; +use gpui::{Bounds, Pixels, point, px, size}; use std::collections::HashMap;