mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
launch pt.9: fix beats_per_second
This commit is contained in:
parent
e149d777ed
commit
e7dce0f84b
4 changed files with 87 additions and 85 deletions
|
|
@ -416,15 +416,12 @@ impl PhrasePlayer {
|
|||
));
|
||||
self.reset = true;
|
||||
}
|
||||
pub fn samples_since_start (&self) -> Option<usize> {
|
||||
self.phrase.as_ref()
|
||||
.map(|(started,_)|started.sample().get())
|
||||
.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)
|
||||
if let Some((started, Some(_))) = self.phrase.as_ref() {
|
||||
Some(self.clock.instant.pulse().get() - started.pulse().get())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
impl<E: Engine> PhraseLength<E> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue