don't mark empty scenes as playing

This commit is contained in:
🪞👃🪞 2024-10-24 23:21:32 +03:00
parent dd21f73e9d
commit c81fd97eb2
2 changed files with 13 additions and 12 deletions

View file

@ -675,7 +675,8 @@ impl Scene {
} }
/// Returns true if all phrases in the scene are currently playing /// Returns true if all phrases in the scene are currently playing
pub fn is_playing <E: Engine> (&self, tracks: &[ArrangementTrack<E>]) -> bool { pub fn is_playing <E: Engine> (&self, tracks: &[ArrangementTrack<E>]) -> bool {
self.clips.iter().enumerate().all(|(track_index, clip)|match clip { self.clips.iter().any(|clip|clip.is_some()) && self.clips.iter().enumerate()
.all(|(track_index, clip)|match clip {
Some(clip) => tracks Some(clip) => tracks
.get(track_index) .get(track_index)
.map(|track|if let Some(phrase) = &track.player.phrase { .map(|track|if let Some(phrase) = &track.player.phrase {