mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
wip: p.55, e=95
This commit is contained in:
parent
54fb5b6ece
commit
37ac7823af
10 changed files with 272 additions and 219 deletions
|
|
@ -4,8 +4,9 @@ impl<'a, T: TransportViewState> Content for TransportView<'a, T> {
|
|||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
let state = self.0;
|
||||
let focused = state.transport_focused();
|
||||
lay!(
|
||||
state.focus().wrap(state.is_focused(), TransportFocus::PlayPause, &Styled(
|
||||
state.transport_selected().wrap(focused, TransportFocus::PlayPause, &Styled(
|
||||
None,
|
||||
match state.transport_state() {
|
||||
Some(TransportState::Rolling) => "▶ PLAYING",
|
||||
|
|
@ -16,19 +17,19 @@ impl<'a, T: TransportViewState> Content for TransportView<'a, T> {
|
|||
).min_xy(11, 2).push_x(1)).align_x().fill_x(),
|
||||
|
||||
row!(
|
||||
state.focus().wrap(state.is_focused(), TransportFocus::Bpm, &Outset::X(1u16, {
|
||||
state.transport_selected().wrap(focused, TransportFocus::Bpm, &Outset::X(1u16, {
|
||||
let bpm = state.bpm_value();
|
||||
row! { "BPM ", format!("{}.{:03}", bpm as usize, (bpm * 1000.0) % 1000.0) }
|
||||
})),
|
||||
//let quant = state.focus().wrap(state.focused(), TransportFocus::Quant, &Outset::X(1u16, row! {
|
||||
//"QUANT ", ppq_to_name(state.0.quant as usize)
|
||||
//})),
|
||||
state.focus().wrap(state.is_focused(), TransportFocus::Sync, &Outset::X(1u16, row! {
|
||||
state.transport_selected().wrap(focused, TransportFocus::Sync, &Outset::X(1u16, row! {
|
||||
"SYNC ", pulses_to_name(state.sync_value() as usize)
|
||||
}))
|
||||
).align_w().fill_x(),
|
||||
|
||||
state.focus().wrap(state.is_focused(), TransportFocus::Clock, &{
|
||||
state.transport_selected().wrap(focused, TransportFocus::Clock, &{
|
||||
let time1 = state.format_beat();
|
||||
let time2 = state.format_msu();
|
||||
row!("B" ,time1.as_str(), " T", time2.as_str()).outset_x(1)
|
||||
|
|
@ -55,6 +56,7 @@ impl Content for SequencerTui {
|
|||
impl Content for ArrangerTui {
|
||||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
let arranger_focused = self.arranger_focused();
|
||||
Split::up(
|
||||
1,
|
||||
widget(&TransportView(self)),
|
||||
|
|
@ -73,14 +75,14 @@ impl Content for ArrangerTui {
|
|||
.grow_y(1)
|
||||
.border(Lozenge(Style::default()
|
||||
.bg(TuiTheme::border_bg())
|
||||
.fg(TuiTheme::border_fg(ArrangerViewState::focused(self))))),
|
||||
.fg(TuiTheme::border_fg(arranger_focused)))),
|
||||
widget(&self.size),
|
||||
widget(&format!("[{}] Arranger", if self.entered {
|
||||
"■"
|
||||
} else {
|
||||
" "
|
||||
}))
|
||||
.fg(TuiTheme::title_fg(ArrangerViewState::focused(self)))
|
||||
.fg(TuiTheme::title_fg(arranger_focused))
|
||||
.push_x(1),
|
||||
),
|
||||
Split::right(
|
||||
|
|
@ -97,7 +99,7 @@ impl Content for ArrangerTui {
|
|||
impl<'a, T: PhrasesViewState> Content for PhrasesView<'a, T> {
|
||||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
let focused = self.0.focused();
|
||||
let focused = self.0.phrases_focused();
|
||||
let entered = self.0.entered();
|
||||
let phrases = self.0.phrases();
|
||||
let selected_phrase = self.0.phrase();
|
||||
|
|
@ -147,7 +149,7 @@ impl<'a, T: PhraseViewState> Content for PhraseView<'a, T> {
|
|||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
let phrase = self.0.phrase();
|
||||
let size = self.0.size();
|
||||
let focused = self.0.focused();
|
||||
let focused = self.0.phrase_focused();
|
||||
let entered = self.0.entered();
|
||||
let keys = self.0.keys();
|
||||
let buffer = self.0.buffer();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue