mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
add phrase uuids; implement comparisons
This commit is contained in:
parent
5b2b04dcf9
commit
690a8e8f24
6 changed files with 40 additions and 19 deletions
|
|
@ -470,14 +470,17 @@ impl Scene {
|
|||
}
|
||||
/// Returns true if all phrases in the scene are currently playing
|
||||
pub fn is_playing <E: Engine> (&self, tracks: &[ArrangementTrack<E>]) -> bool {
|
||||
self.clips.iter().enumerate()
|
||||
.all(|(track_index, clip)|match clip {
|
||||
Some(i) => tracks
|
||||
.get(track_index)
|
||||
.map(|track|track.player.phrase == Some(*i))
|
||||
.unwrap_or(false),
|
||||
None => true
|
||||
})
|
||||
self.clips.iter().enumerate().all(|(track_index, clip)|match clip {
|
||||
Some(clip) => tracks
|
||||
.get(track_index)
|
||||
.map(|track|if let Some(phrase) = &track.player.phrase {
|
||||
*phrase.read().unwrap() == *clip.read().unwrap()
|
||||
} else {
|
||||
false
|
||||
})
|
||||
.unwrap_or(false),
|
||||
None => true
|
||||
})
|
||||
}
|
||||
pub fn ppqs <E: Engine> (tracks: &[ArrangementTrack<E>], scenes: &[Self]) -> Vec<(usize, usize)> {
|
||||
let mut total = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue