Stable envelope height, full hue/sat, strands and glow
Browse files at this commit7ebfc448b47be34f9de8364967e1cee4a15c244fParent: 92b906f- feat
- stable envelope height, full hue/sat, strands and glow
23 changed files +426 -158
- crates/app/src/player/library.rs +31 -2
- crates/app/src/tests/cards.rs +1 -0
- crates/app/src/tests/editing.rs +4 -0
- crates/app/src/tests/layout.rs +2 -0
- crates/app/src/tests/view.rs +1 -0
- crates/app/src/timeline_math.rs +1 -0
- crates/app/src/ui/dock_stance.rs +159 -90
- crates/engine/examples/bench.rs +1 -0
- crates/engine/src/decode.rs +82 -13
- crates/engine/src/edith.rs +72 -49
- crates/engine/src/export.rs +7 -1
- crates/engine/src/playback.rs +9 -0
- crates/engine/src/project.rs +32 -3
- crates/engine/src/proxy.rs +1 -0
- crates/engine/src/silence.rs +1 -0
- crates/engine/src/sweep.rs +1 -0
- crates/engine/tests/audio_export.rs +11 -0
- crates/engine/tests/audio_files.rs +1 -0
- crates/engine/tests/eq_audio.rs +1 -0
- crates/engine/tests/export.rs +2 -0
- crates/engine/tests/lanes.rs +2 -0
- crates/engine/tests/opus_export.rs +2 -0
- crates/engine/tests/silence.rs +2 -0
crates/app/src/player/library.rsmodified+31 -2
| @@ -223,7 +223,36 @@ impl Player { | ||
| 223 | 223 | cx.notify(); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | + pub(crate) fn viz_paint(&self) -> u32 { | |
| 227 | + self.selected | |
| 228 | + .anchor() | |
| 229 | + .and_then(|(lane, idx)| { | |
| 230 | + self.session | |
| 231 | + .as_ref()? | |
| 232 | + .lane_clips(lane) | |
| 233 | + .get(idx) | |
| 234 | + .map(|c| c.viz_paint) | |
| 235 | + }) | |
| 236 | + .unwrap_or(0) | |
| 237 | + } | |
| 238 | + | |
| 226 | 239 | pub(crate) fn set_viz_hue(&mut self, hue: u8, cx: &mut Context<Self>) { |
| 240 | + self.set_viz_paint_with(cx, |p| engine::decode::with_viz_paint_hue(p, hue)); | |
| 241 | + } | |
| 242 | + | |
| 243 | + pub(crate) fn set_viz_sat(&mut self, sat: u8, cx: &mut Context<Self>) { | |
| 244 | + self.set_viz_paint_with(cx, |p| engine::decode::with_viz_paint_sat(p, sat)); | |
| 245 | + } | |
| 246 | + | |
| 247 | + pub(crate) fn set_viz_strands(&mut self, n: u8, cx: &mut Context<Self>) { | |
| 248 | + self.set_viz_paint_with(cx, |p| engine::decode::with_viz_paint_strands(p, n)); | |
| 249 | + } | |
| 250 | + | |
| 251 | + pub(crate) fn set_viz_glow(&mut self, n: u8, cx: &mut Context<Self>) { | |
| 252 | + self.set_viz_paint_with(cx, |p| engine::decode::with_viz_paint_glow(p, n)); | |
| 253 | + } | |
| 254 | + | |
| 255 | + fn set_viz_paint_with(&mut self, cx: &mut Context<Self>, f: impl FnOnce(u32) -> u32) { | |
| 227 | 256 | let Some((lane, idx)) = self.selected.anchor() else { |
| 228 | 257 | return; |
| 229 | 258 | }; |
| @@ -236,8 +265,8 @@ impl Player { | ||
| 236 | 265 | if clip.visualizer & 1 == 0 { |
| 237 | 266 | return; |
| 238 | 267 | } |
| 239 | - let next = engine::decode::with_viz_hue(clip.visualizer, hue); | |
| 240 | - if next != clip.visualizer && session.set_visualizer(lane, idx, next) { | |
| 268 | + let next = f(clip.viz_paint); | |
| 269 | + if next != clip.viz_paint && session.set_viz_paint(lane, idx, next) { | |
| 241 | 270 | self.reset_after_reseek(); |
| 242 | 271 | } |
| 243 | 272 | cx.notify(); |
crates/app/src/tests/cards.rsmodified+1 -0
| @@ -1383,6 +1383,7 @@ fn a_duration_row_shows_only_for_a_transition_and_its_room_is_the_successors() { | ||
| 1383 | 1383 | fade_out, |
| 1384 | 1384 | transition_out, |
| 1385 | 1385 | visualizer: 0, |
| 1386 | + viz_paint: 0, | |
| 1386 | 1387 | } |
| 1387 | 1388 | } |
| 1388 | 1389 | // A plain cut carries neither field, so the row has nothing to show. |
crates/app/src/tests/editing.rsmodified+4 -0
| @@ -631,6 +631,7 @@ fn the_clip_menu_dims_what_the_playhead_is_not_on_and_stays_in_the_window() { | ||
| 631 | 631 | fade_out: 0, |
| 632 | 632 | transition_out: 0, |
| 633 | 633 | visualizer: 0, |
| 634 | + viz_paint: 0, | |
| 634 | 635 | start: 30, |
| 635 | 636 | in_frame: 0, |
| 636 | 637 | out_frame: 60, |
| @@ -1066,6 +1067,7 @@ fn a_menu_offers_only_what_applies_and_is_drawn_inside_the_window() { | ||
| 1066 | 1067 | fade_out: 0, |
| 1067 | 1068 | transition_out: 0, |
| 1068 | 1069 | visualizer: 0, |
| 1070 | + viz_paint: 0, | |
| 1069 | 1071 | start: 30, |
| 1070 | 1072 | in_frame: 0, |
| 1071 | 1073 | out_frame: 60, |
| @@ -1798,6 +1800,7 @@ fn a_copied_clip_is_renumbered_or_dropped_when_a_row_leaves_the_library() { | ||
| 1798 | 1800 | fade_out: 0, |
| 1799 | 1801 | transition_out: 0, |
| 1800 | 1802 | visualizer: 0, |
| 1803 | + viz_paint: 0, | |
| 1801 | 1804 | start: 0, |
| 1802 | 1805 | in_frame: 0, |
| 1803 | 1806 | out_frame: 30, |
| @@ -1951,6 +1954,7 @@ fn trim_to_playhead_needs_a_subject_cut_with_the_playhead_on_it() { | ||
| 1951 | 1954 | fade_out: 0, |
| 1952 | 1955 | transition_out: 0, |
| 1953 | 1956 | visualizer: 0, |
| 1957 | + viz_paint: 0, | |
| 1954 | 1958 | start: 100, |
| 1955 | 1959 | in_frame: 0, |
| 1956 | 1960 | out_frame: 60, |
crates/app/src/tests/layout.rsmodified+2 -0
| @@ -747,6 +747,7 @@ fn a_drop_moves_the_clip_that_was_picked_up_not_its_old_index() { | ||
| 747 | 747 | fade_out: 0, |
| 748 | 748 | transition_out: 0, |
| 749 | 749 | visualizer: 0, |
| 750 | + viz_paint: 0, | |
| 750 | 751 | start, |
| 751 | 752 | in_frame: 0, |
| 752 | 753 | out_frame: 30, |
| @@ -3565,6 +3566,7 @@ fn the_cut_readout_counts_from_the_playhead() { | ||
| 3565 | 3566 | fade_out: 0, |
| 3566 | 3567 | transition_out: 0, |
| 3567 | 3568 | visualizer: 0, |
| 3569 | + viz_paint: 0, | |
| 3568 | 3570 | start, |
| 3569 | 3571 | in_frame: 0, |
| 3570 | 3572 | out_frame: len, |
crates/app/src/tests/view.rsmodified+1 -0
| @@ -158,6 +158,7 @@ fn the_marks_are_every_lane_the_playhead_and_the_start() { | ||
| 158 | 158 | fade_out: 0, |
| 159 | 159 | transition_out: 0, |
| 160 | 160 | visualizer: 0, |
| 161 | + viz_paint: 0, | |
| 161 | 162 | start, |
| 162 | 163 | in_frame: 0, |
| 163 | 164 | out_frame: frames, |
crates/app/src/timeline_math.rsmodified+1 -0
| @@ -889,6 +889,7 @@ mod drop_landing_tests { | ||
| 889 | 889 | fade_out: 0, |
| 890 | 890 | transition_out: 0, |
| 891 | 891 | visualizer: 0, |
| 892 | + viz_paint: 0, | |
| 892 | 893 | start, |
| 893 | 894 | in_frame: 0, |
| 894 | 895 | out_frame: frames, |
crates/app/src/ui/dock_stance.rsmodified+159 -90
| @@ -189,7 +189,7 @@ fn dock_tab( | ||
| 189 | 189 | .children(hitmap::control(id, label_text, true)) |
| 190 | 190 | .child( |
| 191 | 191 | div() |
| 192 | - .font(style.font) | |
| 192 | + .font(style.font.clone()) | |
| 193 | 193 | .text_size(style.size) |
| 194 | 194 | .text_color(rgb(if active { INK1() } else { INK3() })) |
| 195 | 195 | .child(label_text), |
| @@ -201,7 +201,7 @@ fn section_head(text: impl Into<SharedString>) -> impl IntoElement { | ||
| 201 | 201 | let style = head(); |
| 202 | 202 | div() |
| 203 | 203 | .flex_none() |
| 204 | - .font(style.font) | |
| 204 | + .font(style.font.clone()) | |
| 205 | 205 | .text_size(style.size) |
| 206 | 206 | .text_color(rgb(INK3())) |
| 207 | 207 | .child(text.into()) |
| @@ -449,7 +449,7 @@ fn source_row( | ||
| 449 | 449 | // usage moved down to the metadata line. |
| 450 | 450 | .min_w(relative(0.6)) |
| 451 | 451 | .truncate() |
| 452 | - .font(style.font) | |
| 452 | + .font(style.font.clone()) | |
| 453 | 453 | .text_size(style.size) |
| 454 | 454 | .text_color(rgb(INK1())) |
| 455 | 455 | .child(name) |
| @@ -526,7 +526,7 @@ fn source_row( | ||
| 526 | 526 | div() |
| 527 | 527 | .pl(px(14.)) |
| 528 | 528 | .truncate() |
| 529 | - .font(style.font) | |
| 529 | + .font(style.font.clone()) | |
| 530 | 530 | .text_size(style.size) |
| 531 | 531 | .text_color(rgb(INK3())) |
| 532 | 532 | .child(under) |
| @@ -1022,7 +1022,7 @@ fn sources_tab( | ||
| 1022 | 1022 | .id("dock-filter") |
| 1023 | 1023 | .flex_none() |
| 1024 | 1024 | .cursor_text() |
| 1025 | - .font(style.font) | |
| 1025 | + .font(style.font.clone()) | |
| 1026 | 1026 | .text_size(style.size) |
| 1027 | 1027 | .text_color(rgb(if player.dock_filter_edit { |
| 1028 | 1028 | INK1() |
| @@ -1059,7 +1059,7 @@ fn sources_tab( | ||
| 1059 | 1059 | let style = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM); |
| 1060 | 1060 | d.child( |
| 1061 | 1061 | div() |
| 1062 | - .font(style.font) | |
| 1062 | + .font(style.font.clone()) | |
| 1063 | 1063 | .text_size(style.size) |
| 1064 | 1064 | .text_color(rgb(INK3())) |
| 1065 | 1065 | // One noun for both empties -- nothing imported and |
| @@ -1187,34 +1187,17 @@ fn transition_row(player: &Player, cx: &mut Context<Player>) -> Option<impl Into | ||
| 1187 | 1187 | /// these onto. Drag-while-playing and every other gesture on a row is |
| 1188 | 1188 | /// whatever that card already does; nothing about the gesture is reimplemented |
| 1189 | 1189 | /// here. |
| 1190 | -const VIZ_HUE_IDS: [&str; 16] = [ | |
| 1191 | - "dock-viz-hue-0", | |
| 1192 | - "dock-viz-hue-1", | |
| 1193 | - "dock-viz-hue-2", | |
| 1194 | - "dock-viz-hue-3", | |
| 1195 | - "dock-viz-hue-4", | |
| 1196 | - "dock-viz-hue-5", | |
| 1197 | - "dock-viz-hue-6", | |
| 1198 | - "dock-viz-hue-7", | |
| 1199 | - "dock-viz-hue-8", | |
| 1200 | - "dock-viz-hue-9", | |
| 1201 | - "dock-viz-hue-10", | |
| 1202 | - "dock-viz-hue-11", | |
| 1203 | - "dock-viz-hue-12", | |
| 1204 | - "dock-viz-hue-13", | |
| 1205 | - "dock-viz-hue-14", | |
| 1206 | - "dock-viz-hue-15", | |
| 1207 | -]; | |
| 1208 | - | |
| 1209 | 1190 | fn viz_style_verbs(player: &Player, cx: &mut Context<Player>) -> impl IntoElement { |
| 1210 | - let flags = player.selected.anchor().and_then(|(lane, idx)| { | |
| 1191 | + let clip = player.selected.anchor().and_then(|(lane, idx)| { | |
| 1211 | 1192 | let session = player.session.as_ref()?; |
| 1212 | 1193 | let clip = session.lane_clips(lane).get(idx)?; |
| 1213 | - (clip.visualizer & 1 != 0).then_some(clip.visualizer) | |
| 1194 | + (clip.visualizer & 1 != 0).then_some(*clip) | |
| 1214 | 1195 | }); |
| 1215 | - let Some(flags) = flags else { | |
| 1196 | + let Some(clip) = clip else { | |
| 1216 | 1197 | return div().id("dock-viz-styles"); |
| 1217 | 1198 | }; |
| 1199 | + let flags = clip.visualizer; | |
| 1200 | + let paint = clip.viz_paint; | |
| 1218 | 1201 | let pick = |id: &'static str, label_text: &'static str, style: u8, on: bool| { |
| 1219 | 1202 | let row = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM); |
| 1220 | 1203 | div() |
| @@ -1250,7 +1233,7 @@ fn viz_style_verbs(player: &Player, cx: &mut Context<Player>) -> impl IntoElemen | ||
| 1250 | 1233 | .items_center() |
| 1251 | 1234 | .cursor_pointer() |
| 1252 | 1235 | .text_color(rgb(if on { INK1() } else { INK3() })) |
| 1253 | - .font(style.font) | |
| 1236 | + .font(style.font.clone()) | |
| 1254 | 1237 | .text_size(style.size) |
| 1255 | 1238 | .children(hitmap::control(id, label_text, true)) |
| 1256 | 1239 | .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { |
| @@ -1299,82 +1282,168 @@ fn viz_style_verbs(player: &Player, cx: &mut Context<Player>) -> impl IntoElemen | ||
| 1299 | 1282 | engine::decode::VIZ_FAST, |
| 1300 | 1283 | flags & engine::decode::VIZ_FAST != 0, |
| 1301 | 1284 | )) |
| 1302 | - .child(viz_hue_row(flags, cx)) | |
| 1285 | + .child(viz_paint_knobs(paint, cx)) | |
| 1303 | 1286 | } |
| 1304 | 1287 | |
| 1305 | -fn viz_hue_row(flags: u8, cx: &mut Context<Player>) -> impl IntoElement { | |
| 1306 | - let hue = engine::decode::viz_hue(flags); | |
| 1307 | - let style = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM); | |
| 1308 | - let step = |id: &'static str, glyph: &'static str, by: i8, cx: &mut Context<Player>| { | |
| 1309 | - div() | |
| 1310 | - .id(id) | |
| 1311 | - .flex() | |
| 1312 | - .w(px(HIT_MIN)) | |
| 1313 | - .h(px(HIT_MIN)) | |
| 1314 | - .items_center() | |
| 1315 | - .justify_center() | |
| 1316 | - .rounded(px(3.)) | |
| 1317 | - .bg(rgb(DARK_RAISED())) | |
| 1318 | - .cursor_pointer() | |
| 1319 | - .children(hitmap::control(id, "Colour", true)) | |
| 1320 | - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { | |
| 1321 | - let cur = this | |
| 1322 | - .selected | |
| 1323 | - .anchor() | |
| 1324 | - .and_then(|(lane, idx)| { | |
| 1325 | - this.session | |
| 1326 | - .as_ref()? | |
| 1327 | - .lane_clips(lane) | |
| 1328 | - .get(idx) | |
| 1329 | - .map(|c| engine::decode::viz_hue(c.visualizer)) | |
| 1330 | - }) | |
| 1331 | - .unwrap_or(0); | |
| 1332 | - this.set_viz_hue((cur as i16 + i16::from(by)).rem_euclid(16) as u8, cx); | |
| 1333 | - })) | |
| 1334 | - .child(glyph) | |
| 1335 | - }; | |
| 1288 | +fn viz_step( | |
| 1289 | + id: &'static str, | |
| 1290 | + glyph: &'static str, | |
| 1291 | + cx: &mut Context<Player>, | |
| 1292 | + f: impl Fn(&mut Player, &mut Context<Player>) + 'static + Copy, | |
| 1293 | +) -> impl IntoElement { | |
| 1336 | 1294 | div() |
| 1337 | - .id("dock-viz-hue") | |
| 1338 | - .flex_none() | |
| 1295 | + .id(id) | |
| 1339 | 1296 | .flex() |
| 1297 | + .w(px(HIT_MIN)) | |
| 1298 | + .h(px(HIT_MIN)) | |
| 1340 | 1299 | .items_center() |
| 1300 | + .justify_center() | |
| 1301 | + .rounded(px(3.)) | |
| 1302 | + .bg(rgb(DARK_RAISED())) | |
| 1303 | + .cursor_pointer() | |
| 1304 | + .children(hitmap::control(id, glyph, true)) | |
| 1305 | + .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| f(this, cx))) | |
| 1306 | + .child(glyph) | |
| 1307 | +} | |
| 1308 | + | |
| 1309 | +fn viz_paint_knobs(paint: u32, cx: &mut Context<Player>) -> impl IntoElement { | |
| 1310 | + let hue = engine::decode::viz_hue_ui(paint); | |
| 1311 | + let sat = engine::decode::viz_sat_ui(paint); | |
| 1312 | + let strands = engine::decode::viz_strands_of(paint); | |
| 1313 | + let glow = engine::decode::viz_glow_of(paint); | |
| 1314 | + let style = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM); | |
| 1315 | + div() | |
| 1316 | + .flex() | |
| 1317 | + .flex_col() | |
| 1341 | 1318 | .gap(px(4.)) |
| 1342 | - .h(px(CONTROL_H)) | |
| 1343 | 1319 | .px(px(8.)) |
| 1344 | 1320 | .child( |
| 1345 | 1321 | div() |
| 1346 | - .font(style.font) | |
| 1347 | - .text_size(style.size) | |
| 1348 | - .text_color(rgb(INK2())) | |
| 1349 | - .child("Colour"), | |
| 1322 | + .id("dock-viz-hue") | |
| 1323 | + .flex() | |
| 1324 | + .items_center() | |
| 1325 | + .gap(px(4.)) | |
| 1326 | + .h(px(CONTROL_H)) | |
| 1327 | + .child( | |
| 1328 | + div() | |
| 1329 | + .font(style.font.clone()) | |
| 1330 | + .text_size(style.size) | |
| 1331 | + .text_color(rgb(INK2())) | |
| 1332 | + .child("Colour"), | |
| 1333 | + ) | |
| 1334 | + .child(viz_step("dock-viz-hue-minus", "−", cx, |this, cx| { | |
| 1335 | + this.set_viz_hue(engine::decode::viz_hue_ui(this.viz_paint()).wrapping_sub(4), cx); | |
| 1336 | + })) | |
| 1337 | + .child( | |
| 1338 | + div() | |
| 1339 | + .id("dock-viz-hue-bar") | |
| 1340 | + .flex_1() | |
| 1341 | + .flex() | |
| 1342 | + .h(px(14.)) | |
| 1343 | + .children((0u8..64).map(|i| { | |
| 1344 | + let h = i.saturating_mul(4); | |
| 1345 | + let (r, g, b) = engine::decode::viz_ink_from_paint( | |
| 1346 | + engine::decode::with_viz_paint_hue(paint, h), | |
| 1347 | + ); | |
| 1348 | + let color = (u32::from(r) << 16) | (u32::from(g) << 8) | u32::from(b); | |
| 1349 | + div() | |
| 1350 | + .id(("dock-viz-hue", u64::from(i))) | |
| 1351 | + .flex_1() | |
| 1352 | + .h_full() | |
| 1353 | + .bg(rgb(color)) | |
| 1354 | + .when(hue.abs_diff(h) < 3, |d| d.border_1().border_color(rgb(INK1()))) | |
| 1355 | + .cursor_pointer() | |
| 1356 | + .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { | |
| 1357 | + this.set_viz_hue(h, cx); | |
| 1358 | + })) | |
| 1359 | + .into_any_element() | |
| 1360 | + })), | |
| 1361 | + ) | |
| 1362 | + .child(viz_step("dock-viz-hue-plus", "+", cx, |this, cx| { | |
| 1363 | + this.set_viz_hue(engine::decode::viz_hue_ui(this.viz_paint()).wrapping_add(4), cx); | |
| 1364 | + })), | |
| 1350 | 1365 | ) |
| 1351 | - .child(step("dock-viz-hue-minus", "−", -1, cx)) | |
| 1352 | 1366 | .child( |
| 1353 | 1367 | div() |
| 1354 | - .id("dock-viz-hue-swatches") | |
| 1355 | - .flex_1() | |
| 1356 | 1368 | .flex() |
| 1357 | - .gap(px(2.)) | |
| 1358 | - .children((0u8..16).map(|i| { | |
| 1359 | - let (r, g, b) = engine::decode::viz_ink_rgb(i); | |
| 1360 | - let color = (u32::from(r) << 16) | (u32::from(g) << 8) | u32::from(b); | |
| 1369 | + .items_center() | |
| 1370 | + .gap(px(4.)) | |
| 1371 | + .h(px(CONTROL_H)) | |
| 1372 | + .child( | |
| 1361 | 1373 | div() |
| 1362 | - .id(("dock-viz-hue", u64::from(i))) | |
| 1363 | - .flex_1() | |
| 1364 | - .h(px(14.)) | |
| 1365 | - .min_w(px(8.)) | |
| 1366 | - .rounded(px(2.)) | |
| 1367 | - .bg(rgb(color)) | |
| 1368 | - .when(i == hue, |d| d.border_1().border_color(rgb(INK1()))) | |
| 1369 | - .cursor_pointer() | |
| 1370 | - .children(hitmap::control(VIZ_HUE_IDS[i as usize], "Colour", true)) | |
| 1371 | - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { | |
| 1372 | - this.set_viz_hue(i, cx); | |
| 1373 | - })) | |
| 1374 | - .into_any_element() | |
| 1374 | + .font(style.font.clone()) | |
| 1375 | + .text_size(style.size) | |
| 1376 | + .text_color(rgb(INK2())) | |
| 1377 | + .child("Sat"), | |
| 1378 | + ) | |
| 1379 | + .child(viz_step("dock-viz-sat-minus", "−", cx, |this, cx| { | |
| 1380 | + this.set_viz_sat(engine::decode::viz_sat_ui(this.viz_paint()).saturating_sub(16), cx); | |
| 1381 | + })) | |
| 1382 | + .child( | |
| 1383 | + div() | |
| 1384 | + .font(style.font.clone()) | |
| 1385 | + .text_size(style.size) | |
| 1386 | + .text_color(rgb(INK1())) | |
| 1387 | + .child(format!("{sat}")), | |
| 1388 | + ) | |
| 1389 | + .child(viz_step("dock-viz-sat-plus", "+", cx, |this, cx| { | |
| 1390 | + this.set_viz_sat(engine::decode::viz_sat_ui(this.viz_paint()).saturating_add(16).min(255), cx); | |
| 1391 | + })), | |
| 1392 | + ) | |
| 1393 | + .child( | |
| 1394 | + div() | |
| 1395 | + .flex() | |
| 1396 | + .items_center() | |
| 1397 | + .gap(px(4.)) | |
| 1398 | + .h(px(CONTROL_H)) | |
| 1399 | + .child( | |
| 1400 | + div() | |
| 1401 | + .font(style.font.clone()) | |
| 1402 | + .text_size(style.size) | |
| 1403 | + .text_color(rgb(INK2())) | |
| 1404 | + .child("Strands"), | |
| 1405 | + ) | |
| 1406 | + .child(viz_step("dock-viz-strands-minus", "−", cx, |this, cx| { | |
| 1407 | + this.set_viz_strands(engine::decode::viz_strands_of(this.viz_paint()).saturating_sub(1).max(1), cx); | |
| 1408 | + })) | |
| 1409 | + .child( | |
| 1410 | + div() | |
| 1411 | + .font(style.font.clone()) | |
| 1412 | + .text_size(style.size) | |
| 1413 | + .text_color(rgb(INK1())) | |
| 1414 | + .child(format!("{strands}")), | |
| 1415 | + ) | |
| 1416 | + .child(viz_step("dock-viz-strands-plus", "+", cx, |this, cx| { | |
| 1417 | + this.set_viz_strands(engine::decode::viz_strands_of(this.viz_paint()).saturating_add(1).min(32), cx); | |
| 1418 | + })), | |
| 1419 | + ) | |
| 1420 | + .child( | |
| 1421 | + div() | |
| 1422 | + .flex() | |
| 1423 | + .items_center() | |
| 1424 | + .gap(px(4.)) | |
| 1425 | + .h(px(CONTROL_H)) | |
| 1426 | + .child( | |
| 1427 | + div() | |
| 1428 | + .font(style.font.clone()) | |
| 1429 | + .text_size(style.size) | |
| 1430 | + .text_color(rgb(INK2())) | |
| 1431 | + .child("Glow"), | |
| 1432 | + ) | |
| 1433 | + .child(viz_step("dock-viz-glow-minus", "−", cx, |this, cx| { | |
| 1434 | + this.set_viz_glow(engine::decode::viz_glow_of(this.viz_paint()).saturating_sub(1), cx); | |
| 1435 | + })) | |
| 1436 | + .child( | |
| 1437 | + div() | |
| 1438 | + .font(style.font.clone()) | |
| 1439 | + .text_size(style.size) | |
| 1440 | + .text_color(rgb(INK1())) | |
| 1441 | + .child(format!("{glow}")), | |
| 1442 | + ) | |
| 1443 | + .child(viz_step("dock-viz-glow-plus", "+", cx, |this, cx| { | |
| 1444 | + this.set_viz_glow(engine::decode::viz_glow_of(this.viz_paint()).saturating_add(1).min(16), cx); | |
| 1375 | 1445 | })), |
| 1376 | 1446 | ) |
| 1377 | - .child(step("dock-viz-hue-plus", "+", 1, cx)) | |
| 1378 | 1447 | } |
| 1379 | 1448 | |
| 1380 | 1449 | fn clip_tab( |
| @@ -1614,7 +1683,7 @@ fn keys_tab(player: &Player, cx: &mut Context<Player>) -> impl IntoElement { | ||
| 1614 | 1683 | .id("dock-keys-filter") |
| 1615 | 1684 | .flex_none() |
| 1616 | 1685 | .cursor_text() |
| 1617 | - .font(style.font) | |
| 1686 | + .font(style.font.clone()) | |
| 1618 | 1687 | .text_size(style.size) |
| 1619 | 1688 | .text_color(rgb(INK1())) |
| 1620 | 1689 | .children(hitmap::control("dock.keys-filter", "Filter keys", true)) |
crates/engine/examples/bench.rsmodified+1 -0
| @@ -864,6 +864,7 @@ fn export_bench(path: &Path, seat: &str, out_dir: &Path) { | ||
| 864 | 864 | fade_out: 0, |
| 865 | 865 | transition_out: 0, |
| 866 | 866 | visualizer: 0, |
| 867 | + viz_paint: 0, | |
| 867 | 868 | start: 0, |
| 868 | 869 | in_frame, |
| 869 | 870 | out_frame: in_frame + span, |
crates/engine/src/decode.rsmodified+82 -13
| @@ -56,6 +56,7 @@ pub enum Backend { | ||
| 56 | 56 | /// A gap: black frames, nothing decoded at all. |
| 57 | 57 | Gap, |
| 58 | 58 | /// A waveform visualizer: the picture is painted from the audio's peaks |
| 59 | + /// A waveform viz_paint: 0, | |
| 59 | 60 | /// ([`visualizer_i420`]), no decoder seat and no stream of pictures at all. |
| 60 | 61 | Visualizer, |
| 61 | 62 | } |
| @@ -629,6 +630,7 @@ impl DecodeSession { | ||
| 629 | 630 | transform: TransformParams, |
| 630 | 631 | canvas: Composer, |
| 631 | 632 | flags: u8, |
| 633 | + paint: u32, | |
| 632 | 634 | ) -> crate::Result<FrameStream> { |
| 633 | 635 | let (tx, rx) = sync_channel(2); |
| 634 | 636 | let cancel = Arc::new(AtomicBool::new(false)); |
| @@ -679,7 +681,7 @@ impl DecodeSession { | ||
| 679 | 681 | return; |
| 680 | 682 | } |
| 681 | 683 | let t = f64::from(start_frame + index) / fps; |
| 682 | - let (y, u, v) = visualizer_i420(&peaks, t, width, height, flags); | |
| 684 | + let (y, u, v) = visualizer_i420(&peaks, t, width, height, flags, paint); | |
| 683 | 685 | let frame = render.frame(start_frame + index, &y, &u, &v, width, height); |
| 684 | 686 | if tx.send(frame).is_err() { |
| 685 | 687 | return; // caller moved on |
| @@ -1444,6 +1446,65 @@ pub fn viz_ink_rgb(hue: u8) -> (u8, u8, u8) { | ||
| 1444 | 1446 | hsv_to_rgb(212.0 + f32::from(hue & 15) * 22.5, 0.63, 0.84) |
| 1445 | 1447 | } |
| 1446 | 1448 | |
| 1449 | +pub fn viz_ink_from_paint(paint: u32) -> (u8, u8, u8) { | |
| 1450 | + if paint == 0 { | |
| 1451 | + return hsv_to_rgb(212.0, 0.63, 0.84); | |
| 1452 | + } | |
| 1453 | + let hue = (paint & 0xFF) as f32 * 360.0 / 256.0; | |
| 1454 | + let sat_b = ((paint >> 8) & 0xFF) as u8; | |
| 1455 | + let sat = if sat_b == 0 { 0.63 } else { f32::from(sat_b) / 255.0 }; | |
| 1456 | + hsv_to_rgb(hue, sat, 0.84) | |
| 1457 | +} | |
| 1458 | + | |
| 1459 | +pub fn viz_strands_of(paint: u32) -> u8 { | |
| 1460 | + match ((paint >> 16) & 0xFF) as u8 { | |
| 1461 | + 0 => 8, | |
| 1462 | + n => n.clamp(1, 32), | |
| 1463 | + } | |
| 1464 | +} | |
| 1465 | + | |
| 1466 | +pub fn viz_glow_of(paint: u32) -> u8 { | |
| 1467 | + match ((paint >> 24) & 0xFF) as u8 { | |
| 1468 | + 0 => 2, | |
| 1469 | + n => n.min(16), | |
| 1470 | + } | |
| 1471 | +} | |
| 1472 | + | |
| 1473 | +pub fn with_viz_paint_hue(paint: u32, hue: u8) -> u32 { | |
| 1474 | + let sat = match (paint >> 8) & 0xFF { | |
| 1475 | + 0 => 255, | |
| 1476 | + s => s, | |
| 1477 | + }; | |
| 1478 | + (paint & !0xFF) | u32::from(hue) | (sat << 8) | |
| 1479 | +} | |
| 1480 | + | |
| 1481 | +pub fn with_viz_paint_sat(paint: u32, sat: u8) -> u32 { | |
| 1482 | + (paint & !(0xFF << 8)) | (u32::from(sat.max(1)) << 8) | |
| 1483 | +} | |
| 1484 | + | |
| 1485 | +pub fn with_viz_paint_strands(paint: u32, n: u8) -> u32 { | |
| 1486 | + (paint & !(0xFF << 16)) | (u32::from(n.clamp(1, 32)) << 16) | |
| 1487 | +} | |
| 1488 | + | |
| 1489 | +pub fn with_viz_paint_glow(paint: u32, n: u8) -> u32 { | |
| 1490 | + (paint & !(0xFF << 24)) | (u32::from(n.min(16)) << 24) | |
| 1491 | +} | |
| 1492 | + | |
| 1493 | +pub fn viz_hue_ui(paint: u32) -> u8 { | |
| 1494 | + if paint == 0 { 150 } else { (paint & 0xFF) as u8 } | |
| 1495 | +} | |
| 1496 | + | |
| 1497 | +pub fn viz_sat_ui(paint: u32) -> u8 { | |
| 1498 | + if paint == 0 { | |
| 1499 | + 160 | |
| 1500 | + } else { | |
| 1501 | + match ((paint >> 8) & 0xFF) as u8 { | |
| 1502 | + 0 => 160, | |
| 1503 | + s => s, | |
| 1504 | + } | |
| 1505 | + } | |
| 1506 | +} | |
| 1507 | + | |
| 1447 | 1508 | fn hsv_to_rgb(h: f32, s: f32, v: f32) -> (u8, u8, u8) { |
| 1448 | 1509 | let h = ((h % 360.0) + 360.0) % 360.0; |
| 1449 | 1510 | let c = v * s; |
| @@ -1607,6 +1668,7 @@ pub(crate) fn visualizer_i420( | ||
| 1607 | 1668 | width: u32, |
| 1608 | 1669 | height: u32, |
| 1609 | 1670 | flags: u8, |
| 1671 | + paint: u32, | |
| 1610 | 1672 | ) -> (Vec<u8>, Vec<u8>, Vec<u8>) { |
| 1611 | 1673 | let width = width & !1; |
| 1612 | 1674 | let height = height & !1; |
| @@ -1616,7 +1678,7 @@ pub(crate) fn visualizer_i420( | ||
| 1616 | 1678 | let mut y = vec![bg_y; w * h]; |
| 1617 | 1679 | let mut u = vec![bg_u; cw * ch]; |
| 1618 | 1680 | let mut v = vec![bg_v; cw * ch]; |
| 1619 | - let (ink_r, ink_g, ink_b) = viz_ink_rgb(viz_hue(flags)); | |
| 1681 | + let (ink_r, ink_g, ink_b) = viz_ink_from_paint(paint); | |
| 1620 | 1682 | let (ink_y, ink_u, ink_v) = rgb_yuv(ink_r as i32, ink_g as i32, ink_b as i32); |
| 1621 | 1683 | let center = h as f32 / 2.0; |
| 1622 | 1684 | let half = h as f32 * 0.42; |
| @@ -1669,15 +1731,18 @@ pub(crate) fn visualizer_i420( | ||
| 1669 | 1731 | let f = (pos - i as f64) as f32; |
| 1670 | 1732 | sig[col] = signed(i) + (signed(i.saturating_add(1)) - signed(i)) * f; |
| 1671 | 1733 | } |
| 1672 | - let peak = lo | |
| 1734 | + // Whole-file peak, not the window's: a 2s window that gains or loses | |
| 1735 | + // a loud hit used to rescale every column, so the same bump changed | |
| 1736 | + // height as it entered and left the picture. | |
| 1737 | + let peak = peaks | |
| 1673 | 1738 | .iter() |
| 1674 | - .zip(&hi) | |
| 1675 | - .map(|(l, h)| l.abs().max(h.abs())) | |
| 1739 | + .map(|&(l, h)| l.abs().max(h.abs())) | |
| 1676 | 1740 | .fold(0.0f32, f32::max); |
| 1677 | 1741 | if peak > 1e-4 { |
| 1678 | 1742 | for i in 0..w { |
| 1679 | 1743 | lo[i] /= peak; |
| 1680 | 1744 | hi[i] /= peak; |
| 1745 | + sig[i] /= peak; | |
| 1681 | 1746 | } |
| 1682 | 1747 | } |
| 1683 | 1748 | viz_smooth(&mut lo, &mut hi); |
| @@ -1691,8 +1756,8 @@ pub(crate) fn visualizer_i420( | ||
| 1691 | 1756 | for col in 0..w { |
| 1692 | 1757 | let env = lo[col].abs().max(hi[col]).max(0.06); |
| 1693 | 1758 | let x_phase = (col as f64 / w.max(1) as f64) * 2.15 * tau; |
| 1694 | - for s in 0..24 { | |
| 1695 | - let frac = s as f32 / 23.0; | |
| 1759 | + for s in 0..u32::from(viz_strands_of(paint)).max(1) { | |
| 1760 | + let frac = s as f32 / (viz_strands_of(paint).max(2) as f32 - 1.0); | |
| 1696 | 1761 | let scale = 0.28 + 0.72 * frac; |
| 1697 | 1762 | let wave = (x_phase + travel + s as f64 * 0.05).sin() as f32; |
| 1698 | 1763 | let row = (center + half * env * scale * wave).round() as i32; |
| @@ -1718,8 +1783,12 @@ pub(crate) fn visualizer_i420( | ||
| 1718 | 1783 | let amp = (w.min(h) as f32) * 0.18; |
| 1719 | 1784 | let tau = std::f32::consts::TAU; |
| 1720 | 1785 | let steps = w.max(h) * 4; |
| 1721 | - for strand in 0..8u8 { | |
| 1722 | - let (ir, ig, ib) = viz_ink_rgb(viz_hue(flags).wrapping_add(if strand < 4 { 0 } else { 8 })); | |
| 1786 | + for strand in 0..viz_strands_of(paint) { | |
| 1787 | + let (ir, ig, ib) = viz_ink_from_paint(if strand < viz_strands_of(paint) / 2 { | |
| 1788 | + paint | |
| 1789 | + } else { | |
| 1790 | + with_viz_paint_hue(paint, viz_hue_ui(paint).wrapping_add(128)) | |
| 1791 | + }); | |
| 1723 | 1792 | let (iy, iu, iv) = rgb_yuv(ir as i32, ig as i32, ib as i32); |
| 1724 | 1793 | let scale = 0.65 + 0.35 * f32::from(strand % 4) / 3.0; |
| 1725 | 1794 | let phase = f32::from(strand) * 0.35; |
| @@ -2104,7 +2173,7 @@ mod tests { | ||
| 2104 | 2173 | *p = (-a.abs(), a.abs()); |
| 2105 | 2174 | } |
| 2106 | 2175 | let flags = 1u8; |
| 2107 | - let (y, u, v) = visualizer_i420(&peaks, 1.0, 320, 180, flags); | |
| 2176 | + let (y, u, v) = visualizer_i420(&peaks, 1.0, 320, 180, flags, 0); | |
| 2108 | 2177 | let ink = y.iter().filter(|&&p| p > 40).count(); |
| 2109 | 2178 | assert!(ink > 200, "envelope missing: {ink}"); |
| 2110 | 2179 | assert!(ink < y.len() * 9 / 10, "solid frame, not an envelope: {ink}"); |
| @@ -2117,13 +2186,13 @@ mod tests { | ||
| 2117 | 2186 | assert!(blue > 10, "default ink was not timeline blue: {blue}"); |
| 2118 | 2187 | |
| 2119 | 2188 | let ring = with_viz_style(flags, VIZ_STYLE_RING); |
| 2120 | - let (yr, _, _) = visualizer_i420(&peaks, 1.0, 320, 180, ring); | |
| 2189 | + let (yr, _, _) = visualizer_i420(&peaks, 1.0, 320, 180, ring, 0); | |
| 2121 | 2190 | let ring_ink = yr.iter().filter(|&&p| p > 40).count(); |
| 2122 | 2191 | assert!(ring_ink > 80, "ring missing: {ring_ink}"); |
| 2123 | 2192 | assert!(ring_ink < ink, "ring should be a stroke, not a fill"); |
| 2124 | 2193 | |
| 2125 | - let hue = with_viz_hue(flags, 8); | |
| 2126 | - let (_, u2, v2) = visualizer_i420(&peaks, 1.0, 64, 32, hue); | |
| 2194 | + let hue_paint = with_viz_paint_hue(0, 40); | |
| 2195 | + let (_, u2, v2) = visualizer_i420(&peaks, 1.0, 64, 32, flags, hue_paint); | |
| 2127 | 2196 | let mut shifted = 0usize; |
| 2128 | 2197 | for i in 0..u2.len() { |
| 2129 | 2198 | if u2[i] < 120 && v2[i] > 130 { |
crates/engine/src/edith.rsmodified+72 -49
| @@ -118,7 +118,7 @@ | ||
| 118 | 118 | //! its fit policy already placed. |
| 119 | 119 | //! |
| 120 | 120 | //! A lane line is `<kind> <lane> <start> <in> <out> <source> <link> <eq> |
| 121 | -//! <color> <fit> <speed> <fade_in> <fade_out> <transition_out> <transform> <visualizer>`: | |
| 121 | +//! <color> <fit> <speed> <fade_in> <fade_out> <transition_out> <transform> <visualizer> <viz_paint>`: | |
| 122 | 122 | //! which lane the clip is on -- its kind and its 1-based number |
| 123 | 123 | //! among the lanes of that kind, the [`crate::project::Lane::label`] a header |
| 124 | 124 | //! column shows -- then where the clip sits on the timeline, the half-open |
| @@ -205,7 +205,7 @@ | ||
| 205 | 205 | //! nothing, and an older one plays everything at real time, and an older one |
| 206 | 206 | //! mixes flat, and an older one shows no subtitles, and an older one is shown |
| 207 | 207 | //! in the reference rendition, and an older one places none of the words it |
| 208 | -//! names -- and saving any of them writes v21. An older | |
| 208 | +//! names -- and saving any of them writes v22. An older | |
| 209 | 209 | //! reader refuses a newer file by name. |
| 210 | 210 | //! |
| 211 | 211 | //! Text because an edit list is a few integers and a path, and a path is |
| @@ -242,7 +242,8 @@ use crate::transform::TransformParams; | ||
| 242 | 242 | |
| 243 | 243 | /// What [`save`] writes. Read support goes back to `edith 1`; see the module |
| 244 | 244 | /// docs for what those dialects looked like. |
| 245 | -const MAGIC: &[u8] = b"edith 21"; | |
| 245 | +const MAGIC: &[u8] = b"edith 22"; | |
| 246 | +const MAGIC_V21: &[u8] = b"edith 21"; | |
| 246 | 247 | const MAGIC_V20: &[u8] = b"edith 20"; |
| 247 | 248 | const MAGIC_V19: &[u8] = b"edith 19"; |
| 248 | 249 | const MAGIC_V18: &[u8] = b"edith 18"; |
| @@ -595,7 +596,7 @@ fn emit( | ||
| 595 | 596 | let transform = c.transform.map_or("-".to_string(), |e| e.to_string()); |
| 596 | 597 | out.extend_from_slice( |
| 597 | 598 | format!( |
| 598 | - "{keyword} {ord} {} {} {} {} {link} {eq} {color} {} {} {} {} {} {transform} {}\n", | |
| 599 | + "{keyword} {ord} {} {} {} {} {link} {eq} {color} {} {} {} {} {} {transform} {} {}\n", | |
| 599 | 600 | c.start, |
| 600 | 601 | c.in_frame, |
| 601 | 602 | c.out_frame, |
| @@ -606,6 +607,7 @@ fn emit( | ||
| 606 | 607 | c.fade_out, |
| 607 | 608 | c.transition_out, |
| 608 | 609 | c.visualizer, |
| 610 | + c.viz_paint, | |
| 609 | 611 | ) |
| 610 | 612 | .as_bytes(), |
| 611 | 613 | ); |
| @@ -648,8 +650,10 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> { | ||
| 648 | 650 | // The dialects that wrote a source line without its stream field. Reading |
| 649 | 651 | // one is the whole of what "an old project still opens" means here. |
| 650 | 652 | let streamless = v1 || first == MAGIC_V2; |
| 653 | + // The one that carries packed visualizer paint (hue/sat/strands/glow)... | |
| 654 | + let v22 = first == MAGIC; | |
| 651 | 655 | // The one that carries per-clip visualizer flags... |
| 652 | - let v21 = first == MAGIC; | |
| 656 | + let v21 = v22 || first == MAGIC_V21; | |
| 653 | 657 | // The one that carries a per-clip transform (position/scale/rotate/crop)... |
| 654 | 658 | let v20 = v21 || first == MAGIC_V20; |
| 655 | 659 | // ...the one that carries a per-clip cross-dissolve into its successor... |
| @@ -1053,6 +1057,7 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> { | ||
| 1053 | 1057 | fade_out: 0, |
| 1054 | 1058 | transition_out: 0, |
| 1055 | 1059 | visualizer: 0, |
| 1060 | + viz_paint: 0, | |
| 1056 | 1061 | start: queued, |
| 1057 | 1062 | in_frame: number(f[0], n)?, |
| 1058 | 1063 | out_frame: number(f[1], n)?, |
| @@ -1184,7 +1189,8 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> { | ||
| 1184 | 1189 | + 2 * usize::from(v18) |
| 1185 | 1190 | + usize::from(v19) |
| 1186 | 1191 | + usize::from(v20) |
| 1187 | - + usize::from(v21); | |
| 1192 | + + usize::from(v21) | |
| 1193 | + + usize::from(v22); | |
| 1188 | 1194 | let f = fields(rest, want, "clip", n)?; |
| 1189 | 1195 | let in_frame = number(f[1], n)?; |
| 1190 | 1196 | let out_frame = number(f[2], n)?; |
| @@ -1200,6 +1206,7 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> { | ||
| 1200 | 1206 | fade_out: number(f.get(10).copied().unwrap_or(b"0"), n)?.min(frames), |
| 1201 | 1207 | transition_out: number(f.get(11).copied().unwrap_or(b"0"), n)?.min(frames), |
| 1202 | 1208 | visualizer: number(f.get(13).copied().unwrap_or(b"0"), n)? as u8, |
| 1209 | + viz_paint: number(f.get(14).copied().unwrap_or(b"0"), n)? as u32, | |
| 1203 | 1210 | start: number(f[0], n)?, |
| 1204 | 1211 | in_frame, |
| 1205 | 1212 | out_frame, |
| @@ -1629,7 +1636,7 @@ mod tests { | ||
| 1629 | 1636 | video 1 0 0 30 0 - - - fit 1000\n"; |
| 1630 | 1637 | let old = parse(v9, &dir).expect("v9 still loads"); |
| 1631 | 1638 | assert_eq!(old.subtitles, Vec::new()); |
| 1632 | - assert!(flat(&dir, &old.sources, &old.lanes, old.playhead).starts_with(b"edith 21\n")); | |
| 1639 | + assert!(flat(&dir, &old.sources, &old.lanes, old.playhead).starts_with(b"edith 22\n")); | |
| 1633 | 1640 | // ...and the line itself is not a v9 line: a dialect may not be mixed. |
| 1634 | 1641 | let mixed = parse(b"edith 9\nsource 0 a.mp4\nsubtitle - subs.srt\n", &dir) |
| 1635 | 1642 | .unwrap_err() |
| @@ -2049,6 +2056,7 @@ mod tests { | ||
| 2049 | 2056 | fade_out: 0, |
| 2050 | 2057 | transition_out: 0, |
| 2051 | 2058 | visualizer: 0, |
| 2059 | + viz_paint: 0, | |
| 2052 | 2060 | start, |
| 2053 | 2061 | in_frame, |
| 2054 | 2062 | out_frame, |
| @@ -2108,10 +2116,10 @@ mod tests { | ||
| 2108 | 2116 | let bytes = flat(&dir, &sources, &lanes, 12); |
| 2109 | 2117 | assert_eq!( |
| 2110 | 2118 | String::from_utf8_lossy(&bytes), |
| 2111 | - "edith 21\nplayhead 12\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2119 | + "edith 22\nplayhead 12\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2112 | 2120 | source 2 /elsewhere/b.mp4\n\ |
| 2113 | - video 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0\nvideo 1 30 10 20 1 1 - - fit 1000 0 0 0 - 0\n\ | |
| 2114 | - audio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0\n", | |
| 2121 | + video 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0 0\nvideo 1 30 10 20 1 1 - - fit 1000 0 0 0 - 0 0\n\ | |
| 2122 | + audio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0 0\n", | |
| 2115 | 2123 | "the file under the project directory is written relative to it, \ |
| 2116 | 2124 | each with the audio stream it plays" |
| 2117 | 2125 | ); |
| @@ -2145,9 +2153,9 @@ mod tests { | ||
| 2145 | 2153 | let bytes = flat(&dir, &sources, &lanes, 7); |
| 2146 | 2154 | assert_eq!( |
| 2147 | 2155 | String::from_utf8_lossy(&bytes), |
| 2148 | - "edith 21\nplayhead 7\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2149 | - video 1 0 0 30 0 4 - - fit 1000 0 0 0 - 0\naudio 1\n\ | |
| 2150 | - video 2 40 0 10 0 - - - fit 1000 0 0 0 - 0\naudio 2 0 0 30 0 4 - - fit 1000 0 0 0 - 0\n", | |
| 2156 | + "edith 22\nplayhead 7\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2157 | + video 1 0 0 30 0 4 - - fit 1000 0 0 0 - 0 0\naudio 1\n\ | |
| 2158 | + video 2 40 0 10 0 - - - fit 1000 0 0 0 - 0 0\naudio 2 0 0 30 0 4 - - fit 1000 0 0 0 - 0 0\n", | |
| 2151 | 2159 | "an empty lane is a line of its own; everything else is its clips" |
| 2152 | 2160 | ); |
| 2153 | 2161 | let back = parse(&bytes, &dir).expect("parse"); |
| @@ -2235,6 +2243,7 @@ mod tests { | ||
| 2235 | 2243 | fade_out: 0, |
| 2236 | 2244 | transition_out: 0, |
| 2237 | 2245 | visualizer: 0, |
| 2246 | + viz_paint: 0, | |
| 2238 | 2247 | eq: Some(0), |
| 2239 | 2248 | ..clip(0, 0, 30, 0, Some(0)) |
| 2240 | 2249 | }, |
| @@ -2243,6 +2252,7 @@ mod tests { | ||
| 2243 | 2252 | fade_out: 0, |
| 2244 | 2253 | transition_out: 0, |
| 2245 | 2254 | visualizer: 0, |
| 2255 | + viz_paint: 0, | |
| 2246 | 2256 | eq: Some(1), |
| 2247 | 2257 | ..clip(30, 10, 20, 0, None) |
| 2248 | 2258 | }, |
| @@ -2253,6 +2263,7 @@ mod tests { | ||
| 2253 | 2263 | fade_out: 0, |
| 2254 | 2264 | transition_out: 0, |
| 2255 | 2265 | visualizer: 0, |
| 2266 | + viz_paint: 0, | |
| 2256 | 2267 | eq: Some(0), |
| 2257 | 2268 | ..clip(0, 0, 30, 0, Some(0)) |
| 2258 | 2269 | }, |
| @@ -2261,6 +2272,7 @@ mod tests { | ||
| 2261 | 2272 | fade_out: 0, |
| 2262 | 2273 | transition_out: 0, |
| 2263 | 2274 | visualizer: 0, |
| 2275 | + viz_paint: 0, | |
| 2264 | 2276 | eq: Some(2), |
| 2265 | 2277 | ..clip(30, 0, 10, 0, None) |
| 2266 | 2278 | }, |
| @@ -2269,12 +2281,12 @@ mod tests { | ||
| 2269 | 2281 | let bytes = emit(&dir, &sources, &lanes, &eq, &[], (1280, 720), 0); |
| 2270 | 2282 | assert_eq!( |
| 2271 | 2283 | String::from_utf8_lossy(&bytes), |
| 2272 | - "edith 21\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2284 | + "edith 22\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2273 | 2285 | eq 80.0:-3.0:0.707:ls 1000.0:4.5:1.0:pk\n\ |
| 2274 | 2286 | eq 16777215.0:-0.1:3.918315e-39:hs\n\ |
| 2275 | 2287 | eq\n\ |
| 2276 | - video 1 0 0 30 0 0 0 - fit 1000 0 0 0 - 0\nvideo 1 30 10 20 0 - 1 - fit 1000 0 0 0 - 0\n\ | |
| 2277 | - audio 1 0 0 30 0 0 0 - fit 1000 0 0 0 - 0\naudio 1 30 0 10 0 - 2 - fit 1000 0 0 0 - 0\n", | |
| 2288 | + video 1 0 0 30 0 0 0 - fit 1000 0 0 0 - 0 0\nvideo 1 30 10 20 0 - 1 - fit 1000 0 0 0 - 0 0\n\ | |
| 2289 | + audio 1 0 0 30 0 0 0 - fit 1000 0 0 0 - 0 0\naudio 1 30 0 10 0 - 2 - fit 1000 0 0 0 - 0 0\n", | |
| 2278 | 2290 | "the table comes before the clips, and a clip names a line of it" |
| 2279 | 2291 | ); |
| 2280 | 2292 | |
| @@ -2347,6 +2359,7 @@ mod tests { | ||
| 2347 | 2359 | fade_out: 0, |
| 2348 | 2360 | transition_out: 0, |
| 2349 | 2361 | visualizer: 0, |
| 2362 | + viz_paint: 0, | |
| 2350 | 2363 | color: Some(0), |
| 2351 | 2364 | fit: FitPolicy::default(), |
| 2352 | 2365 | speed: Speed::NORMAL, |
| @@ -2357,6 +2370,7 @@ mod tests { | ||
| 2357 | 2370 | fade_out: 0, |
| 2358 | 2371 | transition_out: 0, |
| 2359 | 2372 | visualizer: 0, |
| 2373 | + viz_paint: 0, | |
| 2360 | 2374 | color: Some(1), |
| 2361 | 2375 | fit: FitPolicy::default(), |
| 2362 | 2376 | speed: Speed::NORMAL, |
| @@ -2369,6 +2383,7 @@ mod tests { | ||
| 2369 | 2383 | fade_out: 0, |
| 2370 | 2384 | transition_out: 0, |
| 2371 | 2385 | visualizer: 0, |
| 2386 | + viz_paint: 0, | |
| 2372 | 2387 | color: Some(0), |
| 2373 | 2388 | fit: FitPolicy::default(), |
| 2374 | 2389 | speed: Speed::NORMAL, |
| @@ -2379,6 +2394,7 @@ mod tests { | ||
| 2379 | 2394 | fade_out: 0, |
| 2380 | 2395 | transition_out: 0, |
| 2381 | 2396 | visualizer: 0, |
| 2397 | + viz_paint: 0, | |
| 2382 | 2398 | color: Some(2), |
| 2383 | 2399 | fit: FitPolicy::default(), |
| 2384 | 2400 | speed: Speed::NORMAL, |
| @@ -2389,12 +2405,12 @@ mod tests { | ||
| 2389 | 2405 | let bytes = emit(&dir, &sources, &lanes, &[], &color, (1280, 720), 0); |
| 2390 | 2406 | assert_eq!( |
| 2391 | 2407 | String::from_utf8_lossy(&bytes), |
| 2392 | - "edith 21\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2408 | + "edith 22\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2393 | 2409 | color 0.1:1.2:0.9:-0.3\n\ |
| 2394 | 2410 | color -1e-7:16777215.0:3.918315e-39:-0.0\n\ |
| 2395 | 2411 | color 0.0:1.0:1.0:0.0\n\ |
| 2396 | - video 1 0 0 30 0 0 - 0 fit 1000 0 0 0 - 0\nvideo 1 30 10 20 0 - - 1 fit 1000 0 0 0 - 0\n\ | |
| 2397 | - audio 1 0 0 30 0 0 - 0 fit 1000 0 0 0 - 0\naudio 1 30 0 10 0 - - 2 fit 1000 0 0 0 - 0\n", | |
| 2412 | + video 1 0 0 30 0 0 - 0 fit 1000 0 0 0 - 0 0\nvideo 1 30 10 20 0 - - 1 fit 1000 0 0 0 - 0 0\n\ | |
| 2413 | + audio 1 0 0 30 0 0 - 0 fit 1000 0 0 0 - 0 0\naudio 1 30 0 10 0 - - 2 fit 1000 0 0 0 - 0 0\n", | |
| 2398 | 2414 | "the table comes before the clips, and a clip names a line of it" |
| 2399 | 2415 | ); |
| 2400 | 2416 | |
| @@ -2454,9 +2470,9 @@ mod tests { | ||
| 2454 | 2470 | (1280, 720), |
| 2455 | 2471 | old.playhead |
| 2456 | 2472 | )), |
| 2457 | - "edith 21\nplayhead 3\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2473 | + "edith 22\nplayhead 3\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2458 | 2474 | eq 80.0:-3.0:0.707:ls\n\ |
| 2459 | - video 1 0 0 30 0 0 0 - fit 1000 0 0 0 - 0\naudio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0\n" | |
| 2475 | + video 1 0 0 30 0 0 0 - fit 1000 0 0 0 - 0 0\naudio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0 0\n" | |
| 2460 | 2476 | ); |
| 2461 | 2477 | } |
| 2462 | 2478 | |
| @@ -2473,6 +2489,7 @@ mod tests { | ||
| 2473 | 2489 | fade_out: 0, |
| 2474 | 2490 | transition_out: 0, |
| 2475 | 2491 | visualizer: 0, |
| 2492 | + viz_paint: 0, | |
| 2476 | 2493 | start, |
| 2477 | 2494 | in_frame, |
| 2478 | 2495 | out_frame, |
| @@ -2497,9 +2514,9 @@ mod tests { | ||
| 2497 | 2514 | let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0); |
| 2498 | 2515 | assert_eq!( |
| 2499 | 2516 | String::from_utf8_lossy(&bytes), |
| 2500 | - "edith 21\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2501 | - video 1 0 0 30 0 - - - fit 2000 0 0 0 - 0\nvideo 1 15 30 40 0 - - - fit 250 0 0 0 - 0\n\ | |
| 2502 | - audio 1 0 0 30 0 - - - fit 2000 0 0 0 - 0\n", | |
| 2517 | + "edith 22\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2518 | + video 1 0 0 30 0 - - - fit 2000 0 0 0 - 0 0\nvideo 1 15 30 40 0 - - - fit 250 0 0 0 - 0 0\n\ | |
| 2519 | + audio 1 0 0 30 0 - - - fit 2000 0 0 0 - 0 0\n", | |
| 2503 | 2520 | "the rate is the clip line's last field, in thousandths" |
| 2504 | 2521 | ); |
| 2505 | 2522 | let back = parse(&bytes, &dir).expect("parse"); |
| @@ -2526,8 +2543,8 @@ mod tests { | ||
| 2526 | 2543 | (1280, 720), |
| 2527 | 2544 | old.playhead |
| 2528 | 2545 | )), |
| 2529 | - "edith 21\nplayhead 3\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2530 | - video 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0\naudio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0\n" | |
| 2546 | + "edith 22\nplayhead 3\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2547 | + video 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0 0\naudio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0 0\n" | |
| 2531 | 2548 | ); |
| 2532 | 2549 | // A rate outside what the editor can set is a corrupt line, by name. |
| 2533 | 2550 | let bad = b"edith 8\nsource 0 a.mp4\nvideo 1 0 0 30 0 - - - fit 9000\n"; |
| @@ -2561,6 +2578,7 @@ mod tests { | ||
| 2561 | 2578 | fade_out: 7, |
| 2562 | 2579 | transition_out: 0, |
| 2563 | 2580 | visualizer: 0, |
| 2581 | + viz_paint: 0, | |
| 2564 | 2582 | start: 0, |
| 2565 | 2583 | in_frame: 0, |
| 2566 | 2584 | out_frame: 30, |
| @@ -2576,8 +2594,8 @@ mod tests { | ||
| 2576 | 2594 | let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0); |
| 2577 | 2595 | assert_eq!( |
| 2578 | 2596 | String::from_utf8_lossy(&bytes), |
| 2579 | - "edith 21\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2580 | - video 1 0 0 30 0 - - - fit 1000 5 7 0 - 0\n", | |
| 2597 | + "edith 22\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2598 | + video 1 0 0 30 0 - - - fit 1000 5 7 0 - 0 0\n", | |
| 2581 | 2599 | "the fades are the clip line's last two fields" |
| 2582 | 2600 | ); |
| 2583 | 2601 | let back = parse(&bytes, &dir).expect("parse"); |
| @@ -2613,6 +2631,7 @@ mod tests { | ||
| 2613 | 2631 | fade_out: 0, |
| 2614 | 2632 | transition_out: 9, |
| 2615 | 2633 | visualizer: 0, |
| 2634 | + viz_paint: 0, | |
| 2616 | 2635 | start: 0, |
| 2617 | 2636 | in_frame: 0, |
| 2618 | 2637 | out_frame: 30, |
| @@ -2628,8 +2647,8 @@ mod tests { | ||
| 2628 | 2647 | let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0); |
| 2629 | 2648 | assert_eq!( |
| 2630 | 2649 | String::from_utf8_lossy(&bytes), |
| 2631 | - "edith 21\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2632 | - video 1 0 0 30 0 - - - fit 1000 0 0 9 - 0\n", | |
| 2650 | + "edith 22\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2651 | + video 1 0 0 30 0 - - - fit 1000 0 0 9 - 0 0\n", | |
| 2633 | 2652 | "the dissolve is the clip line's own last field" |
| 2634 | 2653 | ); |
| 2635 | 2654 | let back = parse(&bytes, &dir).expect("parse"); |
| @@ -2701,6 +2720,7 @@ mod tests { | ||
| 2701 | 2720 | fade_out: 0, |
| 2702 | 2721 | transition_out: 0, |
| 2703 | 2722 | visualizer: 0, |
| 2723 | + viz_paint: 0, | |
| 2704 | 2724 | transform: Some(0), |
| 2705 | 2725 | fit: FitPolicy::default(), |
| 2706 | 2726 | speed: Speed::NORMAL, |
| @@ -2711,6 +2731,7 @@ mod tests { | ||
| 2711 | 2731 | fade_out: 0, |
| 2712 | 2732 | transition_out: 0, |
| 2713 | 2733 | visualizer: 0, |
| 2734 | + viz_paint: 0, | |
| 2714 | 2735 | transform: Some(1), |
| 2715 | 2736 | fit: FitPolicy::default(), |
| 2716 | 2737 | speed: Speed::NORMAL, |
| @@ -2723,6 +2744,7 @@ mod tests { | ||
| 2723 | 2744 | fade_out: 0, |
| 2724 | 2745 | transition_out: 0, |
| 2725 | 2746 | visualizer: 0, |
| 2747 | + viz_paint: 0, | |
| 2726 | 2748 | transform: Some(0), |
| 2727 | 2749 | fit: FitPolicy::default(), |
| 2728 | 2750 | speed: Speed::NORMAL, |
| @@ -2733,6 +2755,7 @@ mod tests { | ||
| 2733 | 2755 | fade_out: 0, |
| 2734 | 2756 | transition_out: 0, |
| 2735 | 2757 | visualizer: 0, |
| 2758 | + viz_paint: 0, | |
| 2736 | 2759 | transform: Some(2), |
| 2737 | 2760 | fit: FitPolicy::default(), |
| 2738 | 2761 | speed: Speed::NORMAL, |
| @@ -2762,12 +2785,12 @@ mod tests { | ||
| 2762 | 2785 | ); |
| 2763 | 2786 | assert_eq!( |
| 2764 | 2787 | String::from_utf8_lossy(&bytes), |
| 2765 | - "edith 21\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2788 | + "edith 22\nplayhead 0\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2766 | 2789 | transform 0.1:-0.2:1.5:90.0:0.1:0.0:0.0:0.05\n\ |
| 2767 | 2790 | transform -1e-7:16777215.0:3.918315e-39:-0.0:0.0:0.0:0.0:0.0\n\ |
| 2768 | 2791 | transform 0.0:0.0:1.0:0.0:0.0:0.0:0.0:0.0\n\ |
| 2769 | - video 1 0 0 30 0 0 - - fit 1000 0 0 0 0 0\nvideo 1 30 10 20 0 - - - fit 1000 0 0 0 1 0\n\ | |
| 2770 | - audio 1 0 0 30 0 0 - - fit 1000 0 0 0 0 0\naudio 1 30 0 10 0 - - - fit 1000 0 0 0 2 0\n", | |
| 2792 | + video 1 0 0 30 0 0 - - fit 1000 0 0 0 0 0 0\nvideo 1 30 10 20 0 - - - fit 1000 0 0 0 1 0 0\n\ | |
| 2793 | + audio 1 0 0 30 0 0 - - fit 1000 0 0 0 0 0 0\naudio 1 30 0 10 0 - - - fit 1000 0 0 0 2 0 0\n", | |
| 2771 | 2794 | "the table comes before the clips, and a clip names a line of it" |
| 2772 | 2795 | ); |
| 2773 | 2796 | |
| @@ -2842,10 +2865,10 @@ mod tests { | ||
| 2842 | 2865 | ); |
| 2843 | 2866 | assert_eq!( |
| 2844 | 2867 | String::from_utf8_lossy(&bytes), |
| 2845 | - "edith 21\nplayhead 0\nresolution 1280 720\nfps 23.976023976023978\n\ | |
| 2868 | + "edith 22\nplayhead 0\nresolution 1280 720\nfps 23.976023976023978\n\ | |
| 2846 | 2869 | limiter -1.5 on\nsource 0 a.mp4\n\ |
| 2847 | - video 1 0 0 30 0 - - - fit 1000 0 0 0 - 0\naudio 1 0 0 30 0 - - - fit 1000 0 0 0 - 0\n\ | |
| 2848 | - audio 2 0 0 30 0 - - - fit 1000 0 0 0 - 0\n\ | |
| 2870 | + video 1 0 0 30 0 - - - fit 1000 0 0 0 - 0 0\naudio 1 0 0 30 0 - - - fit 1000 0 0 0 - 0 0\n\ | |
| 2871 | + audio 2 0 0 30 0 - - - fit 1000 0 0 0 - 0 0\n\ | |
| 2849 | 2872 | gain audio 1 3.0\ngain audio 2 -6.5\n", |
| 2850 | 2873 | "the mix is lines of its own, the gains after the lanes they name" |
| 2851 | 2874 | ); |
| @@ -2874,8 +2897,8 @@ mod tests { | ||
| 2874 | 2897 | (1280, 720), |
| 2875 | 2898 | old.playhead |
| 2876 | 2899 | )), |
| 2877 | - "edith 21\nplayhead 3\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2878 | - video 1 0 0 30 0 - - - fit 1000 0 0 0 - 0\naudio 1 0 0 30 0 - - - fit 1000 0 0 0 - 0\n" | |
| 2900 | + "edith 22\nplayhead 3\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 2901 | + video 1 0 0 30 0 - - - fit 1000 0 0 0 - 0 0\naudio 1 0 0 30 0 - - - fit 1000 0 0 0 - 0 0\n" | |
| 2879 | 2902 | ); |
| 2880 | 2903 | |
| 2881 | 2904 | // Each of the three refuses by name, on its own line. |
| @@ -3038,10 +3061,10 @@ mod tests { | ||
| 3038 | 3061 | assert!(old.eq.is_empty(), "nothing before v5 equalizes anything"); |
| 3039 | 3062 | assert_eq!( |
| 3040 | 3063 | String::from_utf8_lossy(&flat(&dir, &old.sources, &old.lanes, old.playhead)), |
| 3041 | - "edith 21\nplayhead 12\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 3064 | + "edith 22\nplayhead 12\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 3042 | 3065 | source 2 /elsewhere/b.mp4\n\ |
| 3043 | - video 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0\nvideo 1 30 10 20 1 1 - - fit 1000 0 0 0 - 0\n\ | |
| 3044 | - audio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0\n" | |
| 3066 | + video 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0 0\nvideo 1 30 10 20 1 1 - - fit 1000 0 0 0 - 0 0\n\ | |
| 3067 | + audio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0 0\n" | |
| 3045 | 3068 | ); |
| 3046 | 3069 | // An empty lane's line is still the whole of that lane, eq or no eq. |
| 3047 | 3070 | let empty = parse( |
| @@ -3091,10 +3114,10 @@ mod tests { | ||
| 3091 | 3114 | let v5 = flat(&dir, &back.sources, &back.lanes, back.playhead); |
| 3092 | 3115 | assert_eq!( |
| 3093 | 3116 | String::from_utf8_lossy(&v5), |
| 3094 | - "edith 21\nplayhead 12\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 3117 | + "edith 22\nplayhead 12\nresolution 1280 720\nsource 0 a.mp4\n\ | |
| 3095 | 3118 | source 0 /elsewhere/b.mp4\n\ |
| 3096 | - video 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0\nvideo 1 30 10 20 1 1 - - fit 1000 0 0 0 - 0\n\ | |
| 3097 | - audio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0\n", | |
| 3119 | + video 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0 0\nvideo 1 30 10 20 1 1 - - fit 1000 0 0 0 - 0 0\n\ | |
| 3120 | + audio 1 0 0 30 0 0 - - fit 1000 0 0 0 - 0 0\n", | |
| 3098 | 3121 | "a re-saved v2 project differs only by its version, the lane \ |
| 3099 | 3122 | numbers, the streams it always meant and an equalizer it has none of" |
| 3100 | 3123 | ); |
| @@ -3123,7 +3146,7 @@ mod tests { | ||
| 3123 | 3146 | // Saved again it is the current version, which round-trips to the |
| 3124 | 3147 | // same document. |
| 3125 | 3148 | let v5 = flat(&dir, &back.sources, &back.lanes, back.playhead); |
| 3126 | - assert!(v5.starts_with(b"edith 21\n")); | |
| 3149 | + assert!(v5.starts_with(b"edith 22\n")); | |
| 3127 | 3150 | let again = parse(&v5, &dir).expect("v5 parses"); |
| 3128 | 3151 | assert_eq!(again.lanes, back.lanes); |
| 3129 | 3152 | // A dialect may not be mixed: lane lines under v1, `clip` under v2. |
| @@ -3234,8 +3257,8 @@ mod tests { | ||
| 3234 | 3257 | let bytes = std::fs::read(&path).expect("read back"); |
| 3235 | 3258 | assert_eq!( |
| 3236 | 3259 | String::from_utf8_lossy(&bytes), |
| 3237 | - "edith 21\nplayhead 0\nresolution 1280 720\nsource 1 a.mp4\n\ | |
| 3238 | - video 1 0 0 30 0 - - - fit 1000 0 0 0 - 0\naudio 1 0 0 30 0 - - - fit 1000 0 0 0 - 0\n" | |
| 3260 | + "edith 22\nplayhead 0\nresolution 1280 720\nsource 1 a.mp4\n\ | |
| 3261 | + video 1 0 0 30 0 - - - fit 1000 0 0 0 - 0 0\naudio 1 0 0 30 0 - - - fit 1000 0 0 0 - 0 0\n" | |
| 3239 | 3262 | ); |
| 3240 | 3263 | // Loading rejoins the *given* directory, so the file is reached by the |
| 3241 | 3264 | // way the project was opened -- the same file, through the link, still |
| @@ -3279,10 +3302,10 @@ mod tests { | ||
| 3279 | 3302 | #[test] |
| 3280 | 3303 | fn a_wrong_first_line_is_refused_by_name() { |
| 3281 | 3304 | let dir = PathBuf::from("/proj"); |
| 3282 | - let err = parse(b"edith 22\nsource 0 a.mp4\nvideo 0 0 5 0 -\n", &dir) | |
| 3305 | + let err = parse(b"edith 23\nsource 0 a.mp4\nvideo 0 0 5 0 -\n", &dir) | |
| 3283 | 3306 | .unwrap_err() |
| 3284 | 3307 | .to_string(); |
| 3285 | - assert_eq!(err, "line 1: unsupported version 22"); | |
| 3308 | + assert_eq!(err, "line 1: unsupported version 23"); | |
| 3286 | 3309 | for junk in [&b""[..], b"{}\n", b"source a.mp4\n"] { |
| 3287 | 3310 | assert_eq!( |
| 3288 | 3311 | parse(junk, &dir).unwrap_err().to_string(), |
crates/engine/src/export.rsmodified+7 -1
| @@ -2770,6 +2770,7 @@ fn run( | ||
| 2770 | 2770 | meta.height, |
| 2771 | 2771 | meta.frame_rate, |
| 2772 | 2772 | flags, |
| 2773 | + project.composite_viz_paint_at(span.start), | |
| 2773 | 2774 | )? |
| 2774 | 2775 | } else { |
| 2775 | 2776 | ClipDecoder::open(&entry.path, rate.source_at(in_frame), want)? |
| @@ -2839,6 +2840,7 @@ fn run( | ||
| 2839 | 2840 | meta.height, |
| 2840 | 2841 | meta.frame_rate, |
| 2841 | 2842 | project.composite_visualizer_at(b_start), |
| 2843 | + project.composite_viz_paint_at(b_start), | |
| 2842 | 2844 | )? |
| 2843 | 2845 | } else { |
| 2844 | 2846 | ClipDecoder::open(&entry.path, b_rate.source_at(b_in_frame), None)? |
| @@ -4424,6 +4426,7 @@ enum ClipDecoder { | ||
| 4424 | 4426 | fps: f64, |
| 4425 | 4427 | next: u32, |
| 4426 | 4428 | flags: u8, |
| 4429 | + paint: u32, | |
| 4427 | 4430 | y: Vec<u8>, |
| 4428 | 4431 | u: Vec<u8>, |
| 4429 | 4432 | v: Vec<u8>, |
| @@ -4537,6 +4540,7 @@ impl ClipDecoder { | ||
| 4537 | 4540 | height: u32, |
| 4538 | 4541 | fps: f64, |
| 4539 | 4542 | flags: u8, |
| 4543 | + paint: u32, | |
| 4540 | 4544 | ) -> crate::Result<Self> { |
| 4541 | 4545 | let peaks = crate::waveform::peaks(path, stream, crate::decode::VIZ_BUCKETS_PER_SEC) |
| 4542 | 4546 | .ok() |
| @@ -4550,6 +4554,7 @@ impl ClipDecoder { | ||
| 4550 | 4554 | fps, |
| 4551 | 4555 | next: start_frame, |
| 4552 | 4556 | flags, |
| 4557 | + paint, | |
| 4553 | 4558 | y: Vec::new(), |
| 4554 | 4559 | u: Vec::new(), |
| 4555 | 4560 | v: Vec::new(), |
| @@ -4571,12 +4576,13 @@ impl ClipDecoder { | ||
| 4571 | 4576 | fps, |
| 4572 | 4577 | next, |
| 4573 | 4578 | flags, |
| 4579 | + paint, | |
| 4574 | 4580 | y, |
| 4575 | 4581 | u, |
| 4576 | 4582 | v, |
| 4577 | 4583 | } => { |
| 4578 | 4584 | let (yy, uu, vv) = |
| 4579 | - crate::decode::visualizer_i420(peaks, f64::from(*next) / *fps, *width, *height, *flags); | |
| 4585 | + crate::decode::visualizer_i420(peaks, f64::from(*next) / *fps, *width, *height, *flags, *paint); | |
| 4580 | 4586 | *y = yy; |
| 4581 | 4587 | *u = uu; |
| 4582 | 4588 | *v = vv; |
crates/engine/src/playback.rsmodified+9 -0
| @@ -708,6 +708,7 @@ impl PlaybackSession { | ||
| 708 | 708 | fade_out: 0, |
| 709 | 709 | transition_out: 0, |
| 710 | 710 | visualizer: 0, |
| 711 | + viz_paint: 0, | |
| 711 | 712 | start: 0, |
| 712 | 713 | in_frame: 0, |
| 713 | 714 | out_frame: meta.frame_count, |
| @@ -799,6 +800,7 @@ impl PlaybackSession { | ||
| 799 | 800 | fade_out: 0, |
| 800 | 801 | transition_out: 0, |
| 801 | 802 | visualizer: 0, |
| 803 | + viz_paint: 0, | |
| 802 | 804 | start: 0, |
| 803 | 805 | in_frame: 0, |
| 804 | 806 | out_frame: place_frames(meta.frame_count, IMAGE_ONLY_RATE), |
| @@ -1864,6 +1866,7 @@ impl PlaybackSession { | ||
| 1864 | 1866 | self.project.composite_fit_at(start), |
| 1865 | 1867 | ), |
| 1866 | 1868 | self.project.composite_visualizer_at(start), |
| 1869 | + self.project.composite_viz_paint_at(start), | |
| 1867 | 1870 | ) |
| 1868 | 1871 | .inspect_err(|e| { |
| 1869 | 1872 | eprintln!("timeline frame {start}: visualizer open failed: {e}") |
| @@ -2981,6 +2984,10 @@ impl PlaybackSession { | ||
| 2981 | 2984 | self.edit(Dirty::Picture, |p| p.set_visualizer(lane, idx, flags)) |
| 2982 | 2985 | } |
| 2983 | 2986 | |
| 2987 | + pub fn set_viz_paint(&mut self, lane: Lane, idx: usize, paint: u32) -> bool { | |
| 2988 | + self.edit(Dirty::Picture, |p| p.set_viz_paint(lane, idx, paint)) | |
| 2989 | + } | |
| 2990 | + | |
| 2984 | 2991 | /// Timeline frames of ramp-up from silence at the start of the clip at |
| 2985 | 2992 | /// `idx` of `lane`. `0` for an index that is not there. |
| 2986 | 2993 | pub fn fade_in_of(&self, lane: Lane, idx: usize) -> u32 { |
| @@ -3113,6 +3120,7 @@ impl PlaybackSession { | ||
| 3113 | 3120 | fade_out: 0, |
| 3114 | 3121 | transition_out: 0, |
| 3115 | 3122 | visualizer: 0, |
| 3123 | + viz_paint: 0, | |
| 3116 | 3124 | start: 0, |
| 3117 | 3125 | in_frame: 0, |
| 3118 | 3126 | out_frame: match image { |
| @@ -3307,6 +3315,7 @@ impl PlaybackSession { | ||
| 3307 | 3315 | fade_out: 0, |
| 3308 | 3316 | transition_out: 0, |
| 3309 | 3317 | visualizer: 1, |
| 3318 | + viz_paint: 0, | |
| 3310 | 3319 | start: 0, |
| 3311 | 3320 | in_frame, |
| 3312 | 3321 | out_frame, |
crates/engine/src/project.rsmodified+32 -3
| @@ -457,10 +457,14 @@ pub struct Clip { | ||
| 457 | 457 | /// because a clip's own length is checked beside it. |
| 458 | 458 | pub transition_out: u32, |
| 459 | 459 | /// Non-zero: this clip is a waveform of its source's sound, painted |
| 460 | - /// onto a video lane. Bit 0 is the flag itself; 1 outline, 2 smooth, | |
| 461 | - /// 3 fast window, 4 tint. Zero is an ordinary picture. Older project | |
| 462 | - /// files have no field and mean zero. | |
| 460 | + /// onto a video lane. Bit 0 is the flag; bits 1-2 style; bit 3 fast. | |
| 461 | + /// Zero is an ordinary picture. Older project files have no field and | |
| 462 | + /// mean zero. | |
| 463 | 463 | pub visualizer: u8, |
| 464 | + /// Packed look: hue 0-255, sat 0-255, strands 0-255, glow 0-255. | |
| 465 | + /// All-zero is the default (timeline azure, full sat, 8 strands, glow 2). | |
| 466 | + /// Older files have no field and mean zero. | |
| 467 | + pub viz_paint: u32, | |
| 464 | 468 | } |
| 465 | 469 | |
| 466 | 470 | impl Clip { |
| @@ -947,6 +951,7 @@ impl Project { | ||
| 947 | 951 | fade_out: 0, |
| 948 | 952 | transition_out: 0, |
| 949 | 953 | visualizer: 0, |
| 954 | + viz_paint: 0, | |
| 950 | 955 | start: 0, |
| 951 | 956 | in_frame: 0, |
| 952 | 957 | out_frame: frame_count.max(1), |
| @@ -1347,6 +1352,7 @@ impl Project { | ||
| 1347 | 1352 | fade_out: 0, |
| 1348 | 1353 | transition_out: 0, |
| 1349 | 1354 | visualizer: 0, |
| 1355 | + viz_paint: 0, | |
| 1350 | 1356 | start, |
| 1351 | 1357 | in_frame: 0, |
| 1352 | 1358 | out_frame: frame_count.max(1), |
| @@ -2647,6 +2653,15 @@ impl Project { | ||
| 2647 | 2653 | true |
| 2648 | 2654 | } |
| 2649 | 2655 | |
| 2656 | + pub fn set_viz_paint(&mut self, lane: Lane, idx: usize, paint: u32) -> bool { | |
| 2657 | + if idx >= self.lane(lane).len() { | |
| 2658 | + return false; | |
| 2659 | + } | |
| 2660 | + self.snapshot(); | |
| 2661 | + self.lane_mut(lane).expect("checked above")[idx].viz_paint = paint; | |
| 2662 | + true | |
| 2663 | + } | |
| 2664 | + | |
| 2650 | 2665 | /// Timeline frames of ramp-up from silence at the start of the clip at |
| 2651 | 2666 | /// `idx` of `lane`. `0` for an index that is not there, same as a clip |
| 2652 | 2667 | /// that has none. |
| @@ -3034,6 +3049,12 @@ impl Project { | ||
| 3034 | 3049 | .unwrap_or(0) |
| 3035 | 3050 | } |
| 3036 | 3051 | |
| 3052 | + pub fn composite_viz_paint_at(&self, timeline_frame: u32) -> u32 { | |
| 3053 | + self.composite_clip_at(timeline_frame) | |
| 3054 | + .map(|(lane, idx)| self.lane(lane)[idx].viz_paint) | |
| 3055 | + .unwrap_or(0) | |
| 3056 | + } | |
| 3057 | + | |
| 3037 | 3058 | /// [`spans_from`](Project::spans_from) over the composite: every stretch the |
| 3038 | 3059 | /// viewer sees from `timeline_frame` to the end, in order. What an export |
| 3039 | 3060 | /// encodes and what playback walks at a clip boundary. |
| @@ -5711,6 +5732,7 @@ mod tests { | ||
| 5711 | 5732 | fade_out: 0, |
| 5712 | 5733 | transition_out: 0, |
| 5713 | 5734 | visualizer: 0, |
| 5735 | + viz_paint: 0, | |
| 5714 | 5736 | start, |
| 5715 | 5737 | in_frame, |
| 5716 | 5738 | out_frame, |
| @@ -7222,6 +7244,7 @@ mod tests { | ||
| 7222 | 7244 | fade_out: 0, |
| 7223 | 7245 | transition_out: 0, |
| 7224 | 7246 | visualizer: 0, |
| 7247 | + viz_paint: 0, | |
| 7225 | 7248 | start: 0, |
| 7226 | 7249 | in_frame: 100, |
| 7227 | 7250 | out_frame: 102, |
| @@ -7299,6 +7322,7 @@ mod tests { | ||
| 7299 | 7322 | fade_out: 0, |
| 7300 | 7323 | transition_out: 0, |
| 7301 | 7324 | visualizer: 0, |
| 7325 | + viz_paint: 0, | |
| 7302 | 7326 | source: wav, |
| 7303 | 7327 | ..PASTED |
| 7304 | 7328 | }; |
| @@ -8014,6 +8038,7 @@ mod tests { | ||
| 8014 | 8038 | fade_out: 0, |
| 8015 | 8039 | transition_out: 0, |
| 8016 | 8040 | visualizer: 0, |
| 8041 | + viz_paint: 0, | |
| 8017 | 8042 | start, |
| 8018 | 8043 | in_frame, |
| 8019 | 8044 | out_frame, |
| @@ -9123,6 +9148,7 @@ mod tests { | ||
| 9123 | 9148 | fade_out: 0, |
| 9124 | 9149 | transition_out: 0, |
| 9125 | 9150 | visualizer: 0, |
| 9151 | + viz_paint: 0, | |
| 9126 | 9152 | eq: Some(i), |
| 9127 | 9153 | ..video[0] |
| 9128 | 9154 | }] |
| @@ -9166,6 +9192,7 @@ mod tests { | ||
| 9166 | 9192 | fade_out: 0, |
| 9167 | 9193 | transition_out: 0, |
| 9168 | 9194 | visualizer: 0, |
| 9195 | + viz_paint: 0, | |
| 9169 | 9196 | color: Some(i), |
| 9170 | 9197 | fit: FitPolicy::default(), |
| 9171 | 9198 | speed: Speed::NORMAL, |
| @@ -9231,6 +9258,7 @@ mod tests { | ||
| 9231 | 9258 | fade_out: 0, |
| 9232 | 9259 | transition_out: 0, |
| 9233 | 9260 | visualizer: 0, |
| 9261 | + viz_paint: 0, | |
| 9234 | 9262 | start, |
| 9235 | 9263 | in_frame, |
| 9236 | 9264 | out_frame, |
| @@ -10030,6 +10058,7 @@ mod tests { | ||
| 10030 | 10058 | fade_out: 0, |
| 10031 | 10059 | transition_out: 0, |
| 10032 | 10060 | visualizer: 0, |
| 10061 | + viz_paint: 0, | |
| 10033 | 10062 | start, |
| 10034 | 10063 | in_frame: start, |
| 10035 | 10064 | out_frame: end, |
crates/engine/src/proxy.rsmodified+1 -0
| @@ -560,6 +560,7 @@ fn started( | ||
| 560 | 560 | fade_out: 0, |
| 561 | 561 | transition_out: 0, |
| 562 | 562 | visualizer: 0, |
| 563 | + viz_paint: 0, | |
| 563 | 564 | start: 0, |
| 564 | 565 | in_frame: 0, |
| 565 | 566 | out_frame: meta.frame_count.max(1), |
crates/engine/src/silence.rsmodified+1 -0
| @@ -323,6 +323,7 @@ mod tests { | ||
| 323 | 323 | fade_out: 0, |
| 324 | 324 | transition_out: 0, |
| 325 | 325 | visualizer: 0, |
| 326 | + viz_paint: 0, | |
| 326 | 327 | start, |
| 327 | 328 | in_frame, |
| 328 | 329 | out_frame, |
crates/engine/src/sweep.rsmodified+1 -0
| @@ -70,6 +70,7 @@ fn clip(start: u32, in_frame: u32, out_frame: u32) -> Clip { | ||
| 70 | 70 | fade_out: 0, |
| 71 | 71 | transition_out: 0, |
| 72 | 72 | visualizer: 0, |
| 73 | + viz_paint: 0, | |
| 73 | 74 | start, |
| 74 | 75 | in_frame, |
| 75 | 76 | out_frame, |
crates/engine/tests/audio_export.rsmodified+11 -0
| @@ -65,6 +65,7 @@ fn mixed_project() -> Project { | ||
| 65 | 65 | fade_out: 0, |
| 66 | 66 | transition_out: 0, |
| 67 | 67 | visualizer: 0, |
| 68 | + viz_paint: 0, | |
| 68 | 69 | start, |
| 69 | 70 | in_frame: 0, |
| 70 | 71 | out_frame: 30, |
| @@ -92,6 +93,7 @@ fn mixed_project() -> Project { | ||
| 92 | 93 | fade_out: 0, |
| 93 | 94 | transition_out: 0, |
| 94 | 95 | visualizer: 0, |
| 96 | + viz_paint: 0, | |
| 95 | 97 | start: 0, |
| 96 | 98 | in_frame: 0, |
| 97 | 99 | out_frame: 90, |
| @@ -342,6 +344,7 @@ fn a_still_and_a_song_export_as_an_mp4_with_sound() { | ||
| 342 | 344 | fade_out: 0, |
| 343 | 345 | transition_out: 0, |
| 344 | 346 | visualizer: 0, |
| 347 | + viz_paint: 0, | |
| 345 | 348 | start: 0, |
| 346 | 349 | in_frame: 0, |
| 347 | 350 | out_frame: frames, |
| @@ -412,6 +415,7 @@ fn a_fader_is_one_tracks_own_and_the_limiter_holds_the_sum() { | ||
| 412 | 415 | fade_out: 0, |
| 413 | 416 | transition_out: 0, |
| 414 | 417 | visualizer: 0, |
| 418 | + viz_paint: 0, | |
| 415 | 419 | start: 0, |
| 416 | 420 | in_frame: 0, |
| 417 | 421 | out_frame: 30, |
| @@ -654,6 +658,7 @@ fn the_sound_is_written_at_the_rate_that_was_asked_for() { | ||
| 654 | 658 | fade_out: 0, |
| 655 | 659 | transition_out: 0, |
| 656 | 660 | visualizer: 0, |
| 661 | + viz_paint: 0, | |
| 657 | 662 | start: 0, |
| 658 | 663 | in_frame: 0, |
| 659 | 664 | out_frame: 60, |
| @@ -673,6 +678,7 @@ fn the_sound_is_written_at_the_rate_that_was_asked_for() { | ||
| 673 | 678 | fade_out: 0, |
| 674 | 679 | transition_out: 0, |
| 675 | 680 | visualizer: 0, |
| 681 | + viz_paint: 0, | |
| 676 | 682 | start: 0, |
| 677 | 683 | in_frame: 0, |
| 678 | 684 | out_frame: 60, |
| @@ -734,6 +740,7 @@ fn a_silent_clip_exports_as_silence_over_its_own_span() { | ||
| 734 | 740 | fade_out: 0, |
| 735 | 741 | transition_out: 0, |
| 736 | 742 | visualizer: 0, |
| 743 | + viz_paint: 0, | |
| 737 | 744 | start, |
| 738 | 745 | in_frame: 0, |
| 739 | 746 | out_frame: 30, |
| @@ -832,6 +839,7 @@ fn a_51_ac3_source_round_trips_through_a_wav() { | ||
| 832 | 839 | fade_out: 0, |
| 833 | 840 | transition_out: 0, |
| 834 | 841 | visualizer: 0, |
| 842 | + viz_paint: 0, | |
| 835 | 843 | start: 0, |
| 836 | 844 | in_frame: 0, |
| 837 | 845 | out_frame: 30, |
| @@ -966,6 +974,7 @@ fn a_fade_in_reaches_the_exported_audio() { | ||
| 966 | 974 | fade_out: 0, |
| 967 | 975 | transition_out: 0, |
| 968 | 976 | visualizer: 0, |
| 977 | + viz_paint: 0, | |
| 969 | 978 | start: 0, |
| 970 | 979 | in_frame: 0, |
| 971 | 980 | out_frame: 90, // 3.0 s at 30 fps |
| @@ -1052,6 +1061,7 @@ fn a_split_and_crossfaded_clip_has_no_muted_interior() { | ||
| 1052 | 1061 | fade_out: 0, |
| 1053 | 1062 | transition_out: 0, |
| 1054 | 1063 | visualizer: 0, |
| 1064 | + viz_paint: 0, | |
| 1055 | 1065 | start, |
| 1056 | 1066 | in_frame, |
| 1057 | 1067 | out_frame, |
| @@ -1159,6 +1169,7 @@ fn a_mono_timeline_exports_as_dual_mono_ogg() { | ||
| 1159 | 1169 | fade_out: 0, |
| 1160 | 1170 | transition_out: 0, |
| 1161 | 1171 | visualizer: 0, |
| 1172 | + viz_paint: 0, | |
| 1162 | 1173 | start: 0, |
| 1163 | 1174 | in_frame: 0, |
| 1164 | 1175 | out_frame: 30, |
crates/engine/tests/audio_files.rsmodified+1 -0
| @@ -421,6 +421,7 @@ fn a_silent_first_source_does_not_stop_the_scan_for_one_with_sound() { | ||
| 421 | 421 | fade_out: 0, |
| 422 | 422 | transition_out: 0, |
| 423 | 423 | visualizer: 0, |
| 424 | + viz_paint: 0, | |
| 424 | 425 | start: 0, |
| 425 | 426 | in_frame: 0, |
| 426 | 427 | out_frame: meta1.frame_count, |
crates/engine/tests/eq_audio.rsmodified+1 -0
| @@ -58,6 +58,7 @@ fn clip(start: u32, source: usize, frames: u32) -> Clip { | ||
| 58 | 58 | fade_out: 0, |
| 59 | 59 | transition_out: 0, |
| 60 | 60 | visualizer: 0, |
| 61 | + viz_paint: 0, | |
| 61 | 62 | start, |
| 62 | 63 | in_frame: 0, |
| 63 | 64 | out_frame: frames, |
crates/engine/tests/export.rsmodified+2 -0
| @@ -241,6 +241,7 @@ fn exports_at_the_project_resolution_with_the_watched_geometry() { | ||
| 241 | 241 | fade_out: 0, |
| 242 | 242 | transition_out: 0, |
| 243 | 243 | visualizer: 0, |
| 244 | + viz_paint: 0, | |
| 244 | 245 | start, |
| 245 | 246 | in_frame: 0, |
| 246 | 247 | out_frame: 10, |
| @@ -329,6 +330,7 @@ fn exports_the_audio_stream_the_timeline_plays() { | ||
| 329 | 330 | fade_out: 0, |
| 330 | 331 | transition_out: 0, |
| 331 | 332 | visualizer: 0, |
| 333 | + viz_paint: 0, | |
| 332 | 334 | start: 0, |
| 333 | 335 | in_frame: 0, |
| 334 | 336 | out_frame: meta.frame_count, |
crates/engine/tests/lanes.rsmodified+2 -0
| @@ -238,6 +238,7 @@ fn the_mp4_copy_follows_the_lane_that_holds_the_sound() { | ||
| 238 | 238 | fade_in: 0, |
| 239 | 239 | transition_out: 0, |
| 240 | 240 | visualizer: 0, |
| 241 | + viz_paint: 0, | |
| 241 | 242 | fade_out: 0, |
| 242 | 243 | start: 0, |
| 243 | 244 | in_frame: 0, |
| @@ -306,6 +307,7 @@ fn two_audio_lanes_are_summed() { | ||
| 306 | 307 | fade_out: 0, |
| 307 | 308 | transition_out: 0, |
| 308 | 309 | visualizer: 0, |
| 310 | + viz_paint: 0, | |
| 309 | 311 | start: TOP_IN, |
| 310 | 312 | in_frame: TOP_IN, |
| 311 | 313 | out_frame: TOP_OUT, |
crates/engine/tests/opus_export.rsmodified+2 -0
| @@ -86,6 +86,7 @@ fn project(video: &Path, sound: &Path, sound_in: u32) -> Project { | ||
| 86 | 86 | fade_out: 0, |
| 87 | 87 | transition_out: 0, |
| 88 | 88 | visualizer: 0, |
| 89 | + viz_paint: 0, | |
| 89 | 90 | start: 0, |
| 90 | 91 | in_frame, |
| 91 | 92 | out_frame, |
| @@ -471,6 +472,7 @@ fn a_copied_picture_names_the_sound_it_was_written_with() { | ||
| 471 | 472 | fade_out: 0, |
| 472 | 473 | transition_out: 0, |
| 473 | 474 | visualizer: 0, |
| 475 | + viz_paint: 0, | |
| 474 | 476 | start: 0, |
| 475 | 477 | in_frame: 0, |
| 476 | 478 | out_frame, |
crates/engine/tests/silence.rsmodified+2 -0
| @@ -142,6 +142,7 @@ fn speed_mode_refuses_a_clip_that_laps_over_a_silence() { | ||
| 142 | 142 | fade_out: 0, |
| 143 | 143 | transition_out: 0, |
| 144 | 144 | visualizer: 0, |
| 145 | + viz_paint: 0, | |
| 145 | 146 | start: 0, |
| 146 | 147 | in_frame: 0, |
| 147 | 148 | out_frame: 20, |
| @@ -182,6 +183,7 @@ fn whole(source: usize, frames: u32) -> Clip { | ||
| 182 | 183 | fade_out: 0, |
| 183 | 184 | transition_out: 0, |
| 184 | 185 | visualizer: 0, |
| 186 | + viz_paint: 0, | |
| 185 | 187 | start: 0, |
| 186 | 188 | in_frame: 0, |
| 187 | 189 | out_frame: frames, |