mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
fix usecs_to_pulse
This commit is contained in:
parent
4ecd6eab3d
commit
9531d0e09d
2 changed files with 5 additions and 10 deletions
|
|
@ -17,15 +17,10 @@ impl<E: Engine> Audio for TransportToolbar<E> {
|
|||
if *self.clock.playing.read().unwrap() == Some(TransportState::Stopped) {
|
||||
self.started = None;
|
||||
}
|
||||
match self.started {
|
||||
Some((_, usecs)) => {
|
||||
let usec = current_usecs as usize - usecs;
|
||||
let pulse = self.clock.usecs_to_pulse(usec as f64);
|
||||
self.clock.set_usec(usec);
|
||||
self.clock.set_pulse(pulse as usize);
|
||||
},
|
||||
None => { self.clock.set_usec(0); }
|
||||
};
|
||||
self.clock.instant.update_from_usec(match self.started {
|
||||
Some((_, usecs)) => current_usecs as usize - usecs,
|
||||
None => 0
|
||||
});
|
||||
Control::Continue
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue