mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 21:56:42 +01:00
wip: refactor pt.36 (10e) fewer structs, more field duplication
This commit is contained in:
parent
7af5bbd02b
commit
92bcd19925
11 changed files with 136 additions and 65 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue