mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-04-27 21:20:13 +02:00
tengri 0.5.2: specify Map types/lifetimes
This commit is contained in:
parent
9c95ca9613
commit
d83be2ef1f
20
Cargo.lock
generated
20
Cargo.lock
generated
|
@ -1580,8 +1580,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tengri"
|
name = "tengri"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
source = "git+https://codeberg.org/unspeaker/tengri?rev=829d35b#829d35b61fc4323273613695f02bb1e6bfde0cbd"
|
source = "git+https://codeberg.org/unspeaker/tengri?rev=86236b7#86236b76cd421a67ece0633d38436cd38c770d9e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tengri_dsl",
|
"tengri_dsl",
|
||||||
"tengri_input",
|
"tengri_input",
|
||||||
|
@ -1591,8 +1591,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tengri_dsl"
|
name = "tengri_dsl"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
source = "git+https://codeberg.org/unspeaker/tengri?rev=829d35b#829d35b61fc4323273613695f02bb1e6bfde0cbd"
|
source = "git+https://codeberg.org/unspeaker/tengri?rev=86236b7#86236b76cd421a67ece0633d38436cd38c770d9e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itertools 0.14.0",
|
"itertools 0.14.0",
|
||||||
"konst",
|
"konst",
|
||||||
|
@ -1601,24 +1601,24 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tengri_input"
|
name = "tengri_input"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
source = "git+https://codeberg.org/unspeaker/tengri?rev=829d35b#829d35b61fc4323273613695f02bb1e6bfde0cbd"
|
source = "git+https://codeberg.org/unspeaker/tengri?rev=86236b7#86236b76cd421a67ece0633d38436cd38c770d9e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tengri_dsl",
|
"tengri_dsl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tengri_output"
|
name = "tengri_output"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
source = "git+https://codeberg.org/unspeaker/tengri?rev=829d35b#829d35b61fc4323273613695f02bb1e6bfde0cbd"
|
source = "git+https://codeberg.org/unspeaker/tengri?rev=86236b7#86236b76cd421a67ece0633d38436cd38c770d9e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tengri_dsl",
|
"tengri_dsl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tengri_tui"
|
name = "tengri_tui"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
source = "git+https://codeberg.org/unspeaker/tengri?rev=829d35b#829d35b61fc4323273613695f02bb1e6bfde0cbd"
|
source = "git+https://codeberg.org/unspeaker/tengri?rev=86236b7#86236b76cd421a67ece0633d38436cd38c770d9e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomic_float",
|
"atomic_float",
|
||||||
"better-panic",
|
"better-panic",
|
||||||
|
|
|
@ -19,7 +19,7 @@ lto = false
|
||||||
|
|
||||||
[workspace.dependencies.tengri]
|
[workspace.dependencies.tengri]
|
||||||
git = "https://codeberg.org/unspeaker/tengri"
|
git = "https://codeberg.org/unspeaker/tengri"
|
||||||
rev = "829d35b"
|
rev = "86236b7"
|
||||||
features = [ "tui", "dsl" ]
|
features = [ "tui", "dsl" ]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
(bsp/n
|
(bsp/n
|
||||||
(fixed/y 2 :transport)
|
(fixed/y 1 :transport)
|
||||||
(bsp/s
|
(bsp/s
|
||||||
(fixed/y 2 :status)
|
(fixed/y 1 :status)
|
||||||
(fill/xy
|
(fill/xy
|
||||||
(bsp/a
|
(bsp/a
|
||||||
(fill/xy
|
(fill/xy
|
||||||
|
|
|
@ -53,9 +53,9 @@ pub struct TekCli {
|
||||||
/// Multi-track MIDI sequencer.
|
/// Multi-track MIDI sequencer.
|
||||||
Arranger {
|
Arranger {
|
||||||
/// Number of scenes
|
/// Number of scenes
|
||||||
#[arg(short = 'y', long, default_value_t = 12)] scenes: usize,
|
#[arg(short = 'y', long, default_value_t = 4)] scenes: usize,
|
||||||
/// Number of tracks
|
/// Number of tracks
|
||||||
#[arg(short = 'x', long, default_value_t = 16)] tracks: usize,
|
#[arg(short = 'x', long, default_value_t = 4)] tracks: usize,
|
||||||
/// Width of tracks
|
/// Width of tracks
|
||||||
#[arg(short = 'w', long, default_value_t = 12)] track_width: usize,
|
#[arg(short = 'w', long, default_value_t = 12)] track_width: usize,
|
||||||
},
|
},
|
||||||
|
|
|
@ -48,7 +48,7 @@ impl<'a> Content<TuiOut> for ArrangerView<'a> {
|
||||||
let bg = |x|Tui::bg(Reset, x);
|
let bg = |x|Tui::bg(Reset, x);
|
||||||
let track_scroll = |x|Bsp::s(&self.track_scroll, x);
|
let track_scroll = |x|Bsp::s(&self.track_scroll, x);
|
||||||
let scene_scroll = |x|Bsp::e(&self.scene_scroll, x);
|
let scene_scroll = |x|Bsp::e(&self.scene_scroll, x);
|
||||||
ins(tracks(outs(bg(track_scroll(scene_scroll(self.scenes()))))))
|
ins(scene_scroll(track_scroll(tracks(outs(bg(self.scenes()))))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,21 +119,23 @@ pub(crate) fn io_ports <'a, T: PortsSizes<'a>> (
|
||||||
fg: Color, bg: Color, iter: impl Fn()->T + Send + Sync + 'a
|
fg: Color, bg: Color, iter: impl Fn()->T + Send + Sync + 'a
|
||||||
) -> impl Content<TuiOut> + 'a {
|
) -> impl Content<TuiOut> + 'a {
|
||||||
Map::new(iter,
|
Map::new(iter,
|
||||||
move|(index, name, connections, y, y2), _|map_south(y as u16, (y2-y) as u16, Bsp::s(
|
move|(index, name, connections, y, y2): (usize, &'a Arc<str>, &'a [PortConnect], usize, usize), _|
|
||||||
Fill::x(Tui::bold(true, Tui::fg_bg(fg, bg, Align::w(Bsp::e(" ", name))))),
|
map_south(y as u16, (y2-y) as u16, Bsp::s(
|
||||||
Map::new(||connections.iter(), move|connect, index|map_south(index as u16, 1,
|
Fill::x(Tui::bold(true, Tui::fg_bg(fg, bg, Align::w(Bsp::e(" ", name))))),
|
||||||
Fill::x(Align::w(Tui::bold(false, Tui::fg_bg(fg, bg,
|
Map::new(||connections.iter(), move|connect: &'a PortConnect, index|map_south(index as u16, 1,
|
||||||
&connect.info)))))))))
|
Fill::x(Align::w(Tui::bold(false, Tui::fg_bg(fg, bg,
|
||||||
|
&connect.info)))))))))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn io_conns <'a, T: PortsSizes<'a>> (
|
pub(crate) fn io_conns <'a, T: PortsSizes<'a>> (
|
||||||
fg: Color, bg: Color, iter: impl Fn()->T + Send + Sync + 'a
|
fg: Color, bg: Color, iter: impl Fn()->T + Send + Sync + 'a
|
||||||
) -> impl Content<TuiOut> + 'a {
|
) -> impl Content<TuiOut> + 'a {
|
||||||
Map::new(iter,
|
Map::new(iter,
|
||||||
move|(index, name, connections, y, y2), _|map_south(y as u16, (y2-y) as u16, Bsp::s(
|
move|(index, name, connections, y, y2): (usize, &'a Arc<str>, &'a [PortConnect], usize, usize), _|
|
||||||
Fill::x(Tui::bold(true, wrap(bg, fg, Fill::x(Align::w("▞▞▞▞ ▞▞▞▞"))))),
|
map_south(y as u16, (y2-y) as u16, Bsp::s(
|
||||||
Map::new(||connections.iter(), move|connect, index|map_south(index as u16, 1,
|
Fill::x(Tui::bold(true, wrap(bg, fg, Fill::x(Align::w("▞▞▞▞ ▞▞▞▞"))))),
|
||||||
Fill::x(Align::w(Tui::bold(false, wrap(bg, fg, Fill::x(""))))))))))
|
Map::new(||connections.iter(), move|connect, index|map_south(index as u16, 1,
|
||||||
|
Fill::x(Align::w(Tui::bold(false, wrap(bg, fg, Fill::x(""))))))))))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn per_track_top <'a, T: Content<TuiOut> + 'a, U: TracksSizes<'a>> (
|
pub(crate) fn per_track_top <'a, T: Content<TuiOut> + 'a, U: TracksSizes<'a>> (
|
||||||
|
@ -141,14 +143,13 @@ pub(crate) fn per_track_top <'a, T: Content<TuiOut> + 'a, U: TracksSizes<'a>> (
|
||||||
tracks: impl Fn() -> U + Send + Sync + 'a,
|
tracks: impl Fn() -> U + Send + Sync + 'a,
|
||||||
callback: impl Fn(usize, &'a Track)->T + Send + Sync + 'a
|
callback: impl Fn(usize, &'a Track)->T + Send + Sync + 'a
|
||||||
) -> impl Content<TuiOut> + 'a {
|
) -> impl Content<TuiOut> + 'a {
|
||||||
Align::x(Tui::bg(Reset, Map::new(tracks, move|(index, track, x1, x2), _|{
|
Align::x(Tui::bg(Reset, Map::new(tracks,
|
||||||
let width = (x2 - x1) as u16;
|
move|(index, track, x1, x2): (usize, &'a Track, usize, usize), _|{
|
||||||
map_east(x1 as u16, width, Fixed::x(width, Tui::fg_bg(
|
let width = (x2 - x1) as u16;
|
||||||
track.color.lightest.rgb,
|
map_east(x1 as u16, width, Fixed::x(width, Tui::fg_bg(
|
||||||
track.color.base.rgb,
|
track.color.lightest.rgb,
|
||||||
callback(index, track)
|
track.color.base.rgb,
|
||||||
)))
|
callback(index, track))))})))
|
||||||
})))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn per_track <'a, T: Content<TuiOut> + 'a, U: TracksSizes<'a>> (
|
pub(crate) fn per_track <'a, T: Content<TuiOut> + 'a, U: TracksSizes<'a>> (
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl Tek {
|
||||||
}
|
}
|
||||||
/// Height available to display tracks.
|
/// Height available to display tracks.
|
||||||
pub(crate) fn h_tracks_area (&self) -> u16 {
|
pub(crate) fn h_tracks_area (&self) -> u16 {
|
||||||
self.h().saturating_sub(self.h_inputs() + self.h_outputs() + 10)
|
self.h().saturating_sub(self.h_inputs() + self.h_outputs())
|
||||||
}
|
}
|
||||||
/// Height available to display tracks.
|
/// Height available to display tracks.
|
||||||
pub(crate) fn h_scenes_area (&self) -> u16 {
|
pub(crate) fn h_scenes_area (&self) -> u16 {
|
||||||
|
|
|
@ -35,7 +35,7 @@ impl<'a> ArrangerView<'a> {
|
||||||
||self.tracks_with_sizes_scrolled(),
|
||self.tracks_with_sizes_scrolled(),
|
||||||
move|track_index, track|Map::new(
|
move|track_index, track|Map::new(
|
||||||
||self.scenes_with_track_colors(),
|
||self.scenes_with_track_colors(),
|
||||||
move|(scene_index, scene, y1, y2, prev_scene): SceneWithColor, _|
|
move|(scene_index, scene, y1, y2, prev_scene): SceneWithColor<'a>, _|
|
||||||
view_scene_clip(
|
view_scene_clip(
|
||||||
self.width_mid,
|
self.width_mid,
|
||||||
(1 + y2 - y1) as u16,
|
(1 + y2 - y1) as u16,
|
||||||
|
|
Loading…
Reference in a new issue