implement pause and seek

This commit is contained in:
2026-02-20 10:15:11 -08:00
parent 98f56d0608
commit 8ecb79a0b4
2 changed files with 27 additions and 1 deletions

View File

@@ -39,6 +39,15 @@ impl<'a> PlayerWorker<'a>{
}
pub fn send(&mut self,ins:TimedInstruction<Instruction,SessionTime>){
match ins.instruction{
Instruction::SessionControl(SessionControlInstruction::SetPaused(paused))=>{
self.playback_head.set_paused(ins.time,paused);
},
Instruction::SessionControl(SessionControlInstruction::SkipForward)=>{
self.playback_head.seek_forward(SessionTime::from_secs(5));
},
Instruction::SessionControl(SessionControlInstruction::SkipBack)=>{
self.playback_head.seek_backward(SessionTime::from_secs(5));
},
Instruction::SessionControl(session_control_instruction)=>{},
Instruction::Render=>if let Some(bot)=&self.bot{
self.playback_head.advance_time(bot,ins.time);