mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
move piano_h to top of crate
This commit is contained in:
parent
12f6b679c7
commit
51971e4c25
11 changed files with 39 additions and 27 deletions
|
|
@ -38,30 +38,38 @@ pub enum GrooveboxFocus {
|
|||
|
||||
audio!(|self:GrooveboxTui,_client,_process|Control::Continue);
|
||||
has_clock!(|self:GrooveboxTui|&self.sequencer.clock);
|
||||
render!(<Tui>|self:GrooveboxTui|Fill::wh(lay!([
|
||||
&self.size,
|
||||
Fill::wh(Align::s(Fixed::h(2, GrooveboxStatus::from(self)))),
|
||||
Tui::shrink_y(2, col!([
|
||||
Fixed::h(2, row!([
|
||||
Fixed::wh(5, 2, PlayPause(self.clock().is_rolling())),
|
||||
Fixed::h(2, TransportView::from((self, self.sequencer.player.play_phrase().as_ref().map(|(_,p)|
|
||||
p.as_ref().map(|p|p.read().unwrap().color)
|
||||
).flatten().clone(), true))),
|
||||
])),
|
||||
Tui::push_x(20, Fixed::h(1, row!([
|
||||
PhraseSelector::play_phrase(&self.sequencer.player),
|
||||
PhraseSelector::next_phrase(&self.sequencer.player),
|
||||
]))),
|
||||
row!([
|
||||
Tui::pull_y(1, Tui::shrink_y(0, Fill::h(Fixed::w(20, &self.sampler)))),
|
||||
Fill::wh(&self.sequencer),
|
||||
]),
|
||||
render!(<Tui>|self:GrooveboxTui|{
|
||||
let w = self.size.w();
|
||||
let phrase_w = if w > 60 { 20 } else if w > 40 { 15 } else { 10 };
|
||||
let pool_w = if self.sequencer.phrases.visible { phrase_w } else { 0 };
|
||||
let sampler_w = 24;
|
||||
Fill::wh(lay!([
|
||||
&self.size,
|
||||
Fill::wh(Align::s(Fixed::h(2, GrooveboxStatus::from(self)))),
|
||||
Tui::shrink_y(2, col!([
|
||||
Fixed::h(2, row!([
|
||||
Fixed::wh(5, 2, PlayPause(self.clock().is_rolling())),
|
||||
Fixed::h(2, TransportView::from((self, self.sequencer.player.play_phrase().as_ref().map(|(_,p)|
|
||||
p.as_ref().map(|p|p.read().unwrap().color)
|
||||
).flatten().clone(), true))),
|
||||
])),
|
||||
Tui::push_x(sampler_w, Fixed::h(1, row!([
|
||||
PhraseSelector::play_phrase(&self.sequencer.player),
|
||||
PhraseSelector::next_phrase(&self.sequencer.player),
|
||||
]))),
|
||||
row!([
|
||||
Tui::pull_y(1, Tui::shrink_y(0, Fill::h(Fixed::w(sampler_w, &self.sampler)))),
|
||||
Tui::split_n(false, 1,
|
||||
MidiEditStatus(&self.sequencer.editor),
|
||||
Tui::split_w(false, pool_w,
|
||||
Tui::pull_y(1, Fill::h(Align::e(PoolView(&self.sequencer.phrases)))),
|
||||
Fill::wh(&self.sequencer.editor)
|
||||
)
|
||||
),
|
||||
]),
|
||||
]))
|
||||
]))
|
||||
])));
|
||||
//Bsp::n(
|
||||
//Fill::wh(lay!([
|
||||
//])),
|
||||
//)));
|
||||
});
|
||||
|
||||
pub enum GrooveboxCommand {
|
||||
Sequencer(SequencerCommand),
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ pub use self::jack::*;
|
|||
|
||||
pub mod midi; pub(crate) use self::midi::*;
|
||||
|
||||
pub mod piano_h; pub(crate) use self::piano_h::*;
|
||||
|
||||
pub mod transport; pub(crate) use self::transport::*;
|
||||
pub use self::transport::TransportTui;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
use crate::{*, tui::piano_h::PianoHorizontalKeys};
|
||||
|
||||
use crate::*;
|
||||
use KeyCode::Char;
|
||||
use std::fs::File;
|
||||
use symphonia::{
|
||||
|
|
|
|||
|
|
@ -62,7 +62,11 @@ render!(<Tui>|self: SequencerTui|{
|
|||
PhraseSelector::play_phrase(&self.player),
|
||||
PhraseSelector::next_phrase(&self.player),
|
||||
]).when(self.selectors);;
|
||||
Tui::min_y(15, with_size(with_status(col!([ toolbar, play_queue, editor, ]))))
|
||||
Tui::min_y(15, with_size(with_status(col!([
|
||||
toolbar,
|
||||
play_queue,
|
||||
editor,
|
||||
]))))
|
||||
});
|
||||
audio!(|self:SequencerTui, client, scope|{
|
||||
// Start profiling cycle
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ mod tui_border; pub(crate) use self::tui_border::*;
|
|||
///////////////////////////////////////////////////////
|
||||
|
||||
pub mod file_browser; pub(crate) use self::file_browser::*;
|
||||
pub mod piano_h; pub(crate) use self::piano_h::*;
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue