mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +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);
|
audio!(|self:GrooveboxTui,_client,_process|Control::Continue);
|
||||||
has_clock!(|self:GrooveboxTui|&self.sequencer.clock);
|
has_clock!(|self:GrooveboxTui|&self.sequencer.clock);
|
||||||
render!(<Tui>|self:GrooveboxTui|Fill::wh(lay!([
|
render!(<Tui>|self:GrooveboxTui|{
|
||||||
&self.size,
|
let w = self.size.w();
|
||||||
Fill::wh(Align::s(Fixed::h(2, GrooveboxStatus::from(self)))),
|
let phrase_w = if w > 60 { 20 } else if w > 40 { 15 } else { 10 };
|
||||||
Tui::shrink_y(2, col!([
|
let pool_w = if self.sequencer.phrases.visible { phrase_w } else { 0 };
|
||||||
Fixed::h(2, row!([
|
let sampler_w = 24;
|
||||||
Fixed::wh(5, 2, PlayPause(self.clock().is_rolling())),
|
Fill::wh(lay!([
|
||||||
Fixed::h(2, TransportView::from((self, self.sequencer.player.play_phrase().as_ref().map(|(_,p)|
|
&self.size,
|
||||||
p.as_ref().map(|p|p.read().unwrap().color)
|
Fill::wh(Align::s(Fixed::h(2, GrooveboxStatus::from(self)))),
|
||||||
).flatten().clone(), true))),
|
Tui::shrink_y(2, col!([
|
||||||
])),
|
Fixed::h(2, row!([
|
||||||
Tui::push_x(20, Fixed::h(1, row!([
|
Fixed::wh(5, 2, PlayPause(self.clock().is_rolling())),
|
||||||
PhraseSelector::play_phrase(&self.sequencer.player),
|
Fixed::h(2, TransportView::from((self, self.sequencer.player.play_phrase().as_ref().map(|(_,p)|
|
||||||
PhraseSelector::next_phrase(&self.sequencer.player),
|
p.as_ref().map(|p|p.read().unwrap().color)
|
||||||
]))),
|
).flatten().clone(), true))),
|
||||||
row!([
|
])),
|
||||||
Tui::pull_y(1, Tui::shrink_y(0, Fill::h(Fixed::w(20, &self.sampler)))),
|
Tui::push_x(sampler_w, Fixed::h(1, row!([
|
||||||
Fill::wh(&self.sequencer),
|
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 {
|
pub enum GrooveboxCommand {
|
||||||
Sequencer(SequencerCommand),
|
Sequencer(SequencerCommand),
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ pub use self::jack::*;
|
||||||
|
|
||||||
pub mod midi; pub(crate) use self::midi::*;
|
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 mod transport; pub(crate) use self::transport::*;
|
||||||
pub use self::transport::TransportTui;
|
pub use self::transport::TransportTui;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::{*, tui::piano_h::PianoHorizontalKeys};
|
use crate::*;
|
||||||
|
|
||||||
use KeyCode::Char;
|
use KeyCode::Char;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use symphonia::{
|
use symphonia::{
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,11 @@ render!(<Tui>|self: SequencerTui|{
|
||||||
PhraseSelector::play_phrase(&self.player),
|
PhraseSelector::play_phrase(&self.player),
|
||||||
PhraseSelector::next_phrase(&self.player),
|
PhraseSelector::next_phrase(&self.player),
|
||||||
]).when(self.selectors);;
|
]).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|{
|
audio!(|self:SequencerTui, client, scope|{
|
||||||
// Start profiling cycle
|
// 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 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