wip: reenable standalone sequencer

This commit is contained in:
🪞👃🪞 2024-10-08 18:33:21 +03:00
parent 690a8e8f24
commit 0eb063db1c
7 changed files with 125 additions and 37 deletions

View file

@ -457,16 +457,7 @@ impl Scene {
}
/// Returns the pulse length of the longest phrase in the scene
pub fn pulses <E: Engine> (&self, tracks: &[ArrangementTrack<E>]) -> usize {
self.clips.iter().enumerate()
.filter_map(|(i, c)|c
.map(|c|tracks
.get(i)
.map(|track|track
.phrases
.get(c))))
.filter_map(|p|p)
.filter_map(|p|p)
.fold(0, |a, p|a.max(p.read().unwrap().length))
self.clips.iter().fold(0, |a, p|a.max(p.as_ref().map(|q|q.read().unwrap().length).unwrap_or(0)))
}
/// Returns true if all phrases in the scene are currently playing
pub fn is_playing <E: Engine> (&self, tracks: &[ArrangementTrack<E>]) -> bool {