wip: refactor pt.36 (10e) fewer structs, more field duplication

This commit is contained in:
🪞👃🪞 2024-11-15 02:21:30 +01:00
parent 7af5bbd02b
commit 92bcd19925
11 changed files with 136 additions and 65 deletions

View file

@ -66,12 +66,12 @@ pub trait ArrangerSceneApi: Sized {
/// Returns true if all phrases in the scene are
/// currently playing on the given collection of tracks.
fn is_playing (&self, tracks: &[ArrangerTrack]) -> bool {
fn is_playing <T: ArrangerTrackApi> (&self, tracks: &[T]) -> bool {
self.clips().iter().any(|clip|clip.is_some()) && self.clips().iter().enumerate()
.all(|(track_index, clip)|match clip {
Some(clip) => tracks
.get(track_index)
.map(|track|if let Some((_, Some(phrase))) = &track.player.phrase {
.map(|track|if let Some((_, Some(phrase))) = track.player().phrase() {
*phrase.read().unwrap() == *clip.read().unwrap()
} else {
false