This commit is contained in:
🪞👃🪞 2024-06-29 14:12:21 +03:00
parent f48f17e9a4
commit 4ebecc2427
7 changed files with 107 additions and 71 deletions

View file

@ -99,15 +99,16 @@ impl<'a> LauncherGridView<'a> {
if let Some(scene) = self.state.scenes.get(index) {
let hi = (track + 1 == self.state.cursor.0) &&
(index + 1 == self.state.cursor.1);
let style = Some(self.highlight(hi));
if let Some(Some(clip)) = scene.clips.get(track) {
let style = Some(self.highlight(hi));
let clip = scene.clips.get(track);
if let Some(Some(clip)) = clip {
if let Some(phrase) = self.state.tracks[track].sequencer.state().sequences.get(*clip) {
format!("{}", phrase.name).blit(self.buf, x, y + y2, style);
} else {
"????".blit(self.buf, x, y + y2, Some(Style::default().dim()))
}
} else {
"....".blit(self.buf, x, y + y2, Some(Style::default().dim()))
" ·········".blit(self.buf, x, y + y2, Some(Style::default().dim()))
}
if hi {
draw_box_styled(self.buf, Rect {
@ -116,12 +117,25 @@ impl<'a> LauncherGridView<'a> {
width: 16,
height: 3
}, style);
if self.focused {
let style = Some(self.highlight(hi).bold().yellow());
if let Some(Some(_)) = clip { } else {
"+ Add clip".blit(self.buf, x + 1, y + y2, Some(Style::default().dim()));
"+".blit(self.buf, x + 1, y + y2, style);
}
"".blit(self.buf, x + 6, y + y2 - 1, style);
"".blit(self.buf, x + 6, y + y2 + 1, style);
",".blit(self.buf, x - 1, y + y2, style);
"".blit(self.buf, x - 2, y + y2, style);
".".blit(self.buf, x + 12, y + y2, style);
"".blit(self.buf, x + 13, y + y2, style);
}
}
}
}
y2 = y2 + 1;
}
"Add clip…".blit(self.buf, x, y + y2, Some(Style::default().dim()));
" + Add clip".blit(self.buf, x, y + y2, Some(Style::default().dim()));
}
fn highlight (&self, highlight: bool) -> Style {