Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(project): add clip volume and cursor visibility

Richie McIlroy788d94adc907
diff --git a/apps/cli/src/selftest/playback.rs b/apps/cli/src/selftest/playback.rs
index 6612739e7..57e997d94 100644
--- a/apps/cli/src/selftest/playback.rs
+++ b/apps/cli/src/selftest/playback.rs
@@ -903,6 +903,8 @@ mod fixture {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}],
transitions: Vec::new(),
zoom_segments: Vec::new(),
diff --git a/apps/desktop-gpui/src/editor_clips.rs b/apps/desktop-gpui/src/editor_clips.rs
index 814c372b1..b2d2aa225 100644
--- a/apps/desktop-gpui/src/editor_clips.rs
+++ b/apps/desktop-gpui/src/editor_clips.rs
@@ -1941,6 +1941,8 @@ impl PreparedMp4Import {
end: self.duration,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
});
add_clip_configs(&mut config, index, std::slice::from_ref(&self.segment));
config.validate().map_err(|error| error.to_string())?;
@@ -2364,6 +2366,8 @@ fn full_timeline_for_segments(
end: duration,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect()
@@ -2959,6 +2963,8 @@ fn full_timeline_for_source_segments(
end: duration,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect()
@@ -3278,6 +3284,8 @@ pub(crate) fn append_cap_project_to_editor(
end: source_segment.end,
name: None,
speed_audio_mode: source_segment.speed_audio_mode,
+ hide_cursor: source_segment.hide_cursor,
+ volume: source_segment.volume,
});
}
}
@@ -3661,6 +3669,8 @@ mod tests {
end,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}
}
diff --git a/apps/desktop-gpui/src/editor_edits.rs b/apps/desktop-gpui/src/editor_edits.rs
index ca9f0c598..95594d451 100644
--- a/apps/desktop-gpui/src/editor_edits.rs
+++ b/apps/desktop-gpui/src/editor_edits.rs
@@ -1754,6 +1754,8 @@ pub fn ensure_timeline(project: &mut ProjectConfiguration, clip_display_duration
end: *duration,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
.collect(),
transitions: Vec::new(),
diff --git a/apps/desktop-gpui/src/editor_window.rs b/apps/desktop-gpui/src/editor_window.rs
index b4babcc1c..07360dd4a 100644
--- a/apps/desktop-gpui/src/editor_window.rs
+++ b/apps/desktop-gpui/src/editor_window.rs
@@ -428,6 +428,8 @@ pub fn preflight(path: &std::path::Path) -> Result<ProjectSummary, String> {
end: segment.duration(),
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
.collect(),
// `TimelineConfiguration` has no `Default`, so the eight other
@@ -10849,6 +10851,8 @@ mod tests {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}],
transitions: Vec::new(),
zoom_segments: Vec::new(),
@@ -10902,6 +10906,8 @@ mod tests {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
cap_project::TimelineSegment {
recording_clip: 0,
@@ -10910,6 +10916,8 @@ mod tests {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
],
transitions: Vec::new(),
diff --git a/apps/desktop-gpui/src/transcription.rs b/apps/desktop-gpui/src/transcription.rs
index 5ed9802d6..ce2ed9dc1 100644
--- a/apps/desktop-gpui/src/transcription.rs
+++ b/apps/desktop-gpui/src/transcription.rs
@@ -2071,6 +2071,8 @@ pub fn apply_caption_result(
end: recording_duration,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}],
transitions: Vec::new(),
zoom_segments: Vec::new(),
diff --git a/apps/desktop/src-tauri/examples/desktop-display-transport-benchmark.rs b/apps/desktop/src-tauri/examples/desktop-display-transport-benchmark.rs
index efb5684eb..4aafe33f3 100644
--- a/apps/desktop/src-tauri/examples/desktop-display-transport-benchmark.rs
+++ b/apps/desktop/src-tauri/examples/desktop-display-transport-benchmark.rs
@@ -133,6 +133,8 @@ async fn load_recording(
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}]
}
StudioRecordingMeta::MultipleSegments { inner } => inner
@@ -152,6 +154,8 @@ async fn load_recording(
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect(),
diff --git a/apps/desktop/src-tauri/src/editor_preparing.rs b/apps/desktop/src-tauri/src/editor_preparing.rs
index d3a910418..7a213388e 100644
--- a/apps/desktop/src-tauri/src/editor_preparing.rs
+++ b/apps/desktop/src-tauri/src/editor_preparing.rs
@@ -1364,6 +1364,8 @@ mod presentation_guard_tests {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
};
for notch in [
None,
diff --git a/apps/desktop/src-tauri/src/import.rs b/apps/desktop/src-tauri/src/import.rs
index c139420ec..19aa7faf6 100644
--- a/apps/desktop/src-tauri/src/import.rs
+++ b/apps/desktop/src-tauri/src/import.rs
@@ -324,6 +324,8 @@ fn full_timeline_for_segments(
end: duration,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect()
@@ -358,6 +360,8 @@ fn full_timeline_for_source_segments(
end: duration,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect()
@@ -1731,6 +1735,8 @@ async fn append_mp4_to_editor_project(
end: duration,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
});
add_clip_configs(
&mut config,
@@ -1862,6 +1868,8 @@ async fn append_cap_project_to_editor_project(
end: source_segment.end,
name: None,
speed_audio_mode: source_segment.speed_audio_mode,
+ hide_cursor: source_segment.hide_cursor,
+ volume: source_segment.volume,
});
}
}
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rs
index 8096b61c3..0e776b3c5 100644
--- a/apps/desktop/src-tauri/src/recording.rs
+++ b/apps/desktop/src-tauri/src/recording.rs
@@ -6458,6 +6458,8 @@ fn project_config_from_recording(
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
.collect::<Vec<_>>();
@@ -9908,6 +9910,8 @@ mod preparing_presentation_parity_tests {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}]
}
diff --git a/apps/desktop/src/utils/tauri.ts b/apps/desktop/src/utils/tauri.ts
index fa2ca178c..c66d7500d 100644
--- a/apps/desktop/src/utils/tauri.ts
+++ b/apps/desktop/src/utils/tauri.ts
@@ -1295,7 +1295,7 @@ letterSpacing?: number; lineHeight?: number; opacity?: number; shadow?: number;
*/
layoutTransition?: number }
export type TimelineConfiguration = { segments: TimelineSegment[]; transitions: ClipTransition[]; zoomSegments: ZoomSegment[]; sceneSegments?: SceneSegment[]; maskSegments?: MaskSegment[]; textSegments?: TextSegment[]; captionSegments?: CaptionTrackSegment[]; keyboardSegments?: KeyboardTrackSegment[]; audioSegments?: AudioTrackSegment[]; styleSegments: StyleSegment[]; imageSegments: ImageSegment[]; camera3dSegments?: Camera3DSegment[] }
-export type TimelineSegment = { recordingSegment?: number; timescale: number; start: number; end: number; name?: string | null; speedAudioMode?: ClipSpeedAudioMode | null }
+export type TimelineSegment = { recordingSegment?: number; timescale: number; start: number; end: number; name?: string | null; speedAudioMode?: ClipSpeedAudioMode | null; volume?: number | null; hideCursor?: boolean | null }
export type TranscriptionEngine = "Whisper" | "Parakeet"
export type Trigger = "screenshotTaken" | "studioRecordingFinished" | "instantRecordingFinished" | "recordingStarted" | "uploadCompleted" | "videoImported" | "recordingDeleted"
export type UpdateChannel = "stable" | "nightly"
diff --git a/crates/editor/examples/editor-playback-benchmark.rs b/crates/editor/examples/editor-playback-benchmark.rs
index 00cb31769..14305d6c6 100644
--- a/crates/editor/examples/editor-playback-benchmark.rs
+++ b/crates/editor/examples/editor-playback-benchmark.rs
@@ -353,6 +353,8 @@ async fn load_recording(
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}]
}
StudioRecordingMeta::MultipleSegments { inner } => inner
@@ -372,6 +374,8 @@ async fn load_recording(
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect(),
diff --git a/crates/editor/examples/playback-pipeline-benchmark.rs b/crates/editor/examples/playback-pipeline-benchmark.rs
index 4c3f3fc07..8e772d103 100644
--- a/crates/editor/examples/playback-pipeline-benchmark.rs
+++ b/crates/editor/examples/playback-pipeline-benchmark.rs
@@ -276,6 +276,8 @@ async fn load_recording(
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}]
}
StudioRecordingMeta::MultipleSegments { inner } => inner
@@ -298,6 +300,8 @@ async fn load_recording(
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect(),
diff --git a/crates/editor/src/audio.rs b/crates/editor/src/audio.rs
index ac363c19c..b769bf177 100644
--- a/crates/editor/src/audio.rs
+++ b/crates/editor/src/audio.rs
@@ -2320,6 +2320,8 @@ mod tests {
end: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
TimelineSegment {
recording_clip: 0,
@@ -2328,6 +2330,8 @@ mod tests {
end: 2.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
TimelineSegment {
recording_clip: 0,
@@ -2336,6 +2340,8 @@ mod tests {
end: 3.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
TimelineSegment {
recording_clip: 1,
@@ -2344,6 +2350,8 @@ mod tests {
end: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
TimelineSegment {
recording_clip: 1,
@@ -2352,6 +2360,8 @@ mod tests {
end: 2.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
TimelineSegment {
recording_clip: 1,
@@ -2360,6 +2370,8 @@ mod tests {
end: 3.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
],
transitions: Vec::new(),
@@ -2711,6 +2723,8 @@ mod tests {
end,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}
}
diff --git a/crates/editor/src/editor_instance.rs b/crates/editor/src/editor_instance.rs
index a668af23a..11ca6f2f3 100644
--- a/crates/editor/src/editor_instance.rs
+++ b/crates/editor/src/editor_instance.rs
@@ -378,6 +378,8 @@ impl EditorInstance {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}],
_ => {
warn!(
@@ -411,6 +413,8 @@ impl EditorInstance {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect(),
diff --git a/crates/editor/src/export_audio.rs b/crates/editor/src/export_audio.rs
index a01c07c86..92c92ec90 100644
--- a/crates/editor/src/export_audio.rs
+++ b/crates/editor/src/export_audio.rs
@@ -1052,6 +1052,8 @@ mod tests {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}
}
diff --git a/crates/project/src/configuration.rs b/crates/project/src/configuration.rs
index 994786fad..7b1aa21d9 100644
--- a/crates/project/src/configuration.rs
+++ b/crates/project/src/configuration.rs
@@ -928,6 +928,10 @@ pub struct TimelineSegment {
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub speed_audio_mode: Option<ClipSpeedAudioMode>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub volume: Option<f64>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub hide_cursor: Option<bool>,
}
#[derive(Type, Serialize, Deserialize, Clone, Copy, Debug, Default, PartialEq, Eq)]
@@ -940,6 +944,17 @@ pub enum ClipSpeedAudioMode {
}
impl TimelineSegment {
+ pub fn hides_cursor(&self) -> bool {
+ self.hide_cursor.unwrap_or(false)
+ }
+
+ pub fn volume(&self) -> f64 {
+ self.volume
+ .filter(|volume| volume.is_finite())
+ .unwrap_or(1.0)
+ .clamp(0.0, 2.0)
+ }
+
fn interpolate_time(&self, tick: f64) -> Option<f64> {
if tick > self.duration() {
None
@@ -1690,6 +1705,9 @@ fn is_timeline_interval_active(start: f64, end: f64, time: f64) -> bool {
}
pub const MIN_CLIP_TRANSITION_DURATION: f64 = 0.05;
+/// How long the cursor takes to fade out after entering a clip that hides it
+/// (and to fade back in before leaving the hidden run).
+pub const CLIP_CURSOR_FADE_SECS: f64 = 0.3;
#[derive(Type, Serialize, Deserialize, Clone, Copy, Debug, Default, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
@@ -2056,6 +2074,66 @@ impl TimelineConfiguration {
segment_duration + self.held_duration()
}
+
+ /// Gapless-time windows covered by clips that hide the cursor, with
+ /// touching windows merged so a run of hidden clips fades once at each
+ /// end rather than at every boundary. A window opens where its clip's
+ /// incoming transition starts and closes where the next transition
+ /// starts, matching the frame mapping above.
+ fn hidden_cursor_windows(&self) -> (Vec<(f64, f64)>, f64) {
+ let mut windows: Vec<(f64, f64)> = Vec::new();
+ let mut segment_start = 0.0;
+ for (index, segment) in self.segments.iter().enumerate() {
+ let next_duration = self
+ .effective_transition(index + 1)
+ .map_or(0.0, |transition| transition.duration);
+ let end = segment_start + segment.duration() - next_duration;
+ if segment.hides_cursor() {
+ match windows.last_mut() {
+ Some(last) if (last.1 - segment_start).abs() < 1e-9 => last.1 = end,
+ _ => windows.push((segment_start, end)),
+ }
+ }
+ segment_start = end;
+ }
+ (windows, segment_start)
+ }
+
+ /// 0..1 multiplier for the cursor (and its click ripples) at an output
+ /// time: 1 on ordinary clips, 0 inside a clip that hides the cursor, with
+ /// a [`CLIP_CURSOR_FADE_SECS`] smoothstep ramp just inside each end of the
+ /// hidden run. The ramp is skipped at the timeline's own start and end so
+ /// the cursor never blinks in for a hidden first or last clip.
+ pub fn cursor_visibility_at(&self, output_time: f64) -> f64 {
+ if !self.segments.iter().any(TimelineSegment::hides_cursor) {
+ return 1.0;
+ }
+ let holds = self.hold_windows();
+ let time = output_time - held_time_before(&holds, output_time);
+ let (windows, total) = self.hidden_cursor_windows();
+ for (start, end) in windows {
+ if time < start || time >= end {
+ continue;
+ }
+ let from_start = if start <= 1e-9 {
+ f64::INFINITY
+ } else {
+ time - start
+ };
+ let from_end = if end >= total - 1e-9 {
+ f64::INFINITY
+ } else {
+ end - time
+ };
+ let edge = from_start.min(from_end);
+ if edge >= CLIP_CURSOR_FADE_SECS {
+ return 0.0;
+ }
+ let t = (edge / CLIP_CURSOR_FADE_SECS).clamp(0.0, 1.0);
+ return 1.0 - t * t * (3.0 - 2.0 * t);
+ }
+ 1.0
+ }
}
fn active_hold_window(windows: &[(f64, f64)], time: f64) -> Option<(f64, f64)> {
@@ -2786,6 +2864,12 @@ impl ProjectConfiguration {
.as_ref()
.and_then(|t| t.get_segment_time(frame_time))
}
+
+ pub fn cursor_visibility_at(&self, output_time: f64) -> f64 {
+ self.timeline
+ .as_ref()
+ .map_or(1.0, |timeline| timeline.cursor_visibility_at(output_time))
+ }
}
pub const SLOW_SMOOTHING_SAMPLES: usize = 24;
@@ -2904,6 +2988,8 @@ mod tests {
end: 4.0,
name: None,
speed_audio_mode: None,
+ volume: None,
+ hide_cursor: None,
},
TimelineSegment {
recording_clip: 1,
@@ -2912,6 +2998,8 @@ mod tests {
end: 16.0,
name: None,
speed_audio_mode: None,
+ volume: None,
+ hide_cursor: None,
},
],
transitions,
@@ -3583,6 +3671,39 @@ mod tests {
));
}
+ #[test]
+ fn timeline_segment_volume_is_backward_compatible_and_bounded() {
+ let mut segment: TimelineSegment = serde_json::from_value(serde_json::json!({
+ "recordingSegment": 0,
+ "timescale": 1.0,
+ "start": 0.0,
+ "end": 4.0
+ }))
+ .unwrap();
+ assert_eq!(segment.volume(), 1.0);
+ assert!(
+ serde_json::to_value(&segment)
+ .unwrap()
+ .get("volume")
+ .is_none()
+ );
+ segment.volume = Some(0.35);
+ let saved = serde_json::to_string(&segment).unwrap();
+ let restored: TimelineSegment = serde_json::from_str(&saved).unwrap();
+ assert_eq!(restored.volume(), 0.35);
+ for (volume, expected) in [
+ (-1.0, 0.0),
+ (0.0, 0.0),
+ (2.0, 2.0),
+ (3.0, 2.0),
+ (f64::NAN, 1.0),
+ (f64::INFINITY, 1.0),
+ ] {
+ segment.volume = Some(volume);
+ assert_eq!(segment.volume(), expected);
+ }
+ }
+
#[test]
fn timeline_segment_speed_audio_mode_is_backward_compatible() {
let legacy: TimelineSegment = serde_json::from_value(serde_json::json!({
@@ -3732,6 +3853,102 @@ mod tests {
);
}
+ fn clip(start: f64, end: f64, hide_cursor: bool) -> TimelineSegment {
+ TimelineSegment {
+ recording_clip: 0,
+ timescale: 1.0,
+ start,
+ end,
+ name: None,
+ speed_audio_mode: None,
+ volume: None,
+ hide_cursor: hide_cursor.then_some(true),
+ }
+ }
+
+ fn cursor_timeline(segments: Vec<TimelineSegment>) -> TimelineConfiguration {
+ TimelineConfiguration {
+ segments,
+ ..timeline_with_transitions(Vec::new())
+ }
+ }
+
+ #[test]
+ fn hide_cursor_is_omitted_from_json_unless_set() {
+ let visible = serde_json::to_value(clip(0.0, 1.0, false)).unwrap();
+ assert!(visible.get("hideCursor").is_none());
+ let hidden = serde_json::to_value(clip(0.0, 1.0, true)).unwrap();
+ assert_eq!(hidden["hideCursor"], serde_json::Value::Bool(true));
+ let legacy: TimelineSegment =
+ serde_json::from_str(r#"{"timescale":1.0,"start":0.0,"end":1.0}"#).unwrap();
+ assert!(!legacy.hides_cursor());
+ }
+
+ #[test]
+ fn cursor_visibility_is_full_without_hidden_clips() {
+ let timeline = cursor_timeline(vec![clip(0.0, 4.0, false), clip(4.0, 8.0, false)]);
+ for time in [0.0, 3.9, 4.0, 7.9] {
+ assert_eq!(timeline.cursor_visibility_at(time), 1.0);
+ }
+ }
+
+ #[test]
+ fn cursor_fades_at_both_edges_of_a_hidden_middle_clip() {
+ let timeline = cursor_timeline(vec![
+ clip(0.0, 4.0, false),
+ clip(4.0, 8.0, true),
+ clip(8.0, 12.0, false),
+ ]);
+ assert_eq!(timeline.cursor_visibility_at(3.99), 1.0);
+ assert_eq!(timeline.cursor_visibility_at(4.0), 1.0);
+ let half = timeline.cursor_visibility_at(4.0 + CLIP_CURSOR_FADE_SECS / 2.0);
+ assert!((half - 0.5).abs() < 1e-9, "{half}");
+ assert_eq!(
+ timeline.cursor_visibility_at(4.0 + CLIP_CURSOR_FADE_SECS),
+ 0.0
+ );
+ assert_eq!(timeline.cursor_visibility_at(6.0), 0.0);
+ let back = timeline.cursor_visibility_at(8.0 - CLIP_CURSOR_FADE_SECS / 2.0);
+ assert!((back - 0.5).abs() < 1e-9, "{back}");
+ assert_eq!(timeline.cursor_visibility_at(8.0), 1.0);
+ assert_eq!(timeline.cursor_visibility_at(10.0), 1.0);
+ }
+
+ #[test]
+ fn cursor_never_fades_in_at_the_timeline_ends() {
+ let timeline = cursor_timeline(vec![clip(0.0, 4.0, true), clip(4.0, 8.0, true)]);
+ assert_eq!(timeline.cursor_visibility_at(0.0), 0.0);
+ assert_eq!(timeline.cursor_visibility_at(0.1), 0.0);
+ assert_eq!(timeline.cursor_visibility_at(4.0), 0.0);
+ assert_eq!(timeline.cursor_visibility_at(7.95), 0.0);
+ }
+
+ #[test]
+ fn adjacent_hidden_clips_fade_as_one_run() {
+ let timeline = cursor_timeline(vec![
+ clip(0.0, 2.0, false),
+ clip(2.0, 4.0, true),
+ clip(4.0, 6.0, true),
+ clip(6.0, 8.0, false),
+ ]);
+ assert_eq!(timeline.cursor_visibility_at(3.9), 0.0);
+ assert_eq!(timeline.cursor_visibility_at(4.0), 0.0);
+ assert_eq!(timeline.cursor_visibility_at(4.1), 0.0);
+ assert!(timeline.cursor_visibility_at(5.9) > 0.0);
+ }
+
+ #[test]
+ fn cursor_visibility_follows_held_output_time() {
+ let mut timeline = cursor_timeline(vec![clip(0.0, 4.0, false), clip(4.0, 8.0, true)]);
+ timeline.text_segments = vec![fullscreen_text(1.0, 3.0)];
+ assert_eq!(timeline.cursor_visibility_at(5.0), 1.0);
+ assert_eq!(timeline.cursor_visibility_at(6.0), 1.0);
+ assert_eq!(
+ timeline.cursor_visibility_at(6.0 + CLIP_CURSOR_FADE_SECS),
+ 0.0
+ );
+ }
+
#[test]
fn transition_json_is_normalized_by_segment_index() {
let timeline: TimelineConfiguration = serde_json::from_value(serde_json::json!({
diff --git a/crates/recording/src/recovery.rs b/crates/recording/src/recovery.rs
index 67cfad71c..1d8af5835 100644
--- a/crates/recording/src/recovery.rs
+++ b/crates/recording/src/recovery.rs
@@ -2316,6 +2316,8 @@ impl RecoveryManager {
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect();
diff --git a/crates/recording/src/studio_recording.rs b/crates/recording/src/studio_recording.rs
index bd1b6fbc7..8c35916a2 100644
--- a/crates/recording/src/studio_recording.rs
+++ b/crates/recording/src/studio_recording.rs
@@ -2714,6 +2714,8 @@ async fn stop_recording(
timescale: 1.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
})
})
.collect();
diff --git a/crates/recording/src/track_heal.rs b/crates/recording/src/track_heal.rs
index 16626b63a..9ebfba304 100644
--- a/crates/recording/src/track_heal.rs
+++ b/crates/recording/src/track_heal.rs
@@ -1050,6 +1050,8 @@ mod tests {
end: 202.220711,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}],
transitions: Vec::new(),
zoom_segments: vec![ZoomSegment {
@@ -1106,6 +1108,8 @@ mod tests {
end: 202.220711,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}],
transitions: Vec::new(),
zoom_segments: vec![],
@@ -1182,6 +1186,8 @@ mod tests {
end: 100.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
TimelineSegment {
recording_clip: 1,
@@ -1190,6 +1196,8 @@ mod tests {
end: 50.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
],
transitions: Vec::new(),
diff --git a/crates/rendering/src/zoom_spring.rs b/crates/rendering/src/zoom_spring.rs
index 50bc80f96..462c931d3 100644
--- a/crates/rendering/src/zoom_spring.rs
+++ b/crates/rendering/src/zoom_spring.rs
@@ -1329,6 +1329,8 @@ mod tests {
end: 14.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
TimelineSegment {
recording_clip: 0,
@@ -1337,6 +1339,8 @@ mod tests {
end: 34.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
];
config.transitions = vec![ClipTransition {
@@ -2103,6 +2107,8 @@ mod tests {
end: 20.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
}],
transitions: vec![],
zoom_segments: vec![],
@@ -2162,6 +2168,8 @@ mod tests {
end: 4.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
TimelineSegment {
recording_clip: 0,
@@ -2170,6 +2178,8 @@ mod tests {
end: 14.0,
name: None,
speed_audio_mode: None,
+ hide_cursor: None,
+ volume: None,
},
],
transitions: vec![ClipTransition {