refactor PhrasePlayer::process callback

This commit is contained in:
🪞👃🪞 2024-11-01 20:06:42 +02:00
parent 0820c10f8b
commit 3df8e87840
4 changed files with 118 additions and 87 deletions

View file

@ -403,15 +403,6 @@ impl PhrasePlayer {
.map(|(started,_)|started.sample().get())
.map(|started|(started - self.clock.instant.sample().get()) as usize)
}
pub fn playing_phrase (&self) -> Option<(usize, Arc<RwLock<Phrase>>)> {
if let (
Some(TransportState::Rolling), Some((started, Some(ref phrase)))
) = (*self.clock.playing.read().unwrap(), &self.phrase) {
Some((started.sample().get() as usize, phrase.clone()))
} else {
None
}
}
}
/// Displays and edits phrase length
pub struct PhraseLength<E: Engine> {