From f5a82152394fde4d8f740f664ab7737b82861618 Mon Sep 17 00:00:00 2001 From: cashmere Date: Tue, 28 Jul 2026 19:41:16 +0200 Subject: feat: GPUI desktop port foundation - scene crate: full project/scene/element model, serde round-trip proven against the web SerializedProject shape - transfer crate: .ocp zip container, cross-compat with web fflate archives proven in both directions - storage crate: filesystem project store replacing IndexedDB, .ocp import/export - media crate: ffmpeg-next 8 decoder (frames, audio, thumbnails, waveform summaries) - playback crate: wall-clock anchored, frame-rounded playback clock - gpu crate: native texture readback; compositor renders headless offscreen on Vulkan (spike test) - flake devshell: rust toolchain, GPUI native deps, ffmpeg dev, bindgen clang args; GPUI hello-world builds - port plan in notes/gpui-port.md --- rust/crates/commands/src/scene/move_bookmark.rs | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 rust/crates/commands/src/scene/move_bookmark.rs (limited to 'rust/crates/commands/src/scene/move_bookmark.rs') diff --git a/rust/crates/commands/src/scene/move_bookmark.rs b/rust/crates/commands/src/scene/move_bookmark.rs new file mode 100644 index 00000000..dddef11f --- /dev/null +++ b/rust/crates/commands/src/scene/move_bookmark.rs @@ -0,0 +1,50 @@ +use scene::Project; +use time::MediaTime; + +use crate::bookmarks::{get_frame_time, move_bookmark_in_array}; +use crate::command::{Command, CommandError, CommandResult}; +use crate::project_ext::active_scene_mut; + +pub struct MoveBookmarkCommand { + from_time: MediaTime, + to_time: MediaTime, + saved_bookmarks: Option>, +} + +impl MoveBookmarkCommand { + pub fn new(from_time: MediaTime, to_time: MediaTime) -> Self { + Self { + from_time, + to_time, + saved_bookmarks: None, + } + } +} + +impl Command for MoveBookmarkCommand { + fn execute( + &mut self, + project: &mut Project, + ) -> Result, CommandError> { + let fps = project.settings.fps; + let Some(scene) = active_scene_mut(project) else { + return Ok(None); + }; + + self.saved_bookmarks = Some(scene.bookmarks.clone()); + let from_frame_time = get_frame_time(self.from_time, fps); + let to_frame_time = get_frame_time(self.to_time, fps); + scene.bookmarks = + move_bookmark_in_array(&scene.bookmarks, from_frame_time, to_frame_time); + Ok(None) + } + + fn undo(&mut self, project: &mut Project) { + let Some(saved) = &self.saved_bookmarks else { + return; + }; + if let Some(scene) = active_scene_mut(project) { + scene.bookmarks = saved.clone(); + } + } +} -- cgit v1.3.1