wip: p.48, e=14, somewhat less todo.

This commit is contained in:
🪞👃🪞 2024-11-17 06:41:08 +01:00
parent 28d0020261
commit 550fd4cbcd
4 changed files with 118 additions and 23 deletions

View file

@ -121,7 +121,7 @@ pub fn arranger_content_vertical (
// track titles
let header = row!((track, w) in tracks.iter().zip(cols.iter().map(|col|col.0))=>{
// name and width of track
let name = track.name.read().unwrap();
let name = track.name().read().unwrap();
let max_w = w.saturating_sub(1).min(name.len()).max(2);
let name = format!("{}", &name[0..max_w]);
let name = TuiStyle::bold(name, true);
@ -159,7 +159,7 @@ pub fn arranger_content_vertical (
.unwrap_or("(none)".into()));
col!(name, /*input, output,*/ until_next, elapsed)
.min_xy(w as u16, header_h)
.bg(track.color.rgb)
.bg(track.color().rgb)
.push_x(scenes_w)
});
// tracks and scenes
@ -205,7 +205,7 @@ pub fn arranger_content_vertical (
// cursor
add(&CustomWidget::new(any_size, move|to: &mut TuiOutput|{
let area = to.area();
let focused = view.focused;
let focused = view.is_focused();
let selected = view.selected;
let get_track_area = |t: usize| [
scenes_w + area.x() + cols[t].1 as u16, area.y(),
@ -258,7 +258,7 @@ pub fn arranger_content_vertical (
})
}))
}).bg(bg.rgb);
let color = TuiTheme::title_fg(view.focused);
let color = TuiTheme::title_fg(view.is_focused());
let size = format!("{}x{}", view.size.w(), view.size.h());
let lower_right = TuiStyle::fg(size, color).pull_x(1).align_se().fill_xy();
lay!(arrangement, lower_right)
@ -267,7 +267,7 @@ pub fn arranger_content_vertical (
pub fn arranger_content_horizontal (
view: &ArrangerTui,
) -> impl Widget<Engine = Tui> + use<'_> {
let focused = view.focused;
let focused = view.is_focused();
let _tracks = view.tracks();
lay!(
focused.then_some(Background(TuiTheme::border_bg())),
@ -461,7 +461,7 @@ impl TransportViewState for ArrangerTui {
fn focus (&self) -> TransportFocus {
self.focus
}
fn focused (&self) -> bool {
fn is_focused (&self) -> bool {
self.focused
}
fn transport_state (&self) -> Option<TransportState> {
@ -482,7 +482,52 @@ impl TransportViewState for ArrangerTui {
}
impl PhrasesViewState for ArrangerTui {
fn focused (&self) -> bool {
todo!()
}
fn entered (&self) -> bool {
todo!()
}
fn phrases (&self) -> Vec<()> {
todo!()
}
fn phrase (&self) -> usize {
todo!()
}
fn mode (&self) -> Option<&PhrasesMode> {
&self.mode
}
}
impl PhraseViewState for ArrangerTui {
fn focused (&self) -> bool {
todo!()
}
fn entered (&self) -> bool {
todo!()
}
fn keys (&self) -> &Buffer {
todo!()
}
fn phrase (&self) -> &Option<Arc<RwLock<Phrase>>> {
todo!()
}
fn buffer (&self) -> &BigBuffer {
todo!()
}
fn note_len (&self) -> usize {
todo!()
}
fn note_axis (&self) -> &RwLock<FixedAxis<usize>> {
todo!()
}
fn time_axis (&self) -> &RwLock<ScaledAxis<usize>> {
todo!()
}
fn size (&self) -> &Measure<Tui> {
todo!()
}
fn now (&self) -> &Arc<Pulse> {
todo!()
}
}