mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
don't mark empty scenes as playing
This commit is contained in:
parent
dd21f73e9d
commit
c81fd97eb2
2 changed files with 13 additions and 12 deletions
|
|
@ -675,17 +675,18 @@ 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()
|
||||||
Some(clip) => tracks
|
.all(|(track_index, clip)|match clip {
|
||||||
.get(track_index)
|
Some(clip) => tracks
|
||||||
.map(|track|if let Some(phrase) = &track.player.phrase {
|
.get(track_index)
|
||||||
*phrase.read().unwrap() == *clip.read().unwrap()
|
.map(|track|if let Some(phrase) = &track.player.phrase {
|
||||||
} else {
|
*phrase.read().unwrap() == *clip.read().unwrap()
|
||||||
false
|
} else {
|
||||||
})
|
false
|
||||||
.unwrap_or(false),
|
})
|
||||||
None => true
|
.unwrap_or(false),
|
||||||
})
|
None => true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
pub fn ppqs (scenes: &[Self], factor: usize) -> Vec<(usize, usize)> {
|
pub fn ppqs (scenes: &[Self], factor: usize) -> Vec<(usize, usize)> {
|
||||||
let mut total = 0;
|
let mut total = 0;
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ impl<'a> Content for VerticalArranger<'a, Tui> {
|
||||||
|
|
||||||
// scene titles
|
// scene titles
|
||||||
let scene_name = |scene, playing: bool, height|row!(
|
let scene_name = |scene, playing: bool, height|row!(
|
||||||
if playing { " ▶" } else { " " },
|
if playing { "▶ " } else { " " },
|
||||||
(scene as &Scene).name.read().unwrap().as_str(),
|
(scene as &Scene).name.read().unwrap().as_str(),
|
||||||
).fixed_xy(offset.saturating_sub(1), height);
|
).fixed_xy(offset.saturating_sub(1), height);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue