forge
Explore
Log in

Don't you dare go Hollow

Stable envelope height, full hue/sat, strands and glow

Browse files at this commit

7ebfc448b47be34f9de8364967e1cee4a15c244fAhmet Kaan GümüşParent: 92b906f
  • feat
    • stable envelope height, full hue/sat, strands and glow
Show full message
✨ feat(audio): stable envelope height, full hue/sat, strands and glow

The 2s window no longer rescales to its own peak, so a bump keeps its
height as it enters and leaves. Colour is a 64-stop hue bar plus sat
(white→full). Strands and glow go from one line to the dense ring.
Packed on Clip.viz_paint; dialect v22.
crates/app/src/player/library.rsmodified+31 -2
@@ -223,7 +223,36 @@ impl Player {
223223 cx.notify();
224224 }
225225
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+
226239 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) {
227256 let Some((lane, idx)) = self.selected.anchor() else {
228257 return;
229258 };
@@ -236,8 +265,8 @@ impl Player {
236265 if clip.visualizer & 1 == 0 {
237266 return;
238267 }
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) {
241270 self.reset_after_reseek();
242271 }
243272 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() {
13831383 fade_out,
13841384 transition_out,
13851385 visualizer: 0,
1386+ viz_paint: 0,
13861387 }
13871388 }
13881389 // 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() {
631631 fade_out: 0,
632632 transition_out: 0,
633633 visualizer: 0,
634+ viz_paint: 0,
634635 start: 30,
635636 in_frame: 0,
636637 out_frame: 60,
@@ -1066,6 +1067,7 @@ fn a_menu_offers_only_what_applies_and_is_drawn_inside_the_window() {
10661067 fade_out: 0,
10671068 transition_out: 0,
10681069 visualizer: 0,
1070+ viz_paint: 0,
10691071 start: 30,
10701072 in_frame: 0,
10711073 out_frame: 60,
@@ -1798,6 +1800,7 @@ fn a_copied_clip_is_renumbered_or_dropped_when_a_row_leaves_the_library() {
17981800 fade_out: 0,
17991801 transition_out: 0,
18001802 visualizer: 0,
1803+ viz_paint: 0,
18011804 start: 0,
18021805 in_frame: 0,
18031806 out_frame: 30,
@@ -1951,6 +1954,7 @@ fn trim_to_playhead_needs_a_subject_cut_with_the_playhead_on_it() {
19511954 fade_out: 0,
19521955 transition_out: 0,
19531956 visualizer: 0,
1957+ viz_paint: 0,
19541958 start: 100,
19551959 in_frame: 0,
19561960 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() {
747747 fade_out: 0,
748748 transition_out: 0,
749749 visualizer: 0,
750+ viz_paint: 0,
750751 start,
751752 in_frame: 0,
752753 out_frame: 30,
@@ -3565,6 +3566,7 @@ fn the_cut_readout_counts_from_the_playhead() {
35653566 fade_out: 0,
35663567 transition_out: 0,
35673568 visualizer: 0,
3569+ viz_paint: 0,
35683570 start,
35693571 in_frame: 0,
35703572 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() {
158158 fade_out: 0,
159159 transition_out: 0,
160160 visualizer: 0,
161+ viz_paint: 0,
161162 start,
162163 in_frame: 0,
163164 out_frame: frames,
crates/app/src/timeline_math.rsmodified+1 -0
@@ -889,6 +889,7 @@ mod drop_landing_tests {
889889 fade_out: 0,
890890 transition_out: 0,
891891 visualizer: 0,
892+ viz_paint: 0,
892893 start,
893894 in_frame: 0,
894895 out_frame: frames,
crates/app/src/ui/dock_stance.rsmodified+159 -90
@@ -189,7 +189,7 @@ fn dock_tab(
189189 .children(hitmap::control(id, label_text, true))
190190 .child(
191191 div()
192- .font(style.font)
192+ .font(style.font.clone())
193193 .text_size(style.size)
194194 .text_color(rgb(if active { INK1() } else { INK3() }))
195195 .child(label_text),
@@ -201,7 +201,7 @@ fn section_head(text: impl Into<SharedString>) -> impl IntoElement {
201201 let style = head();
202202 div()
203203 .flex_none()
204- .font(style.font)
204+ .font(style.font.clone())
205205 .text_size(style.size)
206206 .text_color(rgb(INK3()))
207207 .child(text.into())
@@ -449,7 +449,7 @@ fn source_row(
449449 // usage moved down to the metadata line.
450450 .min_w(relative(0.6))
451451 .truncate()
452- .font(style.font)
452+ .font(style.font.clone())
453453 .text_size(style.size)
454454 .text_color(rgb(INK1()))
455455 .child(name)
@@ -526,7 +526,7 @@ fn source_row(
526526 div()
527527 .pl(px(14.))
528528 .truncate()
529- .font(style.font)
529+ .font(style.font.clone())
530530 .text_size(style.size)
531531 .text_color(rgb(INK3()))
532532 .child(under)
@@ -1022,7 +1022,7 @@ fn sources_tab(
10221022 .id("dock-filter")
10231023 .flex_none()
10241024 .cursor_text()
1025- .font(style.font)
1025+ .font(style.font.clone())
10261026 .text_size(style.size)
10271027 .text_color(rgb(if player.dock_filter_edit {
10281028 INK1()
@@ -1059,7 +1059,7 @@ fn sources_tab(
10591059 let style = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM);
10601060 d.child(
10611061 div()
1062- .font(style.font)
1062+ .font(style.font.clone())
10631063 .text_size(style.size)
10641064 .text_color(rgb(INK3()))
10651065 // One noun for both empties -- nothing imported and
@@ -1187,34 +1187,17 @@ fn transition_row(player: &Player, cx: &mut Context<Player>) -> Option<impl Into
11871187 /// these onto. Drag-while-playing and every other gesture on a row is
11881188 /// whatever that card already does; nothing about the gesture is reimplemented
11891189 /// 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-
12091190 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)| {
12111192 let session = player.session.as_ref()?;
12121193 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)
12141195 });
1215- let Some(flags) = flags else {
1196+ let Some(clip) = clip else {
12161197 return div().id("dock-viz-styles");
12171198 };
1199+ let flags = clip.visualizer;
1200+ let paint = clip.viz_paint;
12181201 let pick = |id: &'static str, label_text: &'static str, style: u8, on: bool| {
12191202 let row = label(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM);
12201203 div()
@@ -1250,7 +1233,7 @@ fn viz_style_verbs(player: &Player, cx: &mut Context<Player>) -> impl IntoElemen
12501233 .items_center()
12511234 .cursor_pointer()
12521235 .text_color(rgb(if on { INK1() } else { INK3() }))
1253- .font(style.font)
1236+ .font(style.font.clone())
12541237 .text_size(style.size)
12551238 .children(hitmap::control(id, label_text, true))
12561239 .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {
@@ -1299,82 +1282,168 @@ fn viz_style_verbs(player: &Player, cx: &mut Context<Player>) -> impl IntoElemen
12991282 engine::decode::VIZ_FAST,
13001283 flags & engine::decode::VIZ_FAST != 0,
13011284 ))
1302- .child(viz_hue_row(flags, cx))
1285+ .child(viz_paint_knobs(paint, cx))
13031286 }
13041287
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 {
13361294 div()
1337- .id("dock-viz-hue")
1338- .flex_none()
1295+ .id(id)
13391296 .flex()
1297+ .w(px(HIT_MIN))
1298+ .h(px(HIT_MIN))
13401299 .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()
13411318 .gap(px(4.))
1342- .h(px(CONTROL_H))
13431319 .px(px(8.))
13441320 .child(
13451321 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+ })),
13501365 )
1351- .child(step("dock-viz-hue-minus", "−", -1, cx))
13521366 .child(
13531367 div()
1354- .id("dock-viz-hue-swatches")
1355- .flex_1()
13561368 .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(
13611373 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);
13751445 })),
13761446 )
1377- .child(step("dock-viz-hue-plus", "+", 1, cx))
13781447 }
13791448
13801449 fn clip_tab(
@@ -1614,7 +1683,7 @@ fn keys_tab(player: &Player, cx: &mut Context<Player>) -> impl IntoElement {
16141683 .id("dock-keys-filter")
16151684 .flex_none()
16161685 .cursor_text()
1617- .font(style.font)
1686+ .font(style.font.clone())
16181687 .text_size(style.size)
16191688 .text_color(rgb(INK1()))
16201689 .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) {
864864 fade_out: 0,
865865 transition_out: 0,
866866 visualizer: 0,
867+ viz_paint: 0,
867868 start: 0,
868869 in_frame,
869870 out_frame: in_frame + span,
crates/engine/src/decode.rsmodified+82 -13
@@ -56,6 +56,7 @@ pub enum Backend {
5656 /// A gap: black frames, nothing decoded at all.
5757 Gap,
5858 /// A waveform visualizer: the picture is painted from the audio's peaks
59+ /// A waveform viz_paint: 0,
5960 /// ([`visualizer_i420`]), no decoder seat and no stream of pictures at all.
6061 Visualizer,
6162 }
@@ -629,6 +630,7 @@ impl DecodeSession {
629630 transform: TransformParams,
630631 canvas: Composer,
631632 flags: u8,
633+ paint: u32,
632634 ) -> crate::Result<FrameStream> {
633635 let (tx, rx) = sync_channel(2);
634636 let cancel = Arc::new(AtomicBool::new(false));
@@ -679,7 +681,7 @@ impl DecodeSession {
679681 return;
680682 }
681683 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);
683685 let frame = render.frame(start_frame + index, &y, &u, &v, width, height);
684686 if tx.send(frame).is_err() {
685687 return; // caller moved on
@@ -1444,6 +1446,65 @@ pub fn viz_ink_rgb(hue: u8) -> (u8, u8, u8) {
14441446 hsv_to_rgb(212.0 + f32::from(hue & 15) * 22.5, 0.63, 0.84)
14451447 }
14461448
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+
14471508 fn hsv_to_rgb(h: f32, s: f32, v: f32) -> (u8, u8, u8) {
14481509 let h = ((h % 360.0) + 360.0) % 360.0;
14491510 let c = v * s;
@@ -1607,6 +1668,7 @@ pub(crate) fn visualizer_i420(
16071668 width: u32,
16081669 height: u32,
16091670 flags: u8,
1671+ paint: u32,
16101672 ) -> (Vec<u8>, Vec<u8>, Vec<u8>) {
16111673 let width = width & !1;
16121674 let height = height & !1;
@@ -1616,7 +1678,7 @@ pub(crate) fn visualizer_i420(
16161678 let mut y = vec![bg_y; w * h];
16171679 let mut u = vec![bg_u; cw * ch];
16181680 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);
16201682 let (ink_y, ink_u, ink_v) = rgb_yuv(ink_r as i32, ink_g as i32, ink_b as i32);
16211683 let center = h as f32 / 2.0;
16221684 let half = h as f32 * 0.42;
@@ -1669,15 +1731,18 @@ pub(crate) fn visualizer_i420(
16691731 let f = (pos - i as f64) as f32;
16701732 sig[col] = signed(i) + (signed(i.saturating_add(1)) - signed(i)) * f;
16711733 }
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
16731738 .iter()
1674- .zip(&hi)
1675- .map(|(l, h)| l.abs().max(h.abs()))
1739+ .map(|&(l, h)| l.abs().max(h.abs()))
16761740 .fold(0.0f32, f32::max);
16771741 if peak > 1e-4 {
16781742 for i in 0..w {
16791743 lo[i] /= peak;
16801744 hi[i] /= peak;
1745+ sig[i] /= peak;
16811746 }
16821747 }
16831748 viz_smooth(&mut lo, &mut hi);
@@ -1691,8 +1756,8 @@ pub(crate) fn visualizer_i420(
16911756 for col in 0..w {
16921757 let env = lo[col].abs().max(hi[col]).max(0.06);
16931758 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);
16961761 let scale = 0.28 + 0.72 * frac;
16971762 let wave = (x_phase + travel + s as f64 * 0.05).sin() as f32;
16981763 let row = (center + half * env * scale * wave).round() as i32;
@@ -1718,8 +1783,12 @@ pub(crate) fn visualizer_i420(
17181783 let amp = (w.min(h) as f32) * 0.18;
17191784 let tau = std::f32::consts::TAU;
17201785 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+ });
17231792 let (iy, iu, iv) = rgb_yuv(ir as i32, ig as i32, ib as i32);
17241793 let scale = 0.65 + 0.35 * f32::from(strand % 4) / 3.0;
17251794 let phase = f32::from(strand) * 0.35;
@@ -2104,7 +2173,7 @@ mod tests {
21042173 *p = (-a.abs(), a.abs());
21052174 }
21062175 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);
21082177 let ink = y.iter().filter(|&&p| p > 40).count();
21092178 assert!(ink > 200, "envelope missing: {ink}");
21102179 assert!(ink < y.len() * 9 / 10, "solid frame, not an envelope: {ink}");
@@ -2117,13 +2186,13 @@ mod tests {
21172186 assert!(blue > 10, "default ink was not timeline blue: {blue}");
21182187
21192188 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);
21212190 let ring_ink = yr.iter().filter(|&&p| p > 40).count();
21222191 assert!(ring_ink > 80, "ring missing: {ring_ink}");
21232192 assert!(ring_ink < ink, "ring should be a stroke, not a fill");
21242193
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);
21272196 let mut shifted = 0usize;
21282197 for i in 0..u2.len() {
21292198 if u2[i] < 120 && v2[i] > 130 {
crates/engine/src/edith.rsmodified+72 -49
@@ -118,7 +118,7 @@
118118 //! its fit policy already placed.
119119 //!
120120 //! 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>`:
122122 //! which lane the clip is on -- its kind and its 1-based number
123123 //! among the lanes of that kind, the [`crate::project::Lane::label`] a header
124124 //! column shows -- then where the clip sits on the timeline, the half-open
@@ -205,7 +205,7 @@
205205 //! nothing, and an older one plays everything at real time, and an older one
206206 //! mixes flat, and an older one shows no subtitles, and an older one is shown
207207 //! 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
209209 //! reader refuses a newer file by name.
210210 //!
211211 //! Text because an edit list is a few integers and a path, and a path is
@@ -242,7 +242,8 @@ use crate::transform::TransformParams;
242242
243243 /// What [`save`] writes. Read support goes back to `edith 1`; see the module
244244 /// 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";
246247 const MAGIC_V20: &[u8] = b"edith 20";
247248 const MAGIC_V19: &[u8] = b"edith 19";
248249 const MAGIC_V18: &[u8] = b"edith 18";
@@ -595,7 +596,7 @@ fn emit(
595596 let transform = c.transform.map_or("-".to_string(), |e| e.to_string());
596597 out.extend_from_slice(
597598 format!(
598- "{keyword} {ord} {} {} {} {} {link} {eq} {color} {} {} {} {} {} {transform} {}\n",
599+ "{keyword} {ord} {} {} {} {} {link} {eq} {color} {} {} {} {} {} {transform} {} {}\n",
599600 c.start,
600601 c.in_frame,
601602 c.out_frame,
@@ -606,6 +607,7 @@ fn emit(
606607 c.fade_out,
607608 c.transition_out,
608609 c.visualizer,
610+ c.viz_paint,
609611 )
610612 .as_bytes(),
611613 );
@@ -648,8 +650,10 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> {
648650 // The dialects that wrote a source line without its stream field. Reading
649651 // one is the whole of what "an old project still opens" means here.
650652 let streamless = v1 || first == MAGIC_V2;
653+ // The one that carries packed visualizer paint (hue/sat/strands/glow)...
654+ let v22 = first == MAGIC;
651655 // The one that carries per-clip visualizer flags...
652- let v21 = first == MAGIC;
656+ let v21 = v22 || first == MAGIC_V21;
653657 // The one that carries a per-clip transform (position/scale/rotate/crop)...
654658 let v20 = v21 || first == MAGIC_V20;
655659 // ...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> {
10531057 fade_out: 0,
10541058 transition_out: 0,
10551059 visualizer: 0,
1060+ viz_paint: 0,
10561061 start: queued,
10571062 in_frame: number(f[0], n)?,
10581063 out_frame: number(f[1], n)?,
@@ -1184,7 +1189,8 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> {
11841189 + 2 * usize::from(v18)
11851190 + usize::from(v19)
11861191 + usize::from(v20)
1187- + usize::from(v21);
1192+ + usize::from(v21)
1193+ + usize::from(v22);
11881194 let f = fields(rest, want, "clip", n)?;
11891195 let in_frame = number(f[1], n)?;
11901196 let out_frame = number(f[2], n)?;
@@ -1200,6 +1206,7 @@ fn parse(data: &[u8], dir: &Path) -> crate::Result<Document> {
12001206 fade_out: number(f.get(10).copied().unwrap_or(b"0"), n)?.min(frames),
12011207 transition_out: number(f.get(11).copied().unwrap_or(b"0"), n)?.min(frames),
12021208 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,
12031210 start: number(f[0], n)?,
12041211 in_frame,
12051212 out_frame,
@@ -1629,7 +1636,7 @@ mod tests {
16291636 video 1 0 0 30 0 - - - fit 1000\n";
16301637 let old = parse(v9, &dir).expect("v9 still loads");
16311638 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"));
16331640 // ...and the line itself is not a v9 line: a dialect may not be mixed.
16341641 let mixed = parse(b"edith 9\nsource 0 a.mp4\nsubtitle - subs.srt\n", &dir)
16351642 .unwrap_err()
@@ -2049,6 +2056,7 @@ mod tests {
20492056 fade_out: 0,
20502057 transition_out: 0,
20512058 visualizer: 0,
2059+ viz_paint: 0,
20522060 start,
20532061 in_frame,
20542062 out_frame,
@@ -2108,10 +2116,10 @@ mod tests {
21082116 let bytes = flat(&dir, &sources, &lanes, 12);
21092117 assert_eq!(
21102118 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\
21122120 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",
21152123 "the file under the project directory is written relative to it, \
21162124 each with the audio stream it plays"
21172125 );
@@ -2145,9 +2153,9 @@ mod tests {
21452153 let bytes = flat(&dir, &sources, &lanes, 7);
21462154 assert_eq!(
21472155 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",
21512159 "an empty lane is a line of its own; everything else is its clips"
21522160 );
21532161 let back = parse(&bytes, &dir).expect("parse");
@@ -2235,6 +2243,7 @@ mod tests {
22352243 fade_out: 0,
22362244 transition_out: 0,
22372245 visualizer: 0,
2246+ viz_paint: 0,
22382247 eq: Some(0),
22392248 ..clip(0, 0, 30, 0, Some(0))
22402249 },
@@ -2243,6 +2252,7 @@ mod tests {
22432252 fade_out: 0,
22442253 transition_out: 0,
22452254 visualizer: 0,
2255+ viz_paint: 0,
22462256 eq: Some(1),
22472257 ..clip(30, 10, 20, 0, None)
22482258 },
@@ -2253,6 +2263,7 @@ mod tests {
22532263 fade_out: 0,
22542264 transition_out: 0,
22552265 visualizer: 0,
2266+ viz_paint: 0,
22562267 eq: Some(0),
22572268 ..clip(0, 0, 30, 0, Some(0))
22582269 },
@@ -2261,6 +2272,7 @@ mod tests {
22612272 fade_out: 0,
22622273 transition_out: 0,
22632274 visualizer: 0,
2275+ viz_paint: 0,
22642276 eq: Some(2),
22652277 ..clip(30, 0, 10, 0, None)
22662278 },
@@ -2269,12 +2281,12 @@ mod tests {
22692281 let bytes = emit(&dir, &sources, &lanes, &eq, &[], (1280, 720), 0);
22702282 assert_eq!(
22712283 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\
22732285 eq 80.0:-3.0:0.707:ls 1000.0:4.5:1.0:pk\n\
22742286 eq 16777215.0:-0.1:3.918315e-39:hs\n\
22752287 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",
22782290 "the table comes before the clips, and a clip names a line of it"
22792291 );
22802292
@@ -2347,6 +2359,7 @@ mod tests {
23472359 fade_out: 0,
23482360 transition_out: 0,
23492361 visualizer: 0,
2362+ viz_paint: 0,
23502363 color: Some(0),
23512364 fit: FitPolicy::default(),
23522365 speed: Speed::NORMAL,
@@ -2357,6 +2370,7 @@ mod tests {
23572370 fade_out: 0,
23582371 transition_out: 0,
23592372 visualizer: 0,
2373+ viz_paint: 0,
23602374 color: Some(1),
23612375 fit: FitPolicy::default(),
23622376 speed: Speed::NORMAL,
@@ -2369,6 +2383,7 @@ mod tests {
23692383 fade_out: 0,
23702384 transition_out: 0,
23712385 visualizer: 0,
2386+ viz_paint: 0,
23722387 color: Some(0),
23732388 fit: FitPolicy::default(),
23742389 speed: Speed::NORMAL,
@@ -2379,6 +2394,7 @@ mod tests {
23792394 fade_out: 0,
23802395 transition_out: 0,
23812396 visualizer: 0,
2397+ viz_paint: 0,
23822398 color: Some(2),
23832399 fit: FitPolicy::default(),
23842400 speed: Speed::NORMAL,
@@ -2389,12 +2405,12 @@ mod tests {
23892405 let bytes = emit(&dir, &sources, &lanes, &[], &color, (1280, 720), 0);
23902406 assert_eq!(
23912407 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\
23932409 color 0.1:1.2:0.9:-0.3\n\
23942410 color -1e-7:16777215.0:3.918315e-39:-0.0\n\
23952411 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",
23982414 "the table comes before the clips, and a clip names a line of it"
23992415 );
24002416
@@ -2454,9 +2470,9 @@ mod tests {
24542470 (1280, 720),
24552471 old.playhead
24562472 )),
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\
24582474 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"
24602476 );
24612477 }
24622478
@@ -2473,6 +2489,7 @@ mod tests {
24732489 fade_out: 0,
24742490 transition_out: 0,
24752491 visualizer: 0,
2492+ viz_paint: 0,
24762493 start,
24772494 in_frame,
24782495 out_frame,
@@ -2497,9 +2514,9 @@ mod tests {
24972514 let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0);
24982515 assert_eq!(
24992516 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",
25032520 "the rate is the clip line's last field, in thousandths"
25042521 );
25052522 let back = parse(&bytes, &dir).expect("parse");
@@ -2526,8 +2543,8 @@ mod tests {
25262543 (1280, 720),
25272544 old.playhead
25282545 )),
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"
25312548 );
25322549 // A rate outside what the editor can set is a corrupt line, by name.
25332550 let bad = b"edith 8\nsource 0 a.mp4\nvideo 1 0 0 30 0 - - - fit 9000\n";
@@ -2561,6 +2578,7 @@ mod tests {
25612578 fade_out: 7,
25622579 transition_out: 0,
25632580 visualizer: 0,
2581+ viz_paint: 0,
25642582 start: 0,
25652583 in_frame: 0,
25662584 out_frame: 30,
@@ -2576,8 +2594,8 @@ mod tests {
25762594 let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0);
25772595 assert_eq!(
25782596 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",
25812599 "the fades are the clip line's last two fields"
25822600 );
25832601 let back = parse(&bytes, &dir).expect("parse");
@@ -2613,6 +2631,7 @@ mod tests {
26132631 fade_out: 0,
26142632 transition_out: 9,
26152633 visualizer: 0,
2634+ viz_paint: 0,
26162635 start: 0,
26172636 in_frame: 0,
26182637 out_frame: 30,
@@ -2628,8 +2647,8 @@ mod tests {
26282647 let bytes = emit(&dir, &sources, &lanes, &[], &[], (1280, 720), 0);
26292648 assert_eq!(
26302649 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",
26332652 "the dissolve is the clip line's own last field"
26342653 );
26352654 let back = parse(&bytes, &dir).expect("parse");
@@ -2701,6 +2720,7 @@ mod tests {
27012720 fade_out: 0,
27022721 transition_out: 0,
27032722 visualizer: 0,
2723+ viz_paint: 0,
27042724 transform: Some(0),
27052725 fit: FitPolicy::default(),
27062726 speed: Speed::NORMAL,
@@ -2711,6 +2731,7 @@ mod tests {
27112731 fade_out: 0,
27122732 transition_out: 0,
27132733 visualizer: 0,
2734+ viz_paint: 0,
27142735 transform: Some(1),
27152736 fit: FitPolicy::default(),
27162737 speed: Speed::NORMAL,
@@ -2723,6 +2744,7 @@ mod tests {
27232744 fade_out: 0,
27242745 transition_out: 0,
27252746 visualizer: 0,
2747+ viz_paint: 0,
27262748 transform: Some(0),
27272749 fit: FitPolicy::default(),
27282750 speed: Speed::NORMAL,
@@ -2733,6 +2755,7 @@ mod tests {
27332755 fade_out: 0,
27342756 transition_out: 0,
27352757 visualizer: 0,
2758+ viz_paint: 0,
27362759 transform: Some(2),
27372760 fit: FitPolicy::default(),
27382761 speed: Speed::NORMAL,
@@ -2762,12 +2785,12 @@ mod tests {
27622785 );
27632786 assert_eq!(
27642787 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\
27662789 transform 0.1:-0.2:1.5:90.0:0.1:0.0:0.0:0.05\n\
27672790 transform -1e-7:16777215.0:3.918315e-39:-0.0:0.0:0.0:0.0:0.0\n\
27682791 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",
27712794 "the table comes before the clips, and a clip names a line of it"
27722795 );
27732796
@@ -2842,10 +2865,10 @@ mod tests {
28422865 );
28432866 assert_eq!(
28442867 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\
28462869 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\
28492872 gain audio 1 3.0\ngain audio 2 -6.5\n",
28502873 "the mix is lines of its own, the gains after the lanes they name"
28512874 );
@@ -2874,8 +2897,8 @@ mod tests {
28742897 (1280, 720),
28752898 old.playhead
28762899 )),
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"
28792902 );
28802903
28812904 // Each of the three refuses by name, on its own line.
@@ -3038,10 +3061,10 @@ mod tests {
30383061 assert!(old.eq.is_empty(), "nothing before v5 equalizes anything");
30393062 assert_eq!(
30403063 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\
30423065 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"
30453068 );
30463069 // An empty lane's line is still the whole of that lane, eq or no eq.
30473070 let empty = parse(
@@ -3091,10 +3114,10 @@ mod tests {
30913114 let v5 = flat(&dir, &back.sources, &back.lanes, back.playhead);
30923115 assert_eq!(
30933116 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\
30953118 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",
30983121 "a re-saved v2 project differs only by its version, the lane \
30993122 numbers, the streams it always meant and an equalizer it has none of"
31003123 );
@@ -3123,7 +3146,7 @@ mod tests {
31233146 // Saved again it is the current version, which round-trips to the
31243147 // same document.
31253148 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"));
31273150 let again = parse(&v5, &dir).expect("v5 parses");
31283151 assert_eq!(again.lanes, back.lanes);
31293152 // A dialect may not be mixed: lane lines under v1, `clip` under v2.
@@ -3234,8 +3257,8 @@ mod tests {
32343257 let bytes = std::fs::read(&path).expect("read back");
32353258 assert_eq!(
32363259 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"
32393262 );
32403263 // Loading rejoins the *given* directory, so the file is reached by the
32413264 // way the project was opened -- the same file, through the link, still
@@ -3279,10 +3302,10 @@ mod tests {
32793302 #[test]
32803303 fn a_wrong_first_line_is_refused_by_name() {
32813304 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)
32833306 .unwrap_err()
32843307 .to_string();
3285- assert_eq!(err, "line 1: unsupported version 22");
3308+ assert_eq!(err, "line 1: unsupported version 23");
32863309 for junk in [&b""[..], b"{}\n", b"source a.mp4\n"] {
32873310 assert_eq!(
32883311 parse(junk, &dir).unwrap_err().to_string(),
crates/engine/src/export.rsmodified+7 -1
@@ -2770,6 +2770,7 @@ fn run(
27702770 meta.height,
27712771 meta.frame_rate,
27722772 flags,
2773+ project.composite_viz_paint_at(span.start),
27732774 )?
27742775 } else {
27752776 ClipDecoder::open(&entry.path, rate.source_at(in_frame), want)?
@@ -2839,6 +2840,7 @@ fn run(
28392840 meta.height,
28402841 meta.frame_rate,
28412842 project.composite_visualizer_at(b_start),
2843+ project.composite_viz_paint_at(b_start),
28422844 )?
28432845 } else {
28442846 ClipDecoder::open(&entry.path, b_rate.source_at(b_in_frame), None)?
@@ -4424,6 +4426,7 @@ enum ClipDecoder {
44244426 fps: f64,
44254427 next: u32,
44264428 flags: u8,
4429+ paint: u32,
44274430 y: Vec<u8>,
44284431 u: Vec<u8>,
44294432 v: Vec<u8>,
@@ -4537,6 +4540,7 @@ impl ClipDecoder {
45374540 height: u32,
45384541 fps: f64,
45394542 flags: u8,
4543+ paint: u32,
45404544 ) -> crate::Result<Self> {
45414545 let peaks = crate::waveform::peaks(path, stream, crate::decode::VIZ_BUCKETS_PER_SEC)
45424546 .ok()
@@ -4550,6 +4554,7 @@ impl ClipDecoder {
45504554 fps,
45514555 next: start_frame,
45524556 flags,
4557+ paint,
45534558 y: Vec::new(),
45544559 u: Vec::new(),
45554560 v: Vec::new(),
@@ -4571,12 +4576,13 @@ impl ClipDecoder {
45714576 fps,
45724577 next,
45734578 flags,
4579+ paint,
45744580 y,
45754581 u,
45764582 v,
45774583 } => {
45784584 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);
45804586 *y = yy;
45814587 *u = uu;
45824588 *v = vv;
crates/engine/src/playback.rsmodified+9 -0
@@ -708,6 +708,7 @@ impl PlaybackSession {
708708 fade_out: 0,
709709 transition_out: 0,
710710 visualizer: 0,
711+ viz_paint: 0,
711712 start: 0,
712713 in_frame: 0,
713714 out_frame: meta.frame_count,
@@ -799,6 +800,7 @@ impl PlaybackSession {
799800 fade_out: 0,
800801 transition_out: 0,
801802 visualizer: 0,
803+ viz_paint: 0,
802804 start: 0,
803805 in_frame: 0,
804806 out_frame: place_frames(meta.frame_count, IMAGE_ONLY_RATE),
@@ -1864,6 +1866,7 @@ impl PlaybackSession {
18641866 self.project.composite_fit_at(start),
18651867 ),
18661868 self.project.composite_visualizer_at(start),
1869+ self.project.composite_viz_paint_at(start),
18671870 )
18681871 .inspect_err(|e| {
18691872 eprintln!("timeline frame {start}: visualizer open failed: {e}")
@@ -2981,6 +2984,10 @@ impl PlaybackSession {
29812984 self.edit(Dirty::Picture, |p| p.set_visualizer(lane, idx, flags))
29822985 }
29832986
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+
29842991 /// Timeline frames of ramp-up from silence at the start of the clip at
29852992 /// `idx` of `lane`. `0` for an index that is not there.
29862993 pub fn fade_in_of(&self, lane: Lane, idx: usize) -> u32 {
@@ -3113,6 +3120,7 @@ impl PlaybackSession {
31133120 fade_out: 0,
31143121 transition_out: 0,
31153122 visualizer: 0,
3123+ viz_paint: 0,
31163124 start: 0,
31173125 in_frame: 0,
31183126 out_frame: match image {
@@ -3307,6 +3315,7 @@ impl PlaybackSession {
33073315 fade_out: 0,
33083316 transition_out: 0,
33093317 visualizer: 1,
3318+ viz_paint: 0,
33103319 start: 0,
33113320 in_frame,
33123321 out_frame,
crates/engine/src/project.rsmodified+32 -3
@@ -457,10 +457,14 @@ pub struct Clip {
457457 /// because a clip's own length is checked beside it.
458458 pub transition_out: u32,
459459 /// 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.
463463 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,
464468 }
465469
466470 impl Clip {
@@ -947,6 +951,7 @@ impl Project {
947951 fade_out: 0,
948952 transition_out: 0,
949953 visualizer: 0,
954+ viz_paint: 0,
950955 start: 0,
951956 in_frame: 0,
952957 out_frame: frame_count.max(1),
@@ -1347,6 +1352,7 @@ impl Project {
13471352 fade_out: 0,
13481353 transition_out: 0,
13491354 visualizer: 0,
1355+ viz_paint: 0,
13501356 start,
13511357 in_frame: 0,
13521358 out_frame: frame_count.max(1),
@@ -2647,6 +2653,15 @@ impl Project {
26472653 true
26482654 }
26492655
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+
26502665 /// Timeline frames of ramp-up from silence at the start of the clip at
26512666 /// `idx` of `lane`. `0` for an index that is not there, same as a clip
26522667 /// that has none.
@@ -3034,6 +3049,12 @@ impl Project {
30343049 .unwrap_or(0)
30353050 }
30363051
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+
30373058 /// [`spans_from`](Project::spans_from) over the composite: every stretch the
30383059 /// viewer sees from `timeline_frame` to the end, in order. What an export
30393060 /// encodes and what playback walks at a clip boundary.
@@ -5711,6 +5732,7 @@ mod tests {
57115732 fade_out: 0,
57125733 transition_out: 0,
57135734 visualizer: 0,
5735+ viz_paint: 0,
57145736 start,
57155737 in_frame,
57165738 out_frame,
@@ -7222,6 +7244,7 @@ mod tests {
72227244 fade_out: 0,
72237245 transition_out: 0,
72247246 visualizer: 0,
7247+ viz_paint: 0,
72257248 start: 0,
72267249 in_frame: 100,
72277250 out_frame: 102,
@@ -7299,6 +7322,7 @@ mod tests {
72997322 fade_out: 0,
73007323 transition_out: 0,
73017324 visualizer: 0,
7325+ viz_paint: 0,
73027326 source: wav,
73037327 ..PASTED
73047328 };
@@ -8014,6 +8038,7 @@ mod tests {
80148038 fade_out: 0,
80158039 transition_out: 0,
80168040 visualizer: 0,
8041+ viz_paint: 0,
80178042 start,
80188043 in_frame,
80198044 out_frame,
@@ -9123,6 +9148,7 @@ mod tests {
91239148 fade_out: 0,
91249149 transition_out: 0,
91259150 visualizer: 0,
9151+ viz_paint: 0,
91269152 eq: Some(i),
91279153 ..video[0]
91289154 }]
@@ -9166,6 +9192,7 @@ mod tests {
91669192 fade_out: 0,
91679193 transition_out: 0,
91689194 visualizer: 0,
9195+ viz_paint: 0,
91699196 color: Some(i),
91709197 fit: FitPolicy::default(),
91719198 speed: Speed::NORMAL,
@@ -9231,6 +9258,7 @@ mod tests {
92319258 fade_out: 0,
92329259 transition_out: 0,
92339260 visualizer: 0,
9261+ viz_paint: 0,
92349262 start,
92359263 in_frame,
92369264 out_frame,
@@ -10030,6 +10058,7 @@ mod tests {
1003010058 fade_out: 0,
1003110059 transition_out: 0,
1003210060 visualizer: 0,
10061+ viz_paint: 0,
1003310062 start,
1003410063 in_frame: start,
1003510064 out_frame: end,
crates/engine/src/proxy.rsmodified+1 -0
@@ -560,6 +560,7 @@ fn started(
560560 fade_out: 0,
561561 transition_out: 0,
562562 visualizer: 0,
563+ viz_paint: 0,
563564 start: 0,
564565 in_frame: 0,
565566 out_frame: meta.frame_count.max(1),
crates/engine/src/silence.rsmodified+1 -0
@@ -323,6 +323,7 @@ mod tests {
323323 fade_out: 0,
324324 transition_out: 0,
325325 visualizer: 0,
326+ viz_paint: 0,
326327 start,
327328 in_frame,
328329 out_frame,
crates/engine/src/sweep.rsmodified+1 -0
@@ -70,6 +70,7 @@ fn clip(start: u32, in_frame: u32, out_frame: u32) -> Clip {
7070 fade_out: 0,
7171 transition_out: 0,
7272 visualizer: 0,
73+ viz_paint: 0,
7374 start,
7475 in_frame,
7576 out_frame,
crates/engine/tests/audio_export.rsmodified+11 -0
@@ -65,6 +65,7 @@ fn mixed_project() -> Project {
6565 fade_out: 0,
6666 transition_out: 0,
6767 visualizer: 0,
68+ viz_paint: 0,
6869 start,
6970 in_frame: 0,
7071 out_frame: 30,
@@ -92,6 +93,7 @@ fn mixed_project() -> Project {
9293 fade_out: 0,
9394 transition_out: 0,
9495 visualizer: 0,
96+ viz_paint: 0,
9597 start: 0,
9698 in_frame: 0,
9799 out_frame: 90,
@@ -342,6 +344,7 @@ fn a_still_and_a_song_export_as_an_mp4_with_sound() {
342344 fade_out: 0,
343345 transition_out: 0,
344346 visualizer: 0,
347+ viz_paint: 0,
345348 start: 0,
346349 in_frame: 0,
347350 out_frame: frames,
@@ -412,6 +415,7 @@ fn a_fader_is_one_tracks_own_and_the_limiter_holds_the_sum() {
412415 fade_out: 0,
413416 transition_out: 0,
414417 visualizer: 0,
418+ viz_paint: 0,
415419 start: 0,
416420 in_frame: 0,
417421 out_frame: 30,
@@ -654,6 +658,7 @@ fn the_sound_is_written_at_the_rate_that_was_asked_for() {
654658 fade_out: 0,
655659 transition_out: 0,
656660 visualizer: 0,
661+ viz_paint: 0,
657662 start: 0,
658663 in_frame: 0,
659664 out_frame: 60,
@@ -673,6 +678,7 @@ fn the_sound_is_written_at_the_rate_that_was_asked_for() {
673678 fade_out: 0,
674679 transition_out: 0,
675680 visualizer: 0,
681+ viz_paint: 0,
676682 start: 0,
677683 in_frame: 0,
678684 out_frame: 60,
@@ -734,6 +740,7 @@ fn a_silent_clip_exports_as_silence_over_its_own_span() {
734740 fade_out: 0,
735741 transition_out: 0,
736742 visualizer: 0,
743+ viz_paint: 0,
737744 start,
738745 in_frame: 0,
739746 out_frame: 30,
@@ -832,6 +839,7 @@ fn a_51_ac3_source_round_trips_through_a_wav() {
832839 fade_out: 0,
833840 transition_out: 0,
834841 visualizer: 0,
842+ viz_paint: 0,
835843 start: 0,
836844 in_frame: 0,
837845 out_frame: 30,
@@ -966,6 +974,7 @@ fn a_fade_in_reaches_the_exported_audio() {
966974 fade_out: 0,
967975 transition_out: 0,
968976 visualizer: 0,
977+ viz_paint: 0,
969978 start: 0,
970979 in_frame: 0,
971980 out_frame: 90, // 3.0 s at 30 fps
@@ -1052,6 +1061,7 @@ fn a_split_and_crossfaded_clip_has_no_muted_interior() {
10521061 fade_out: 0,
10531062 transition_out: 0,
10541063 visualizer: 0,
1064+ viz_paint: 0,
10551065 start,
10561066 in_frame,
10571067 out_frame,
@@ -1159,6 +1169,7 @@ fn a_mono_timeline_exports_as_dual_mono_ogg() {
11591169 fade_out: 0,
11601170 transition_out: 0,
11611171 visualizer: 0,
1172+ viz_paint: 0,
11621173 start: 0,
11631174 in_frame: 0,
11641175 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() {
421421 fade_out: 0,
422422 transition_out: 0,
423423 visualizer: 0,
424+ viz_paint: 0,
424425 start: 0,
425426 in_frame: 0,
426427 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 {
5858 fade_out: 0,
5959 transition_out: 0,
6060 visualizer: 0,
61+ viz_paint: 0,
6162 start,
6263 in_frame: 0,
6364 out_frame: frames,
crates/engine/tests/export.rsmodified+2 -0
@@ -241,6 +241,7 @@ fn exports_at_the_project_resolution_with_the_watched_geometry() {
241241 fade_out: 0,
242242 transition_out: 0,
243243 visualizer: 0,
244+ viz_paint: 0,
244245 start,
245246 in_frame: 0,
246247 out_frame: 10,
@@ -329,6 +330,7 @@ fn exports_the_audio_stream_the_timeline_plays() {
329330 fade_out: 0,
330331 transition_out: 0,
331332 visualizer: 0,
333+ viz_paint: 0,
332334 start: 0,
333335 in_frame: 0,
334336 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() {
238238 fade_in: 0,
239239 transition_out: 0,
240240 visualizer: 0,
241+ viz_paint: 0,
241242 fade_out: 0,
242243 start: 0,
243244 in_frame: 0,
@@ -306,6 +307,7 @@ fn two_audio_lanes_are_summed() {
306307 fade_out: 0,
307308 transition_out: 0,
308309 visualizer: 0,
310+ viz_paint: 0,
309311 start: TOP_IN,
310312 in_frame: TOP_IN,
311313 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 {
8686 fade_out: 0,
8787 transition_out: 0,
8888 visualizer: 0,
89+ viz_paint: 0,
8990 start: 0,
9091 in_frame,
9192 out_frame,
@@ -471,6 +472,7 @@ fn a_copied_picture_names_the_sound_it_was_written_with() {
471472 fade_out: 0,
472473 transition_out: 0,
473474 visualizer: 0,
475+ viz_paint: 0,
474476 start: 0,
475477 in_frame: 0,
476478 out_frame,
crates/engine/tests/silence.rsmodified+2 -0
@@ -142,6 +142,7 @@ fn speed_mode_refuses_a_clip_that_laps_over_a_silence() {
142142 fade_out: 0,
143143 transition_out: 0,
144144 visualizer: 0,
145+ viz_paint: 0,
145146 start: 0,
146147 in_frame: 0,
147148 out_frame: 20,
@@ -182,6 +183,7 @@ fn whole(source: usize, frames: u32) -> Clip {
182183 fade_out: 0,
183184 transition_out: 0,
184185 visualizer: 0,
186+ viz_paint: 0,
185187 start: 0,
186188 in_frame: 0,
187189 out_frame: frames,