mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 03:36:41 +01:00
arranger (sorta. sizing woes)
This commit is contained in:
parent
2013bac62f
commit
182107bfa5
4 changed files with 8 additions and 19 deletions
|
|
@ -20,6 +20,6 @@
|
|||
(view (bsp/a :view-dialog
|
||||
(bsp/e
|
||||
(fill/y (align/n (bsp/s :view-status-v (bsp/s
|
||||
(bsp/s :view-midi-ports-status :view-audio-ports-status)
|
||||
:view-audio-ports-status
|
||||
(bsp/n :view-editor-status :view-pool)))))
|
||||
:view-arranger)))
|
||||
|
|
|
|||
|
|
@ -70,15 +70,6 @@ impl Arrangement {
|
|||
pub fn h (&self) -> u16 {
|
||||
self.size.h() as u16
|
||||
}
|
||||
/// Height available to display track headers.
|
||||
pub fn h_tracks_area (&self) -> u16 {
|
||||
5 // FIXME
|
||||
//self.h().saturating_sub(self.h_inputs() + self.h_outputs())
|
||||
}
|
||||
/// Height available to display tracks.
|
||||
pub fn h_scenes_area (&self) -> u16 {
|
||||
20 // FIXME
|
||||
}
|
||||
/// Height taken by all scenes.
|
||||
pub fn h_scenes (&self, is_editing: bool) -> u16 {
|
||||
self.scenes_with_sizes(
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use crate::*;
|
|||
impl<'a> ArrangerView<'a> {
|
||||
|
||||
pub(crate) fn input_routes (&'a self) -> impl Content<TuiOut> + 'a {
|
||||
Tryptich::top(self.inputs_height)
|
||||
Tryptich::top(self.arrangement.h_inputs())
|
||||
.left(self.width_side,
|
||||
io_ports(Tui::g(224), Tui::g(32), ||self.arrangement.midi_ins_with_sizes()))
|
||||
.middle(self.width_mid,
|
||||
|
|
@ -127,7 +127,7 @@ impl<'a> ArrangerView<'a> {
|
|||
}
|
||||
|
||||
pub(crate) fn output_conns (&'a self) -> impl Content<TuiOut> + 'a {
|
||||
Tryptich::top(self.outputs_height)
|
||||
Tryptich::top(self.arrangement.h_outputs())
|
||||
.left(self.width_side, io_ports(
|
||||
Tui::g(224), Tui::g(32), ||self.arrangement.midi_outs_with_sizes()))
|
||||
.middle(self.width_mid, per_track_top(
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ pub struct ArrangerView<'a> {
|
|||
pub width: u16,
|
||||
pub width_mid: u16,
|
||||
pub width_side: u16,
|
||||
pub inputs_height: u16,
|
||||
pub outputs_height: u16,
|
||||
pub scene_last: usize,
|
||||
pub scene_scroll: Fill<Fixed<u16, ScrollbarV>>,
|
||||
pub scene_selected: Option<usize>,
|
||||
/// Height available to display scene/track content.
|
||||
pub scenes_height: u16,
|
||||
pub track_scroll: Fill<Fixed<u16, ScrollbarH>>,
|
||||
pub track_selected: Option<usize>,
|
||||
/// Height available to display track headers.
|
||||
pub tracks_height: u16,
|
||||
}
|
||||
|
||||
|
|
@ -23,8 +23,8 @@ impl<'a> ArrangerView<'a> {
|
|||
editor: Option<&'a MidiEditor>
|
||||
) -> Self {
|
||||
let is_editing = editor.is_some();
|
||||
let h_tracks_area = arrangement.h_tracks_area();
|
||||
let h_scenes_area = arrangement.h_scenes_area();
|
||||
let h_tracks_area = 5;
|
||||
let h_scenes_area = (arrangement.height() as u16).saturating_sub(50);
|
||||
let h_scenes = arrangement.h_scenes(is_editing);
|
||||
Self {
|
||||
arrangement,
|
||||
|
|
@ -32,8 +32,6 @@ impl<'a> ArrangerView<'a> {
|
|||
width: arrangement.w_tracks_area(is_editing),
|
||||
width_mid: arrangement.w_tracks_area(is_editing).saturating_sub(20),
|
||||
width_side: 20,
|
||||
inputs_height: arrangement.h_inputs(),
|
||||
outputs_height: arrangement.h_outputs(),
|
||||
scenes_height: h_scenes_area,
|
||||
scene_selected: arrangement.selection().scene(),
|
||||
scene_last: arrangement.scenes.len().saturating_sub(1),
|
||||
|
|
@ -62,7 +60,7 @@ impl<'a> Content<TuiOut> for ArrangerView<'a> {
|
|||
let bg = |x|Tui::bg(Reset, x);
|
||||
//let track_scroll = |x|Bsp::s(&self.track_scroll, x);
|
||||
//let scene_scroll = |x|Bsp::e(&self.scene_scroll, x);
|
||||
outs(tracks(devices(ins(bg(self.scenes(&None))))))
|
||||
self.arrangement.size.of(outs(tracks(devices(ins(bg(self.scenes(&None)))))))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue