mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 21:56:42 +01:00
wip: arranger: colors
This commit is contained in:
parent
70b1ec5a02
commit
08327d2ec0
5 changed files with 120 additions and 99 deletions
|
|
@ -39,7 +39,13 @@ impl Scene {
|
|||
/// Returns the pulse length of the longest phrase in the scene
|
||||
pub fn pulses (&self, tracks: &[Sequencer]) -> usize {
|
||||
self.clips.iter().enumerate()
|
||||
.filter_map(|(i, c)|c.map(|c|tracks[i].phrases.get(c)))
|
||||
.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))
|
||||
}
|
||||
|
|
@ -47,7 +53,10 @@ impl Scene {
|
|||
pub fn is_playing (&self, tracks: &[Sequencer]) -> bool {
|
||||
self.clips.iter().enumerate()
|
||||
.all(|(track_index, phrase_index)|match phrase_index {
|
||||
Some(i) => tracks[track_index].sequence == Some(*i),
|
||||
Some(i) => tracks
|
||||
.get(track_index)
|
||||
.map(|track|track.sequence == Some(*i))
|
||||
.unwrap_or(false),
|
||||
None => true
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue