rename arg

This commit is contained in:
2026-02-23 07:46:51 -08:00
parent aa0a333431
commit 54beb3e9df
2 changed files with 10 additions and 10 deletions

View File

@@ -56,17 +56,17 @@ impl PlaybackHead{
// reset head
self.head=HEAD_NO_CRASH;
}
pub fn seek_backward(&mut self,time:SessionTime){
pub fn seek_backward(&mut self,time_offset:SessionTime){
let (mut state,paused)=self.timer.clone().into_state();
let offset=state.get_time(-time).coerce();
let offset=state.get_time(-time_offset).coerce();
state.set_offset(offset);
self.timer=Timer::from_state(state,paused);
// reset head
self.head=HEAD_NO_CRASH;
}
pub fn seek_forward(&mut self,time:SessionTime){
pub fn seek_forward(&mut self,time_offset:SessionTime){
let (mut state,paused)=self.timer.clone().into_state();
let offset=state.get_time(time).coerce();
let offset=state.get_time(time_offset).coerce();
state.set_offset(offset);
self.timer=Timer::from_state(state,paused);
}

View File

@@ -152,13 +152,13 @@ impl PlaybackHead{
self.head.seek_to(time,new_time);
}
#[wasm_bindgen]
pub fn seek_forward(&mut self,time:f64){
let time=time::from_float(time).unwrap();
self.head.seek_forward(time);
pub fn seek_forward(&mut self,time_offset:f64){
let time_offset=time::from_float(time_offset).unwrap();
self.head.seek_forward(time_offset);
}
#[wasm_bindgen]
pub fn seek_backward(&mut self,time:f64){
let time=time::from_float(time).unwrap();
self.head.seek_backward(time);
pub fn seek_backward(&mut self,time_offset:f64){
let time_offset=time::from_float(time_offset).unwrap();
self.head.seek_backward(time_offset);
}
}