mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
This commit is contained in:
parent
094d5dd451
commit
5a360d02fa
2 changed files with 42 additions and 20 deletions
|
|
@ -29,4 +29,4 @@
|
||||||
(fixed/x 20 :view-pool)
|
(fixed/x 20 :view-pool)
|
||||||
(bsp/e
|
(bsp/e
|
||||||
(fixed/x 20 (fill/xy (align/n :view-arranger-scene-names)))
|
(fixed/x 20 (fill/xy (align/n :view-arranger-scene-names)))
|
||||||
(fill/xy :view-arranger))))))
|
(fill/xy (align/n :view-arranger-scene-clips)))))))
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,40 @@ impl App {
|
||||||
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
ArrangerView::new(&self.project, self.editor.as_ref())
|
ArrangerView::new(&self.project, self.editor.as_ref())
|
||||||
}
|
}
|
||||||
|
pub fn view_arranger_scene_names <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
||||||
|
let h = self.project.scenes.len() as u16 * 2;
|
||||||
|
let bg = self.color.darker.rgb;
|
||||||
|
Fixed::y(h, Tui::bg(bg, Align::w(Fill::x(Map::new(
|
||||||
|
||self.project.scenes.iter().skip(self.project.scene_scroll),
|
||||||
|
move|scene: &Scene, index|
|
||||||
|
Push::y(index as u16 * 2u16, Fixed::xy(20, 2,
|
||||||
|
Tui::bg(scene.color.dark.rgb, Align::nw(Bsp::e(
|
||||||
|
format!(" {index:2} "),
|
||||||
|
Tui::fg(Rgb(255, 255, 255),
|
||||||
|
Tui::bold(true, format!("{}", scene.name)))))))))))))
|
||||||
|
}
|
||||||
|
pub fn view_arranger_scene_clips <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
||||||
|
let h = self.project.scenes.len() as u16 * 2;
|
||||||
|
let bg = self.color.darker.rgb;
|
||||||
|
Fixed::y(h, Tui::bg(bg, Align::w(Fill::x(Map::new(
|
||||||
|
||self.project.scenes.iter().skip(self.project.scene_scroll),
|
||||||
|
move|scene: &'a Scene, index1|
|
||||||
|
Push::y(index1 as u16 * 2u16, Fixed::xy(20, 2,
|
||||||
|
Map::new(
|
||||||
|
move||scene.clips.iter().skip(self.project.track_scroll),
|
||||||
|
move|clip: &'a Option<Arc<RwLock<MidiClip>>>, index2|{
|
||||||
|
let (theme, text) = if let Some(clip) = clip {
|
||||||
|
let clip = clip.read().unwrap();
|
||||||
|
(clip.color, clip.name.clone())
|
||||||
|
} else {
|
||||||
|
(scene.color, Default::default())
|
||||||
|
};
|
||||||
|
Push::x(index2 as u16 * 14, Tui::bg(theme.dark.rgb, Bsp::e(
|
||||||
|
format!(" {index1:2} {index2:2} "),
|
||||||
|
Tui::fg(Rgb(255, 255, 255),
|
||||||
|
Tui::bold(true, format!("{}", text))))))
|
||||||
|
}))))))))
|
||||||
|
}
|
||||||
pub fn view_arranger_track_names (&self) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_arranger_track_names (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
let mut max_outputs = 0u16;
|
let mut max_outputs = 0u16;
|
||||||
for track in self.project.tracks.iter() {
|
for track in self.project.tracks.iter() {
|
||||||
|
|
@ -100,14 +134,14 @@ impl App {
|
||||||
Bsp::w(
|
Bsp::w(
|
||||||
Fixed::x(20, Tui::bg(self.color.darkest.rgb,
|
Fixed::x(20, Tui::bg(self.color.darkest.rgb,
|
||||||
col!(Tui::bold(true, "[t]rack"), "[T] Add"))),
|
col!(Tui::bold(true, "[t]rack"), "[T] Add"))),
|
||||||
Fixed::y(max_outputs + 1, Tui::bg(self.color.darker.rgb, Align::w(Fill::x(Map::new(
|
Align::w(Fixed::y(max_outputs + 1, Tui::bg(self.color.darker.rgb, Align::w(Fill::x(Map::new(
|
||||||
||self.project.tracks_with_sizes(&self.project.selection, None)
|
||self.project.tracks_with_sizes(&self.project.selection, None)
|
||||||
.skip(self.project.track_scroll),
|
.skip(self.project.track_scroll),
|
||||||
move|(index, track, x1, x2): (usize, &Track, usize, usize), _|
|
move|(index, track, x1, x2): (usize, &Track, usize, usize), _|
|
||||||
Push::x(x2 as u16, Fixed::xy(track.width as u16, max_outputs + 1,
|
Push::x(index as u16 * 14, Fixed::xy(track.width as u16, max_outputs + 1,
|
||||||
Tui::bg(track.color.dark.rgb, Align::nw(Bsp::s(
|
Tui::bg(track.color.dark.rgb, Align::nw(Bsp::s(
|
||||||
Tui::fg(Rgb(255, 255, 255), Tui::bold(true, format!("{}", track.name))),
|
Tui::fg(Rgb(255, 255, 255), Tui::bold(true, format!("{}", track.name))),
|
||||||
format!("{index} {x1} {x2}"))))))))))))
|
format!("{index} {x1} {x2}")))))))))))))
|
||||||
}
|
}
|
||||||
pub fn view_arranger_track_outputs <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
pub fn view_arranger_track_outputs <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
||||||
let mut max_outputs = 0u16;
|
let mut max_outputs = 0u16;
|
||||||
|
|
@ -117,7 +151,7 @@ impl App {
|
||||||
Bsp::w(
|
Bsp::w(
|
||||||
Fixed::x(20, Tui::bg(self.color.darkest.rgb,
|
Fixed::x(20, Tui::bg(self.color.darkest.rgb,
|
||||||
col!(Tui::bold(true, "[o]utput"), "[O] Add"))),
|
col!(Tui::bold(true, "[o]utput"), "[O] Add"))),
|
||||||
Fixed::y(max_outputs + 1, Tui::bg(self.color.darker.rgb, Align::w(Fill::x(Map::new(
|
Align::w(Fixed::y(max_outputs + 1, Tui::bg(self.color.darker.rgb, Align::w(Fill::x(Map::new(
|
||||||
||self.project.tracks_with_sizes(&self.project.selection, None)
|
||self.project.tracks_with_sizes(&self.project.selection, None)
|
||||||
.skip(self.project.track_scroll),
|
.skip(self.project.track_scroll),
|
||||||
move|(index, track, x1, x2): (usize, &'a Track, usize, usize), _|
|
move|(index, track, x1, x2): (usize, &'a Track, usize, usize), _|
|
||||||
|
|
@ -128,7 +162,7 @@ impl App {
|
||||||
format!("[mut] [sol]"),
|
format!("[mut] [sol]"),
|
||||||
Map::south(1, ||track.sequencer.midi_outs.iter(),
|
Map::south(1, ||track.sequencer.midi_outs.iter(),
|
||||||
|port, index|Tui::fg(Rgb(255, 255, 255),
|
|port, index|Tui::fg(Rgb(255, 255, 255),
|
||||||
format!("{index}: {}", port.name()))))))))))))))
|
format!("{index}: {}", port.name())))))))))))))))
|
||||||
}
|
}
|
||||||
pub fn view_arranger_track_inputs <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
pub fn view_arranger_track_inputs <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
||||||
let mut max_inputs = 0u16;
|
let mut max_inputs = 0u16;
|
||||||
|
|
@ -138,7 +172,7 @@ impl App {
|
||||||
Bsp::w(
|
Bsp::w(
|
||||||
Fixed::x(20, Tui::bg(self.color.darkest.rgb,
|
Fixed::x(20, Tui::bg(self.color.darkest.rgb,
|
||||||
col!(Tui::bold(true, "[i]nputs"), "[I] Add"))),
|
col!(Tui::bold(true, "[i]nputs"), "[I] Add"))),
|
||||||
Fixed::y(max_inputs + 1, Tui::bg(self.color.darker.rgb, Align::w(Fill::x(Map::new(
|
Fill::x(Align::w(Fixed::y(max_inputs + 1, Tui::bg(self.color.darker.rgb, Align::w(Fill::x(Map::new(
|
||||||
||self.project.tracks_with_sizes(&self.project.selection, None)
|
||self.project.tracks_with_sizes(&self.project.selection, None)
|
||||||
.skip(self.project.track_scroll),
|
.skip(self.project.track_scroll),
|
||||||
move|(index, track, x1, x2): (usize, &'a Track, usize, usize), _|
|
move|(index, track, x1, x2): (usize, &'a Track, usize, usize), _|
|
||||||
|
|
@ -147,7 +181,7 @@ impl App {
|
||||||
format!("[rec] [mon]"),
|
format!("[rec] [mon]"),
|
||||||
Map::south(1, ||track.sequencer.midi_ins.iter(),
|
Map::south(1, ||track.sequencer.midi_ins.iter(),
|
||||||
|port, index|Tui::fg(Rgb(255, 255, 255),
|
|port, index|Tui::fg(Rgb(255, 255, 255),
|
||||||
format!("{index}: {}", port.name()))))))))))))))
|
format!("{index}: {}", port.name()))))))))))))))))
|
||||||
}
|
}
|
||||||
pub fn view_arranger_track_devices <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
pub fn view_arranger_track_devices <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
||||||
let mut max_devices = 2u16;
|
let mut max_devices = 2u16;
|
||||||
|
|
@ -181,18 +215,6 @@ impl App {
|
||||||
Align::nw(Map::south(1, ||track.devices.iter(),
|
Align::nw(Map::south(1, ||track.devices.iter(),
|
||||||
|device, index|format!("{index}: {}", device.name())))))))))))
|
|device, index|format!("{index}: {}", device.name())))))))))))
|
||||||
}
|
}
|
||||||
pub fn view_arranger_scene_names <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
|
||||||
Fixed::y(self.project.scenes.len() as u16 * 2,
|
|
||||||
Tui::bg(self.color.darker.rgb,
|
|
||||||
Align::w(Fill::x(Map::new(
|
|
||||||
||self.project.scenes.iter().skip(self.project.scene_scroll),
|
|
||||||
move|scene: &Scene, index|
|
|
||||||
Push::y(index as u16 * 2u16, Fixed::xy(20, 2,
|
|
||||||
Tui::bg(scene.color.dark.rgb, Align::nw(Bsp::e(
|
|
||||||
format!(" {index:2} "),
|
|
||||||
Tui::fg(Rgb(255, 255, 255),
|
|
||||||
Tui::bold(true, format!("{}", scene.name)))))))))))))
|
|
||||||
}
|
|
||||||
pub fn view_pool (&self) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_pool (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
Fixed::x(20, Bsp::s(
|
Fixed::x(20, Bsp::s(
|
||||||
Fill::x(Align::w(FieldH(self.color, "Clip pool:", ""))),
|
Fill::x(Align::w(FieldH(self.color, "Clip pool:", ""))),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue