fill editor area!

This commit is contained in:
🪞👃🪞 2024-12-21 22:48:15 +01:00
parent c83f949f53
commit 2b08738992
3 changed files with 10 additions and 9 deletions

View file

@ -120,7 +120,7 @@ render!(<Tui>|self: ArrangerTui|{
}); });
with_size(with_status(with_editbar(with_pool(with_transport(col!([ with_size(with_status(with_editbar(with_pool(with_transport(col!([
Fill::w(Fixed::h(20, arranger())), Fill::w(Fixed::h(20, arranger())),
Fill::w(Fixed::h(25, &self.editor)), Fill::wh(&self.editor),
])))))) ]))))))
}); });
audio!(|self: ArrangerTui, client, scope|{ audio!(|self: ArrangerTui, client, scope|{

View file

@ -83,9 +83,10 @@ render!(<Tui>|self: TransportView|{
let color = self.color; let color = self.color;
struct Field<'a>(&'a str, &'a str, &'a ItemPalette); struct Field<'a>(&'a str, &'a str, &'a ItemPalette);
render!(<Tui>|self: Field<'a>|row!([ render!(<Tui>|self: Field<'a>|row!([
Tui::fg_bg(self.2.lightest.rgb, self.2.darkest.rgb, Tui::bold(true, self.0)), Tui::fg_bg(self.2.lightest.rgb, self.2.base.rgb, Tui::bold(true, self.0)),
Tui::fg_bg(self.2.lighter.rgb, self.2.darkest.rgb, ""), Tui::fg_bg(self.2.base.rgb, self.2.darkest.rgb, ""),
Tui::fg_bg(self.2.lighter.rgb, self.2.base.rgb, format!("{:>10}", self.1)), Tui::fg_bg(self.2.lightest.rgb, self.2.darkest.rgb, format!("{:>10}", self.1)),
Tui::fg_bg(self.2.darkest.rgb, self.2.base.rgb, ""),
])); ]));
Tui::bg(color.base.rgb, Fill::w(row!([ Tui::bg(color.base.rgb, Fill::w(row!([
//PlayPause(self.started), " ", //PlayPause(self.started), " ",
@ -95,8 +96,8 @@ render!(<Tui>|self: TransportView|{
]), ]),
" ", " ",
col!([ col!([
Field(" Time", format!("{:.1}s", self.current_second).as_str(), &color), Field("Time", format!("{:.1}s", self.current_second).as_str(), &color),
Field(" Smpl", format!("{:.1}k", self.current_sample).as_str(), &color), Field("Smpl", format!("{:.1}k", self.current_sample).as_str(), &color),
]), ]),
]))) ])))
}); });

View file

@ -241,7 +241,7 @@ impl PianoHorizontal {
} }
let time_end = time_start + zoom; let time_end = time_start + zoom;
for time in time_start..time_end { for time in time_start..time_end.min(phrase.length) {
for event in phrase.notes[time].iter() { for event in phrase.notes[time].iter() {
match event { match event {
MidiMessage::NoteOn { key, .. } => { MidiMessage::NoteOn { key, .. } => {