add phrase uuids; implement comparisons

This commit is contained in:
🪞👃🪞 2024-10-08 18:15:41 +03:00
parent 5b2b04dcf9
commit 690a8e8f24
6 changed files with 40 additions and 19 deletions

View file

@ -248,18 +248,16 @@ impl<'a> Content for VerticalArranger<'a, Tui> {
let scene_clip = |scene, track: usize, w: u16, h: u16|Layers::new(move |add|{
let mut color = Color::Rgb(40, 50, 30);
match (tracks.get(track), (scene as &Scene).clips.get(track)) {
(Some(track), Some(Some(clip))) => match track.phrases.get(*clip) {
Some(phrase) => {
let name = &(phrase as &Arc<RwLock<Phrase>>).read().unwrap().name;
let name = format!("{}", name.read().unwrap());
add(&name.as_str().push_x(1).fixed_x(w))?;
if (track as &PhrasePlayer<_>).phrase == Some(*clip) {
(Some(track), Some(Some(phrase))) => {
let name = &(phrase as &Arc<RwLock<Phrase>>).read().unwrap().name;
let name = format!("{}", name.read().unwrap());
add(&name.as_str().push_x(1).fixed_x(w))?;
color = COLOR_BG1;
if let Some(playing_phrase) = &track.player.phrase {
if *playing_phrase.read().unwrap() == *phrase.read().unwrap() {
color = COLOR_PLAYING
} else {
color = COLOR_BG1
};
},
_ => {}
}
}
},
_ => {}
};