video backend

This commit is contained in:
Skyler Lehmkuhl
2025-11-06 06:04:39 -05:00
parent 07dc7efbe4
commit 3c5a24e0b6
15 changed files with 2011 additions and 127 deletions
+22
View File
@@ -384,6 +384,24 @@ impl Engine {
_ => {}
}
}
Command::TrimClip(track_id, clip_id, new_start_time, new_duration, new_offset) => {
match self.project.get_track_mut(track_id) {
Some(crate::audio::track::TrackNode::Audio(track)) => {
if let Some(clip) = track.clips.iter_mut().find(|c| c.id == clip_id) {
clip.start_time = new_start_time;
clip.duration = new_duration;
clip.offset = new_offset;
}
}
Some(crate::audio::track::TrackNode::Midi(track)) => {
if let Some(clip) = track.clips.iter_mut().find(|c| c.id == clip_id) {
clip.start_time = new_start_time;
clip.duration = new_duration;
}
}
_ => {}
}
}
Command::CreateMetatrack(name) => {
let track_id = self.project.add_group_track(name.clone(), None);
// Notify UI about the new metatrack
@@ -1893,6 +1911,10 @@ impl EngineController {
let _ = self.command_tx.push(Command::MoveClip(track_id, clip_id, new_start_time));
}
pub fn trim_clip(&mut self, track_id: TrackId, clip_id: ClipId, new_start_time: f64, new_duration: f64, new_offset: f64) {
let _ = self.command_tx.push(Command::TrimClip(track_id, clip_id, new_start_time, new_duration, new_offset));
}
/// Send a generic command to the audio thread
pub fn send_command(&mut self, command: Command) {
let _ = self.command_tx.push(command);