retest: 7e, 1f

This commit is contained in:
i do not exist 2026-07-01 16:35:20 +03:00
parent 383e534692
commit c53c5bf377
4 changed files with 29 additions and 21 deletions

View file

@ -20,7 +20,7 @@ pub(crate) fn load_bind (binds: &Binds, name: &impl AsRef<str>, body: &impl Lang
///
/// ```
/// let lang = "(@x (nop)) (@y (nop) (nop))";
/// let bind = tek::Bind::<tek::tengri::TuiEvent, std::sync::Arc<str>>::load(&lang).unwrap();
/// let bind = tek::Bind::<tek::tengri::term::TuiEvent, std::sync::Arc<str>>::load(&lang).unwrap();
/// assert_eq!(bind.query(&'x'.into()).map(|x|x.len()), Some(1));
/// //assert_eq!(bind.query(&'y'.into()).map(|x|x.len()), Some(2));
/// ```

View file

@ -98,7 +98,7 @@ impl Action {
} => {
let name = name.as_ref().map_or("tek", |x|x.as_str());
let jack = Jack::new(&name)?;
let proj = tek_project_new(
let mut proj = tek_project_new(
&jack, Clock::new(&jack, *bpm)?, &lf, &lt, &rf, &rt, &mf, &mt, &mfr, &mtr
)?;
proj.tracks_add(tracks.unwrap_or(0), None, &[], &[])?;
@ -135,7 +135,8 @@ impl Action {
//// FIXME: They don't work properly.
//Ok(app)
//})?)?;
}
},
_ => todo!()
}
Ok(())
}

View file

@ -23,9 +23,9 @@ pub fn view_logo () -> impl Draw<Tui> {
}
/// ```
/// let x = std::sync::Arc::<std::sync::RwLock<String>>::default();
/// let _ = tek::view_transport(true, x.clone(), x.clone(), x.clone());
/// let _ = tek::view_transport(false, x.clone(), x.clone(), x.clone());
/// let x = "";
/// let _ = tek::view_transport(true, x.as_ref(), x.as_ref(), x.as_ref());
/// let _ = tek::view_transport(false, x.as_ref(), x.as_ref(), x.as_ref());
/// ```
pub fn view_transport (play: bool, bpm: &str, beat: &str, time: &str) -> impl Draw<Tui> {
let theme = ItemTheme::G[96];
@ -40,9 +40,9 @@ pub fn view_transport (play: bool, bpm: &str, beat: &str, time: &str) -> impl Dr
}
/// ```
/// let x = std::sync::Arc::<std::sync::RwLock<String>>::default();
/// let _ = tek::view_status(None, x.clone(), x.clone(), x.clone());
/// let _ = tek::view_status(Some("".into()), x.clone(), x.clone(), x.clone());
/// let x = "";
/// let _ = tek::view_status(None, x.as_ref(), x.as_ref(), x.as_ref());
/// let _ = tek::view_status(Some("".into()), x.as_ref(), x.as_ref(), x.as_ref());
/// ```
pub fn view_status (sel: Option<&str>, sr: &str, buf: &str, lat: &str) -> impl Draw<Tui> {
let theme = ItemTheme::G[96];
@ -569,3 +569,18 @@ pub fn field_h <T: Screen> (theme: ItemTheme, head: impl Draw<T>, body: impl Dra
pub fn field_v <T: Screen> (theme: ItemTheme, head: impl Draw<T>, body: impl Draw<T>) -> impl Draw<T> {
}
pub fn view_sessions () -> impl Draw<Tui> {
let h = 6;
let w = Some(30);
let f = Rgb(224, 192, 128);
h_exact(h, w_min(w, thunk(move |to: &mut Tui|{
for (index, name) in ["session1", "session2", "session3"].iter().enumerate() {
let b = if index == 0 { Rgb(50,50,50) } else { Rgb(40,40,40) };
let y = (2 * index) as u16;
let h = 2;
y_push(y, &h_exact(h, w_full(bg(b, origin_w(fg(f, name)))))).draw(to);
}
Ok(to.area().into())
})))
}