launch countdown/switchover, pt.4

This commit is contained in:
🪞👃🪞 2024-11-01 22:14:08 +02:00
parent 5f112cc203
commit 6cb609f8b8
4 changed files with 25 additions and 24 deletions

View file

@ -419,7 +419,12 @@ impl PhrasePlayer {
pub fn samples_since_start (&self) -> Option<usize> {
self.phrase.as_ref()
.map(|(started,_)|started.sample().get())
.map(|started|(started - self.clock.instant.sample().get()) as usize)
.map(|started|(self.clock.instant.sample().get() - started) as usize)
}
pub fn pulses_since_start (&self) -> Option<f64> {
self.phrase.as_ref()
.map(|(started,_)|started.pulse().get())
.map(|started|self.clock.instant.pulse().get() - started)
}
}
impl<E: Engine> PhraseLength<E> {