mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 20:56:43 +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
|
|
@ -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
|
||||
};
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
},
|
||||
_ => {}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue