unified compact flag in groovebox

This commit is contained in:
🪞👃🪞 2025-01-02 18:40:29 +01:00
parent c9a79b1f29
commit 511ff91864
12 changed files with 129 additions and 188 deletions

View file

@ -7,12 +7,14 @@ use PhrasePoolCommand::*;
/// Root view for standalone `tek_sequencer`.
pub struct SequencerTui {
_jack: Arc<RwLock<JackConnection>>,
pub pool: PoolModel,
pub editor: MidiEditor,
pub player: MidiPlayer,
pub transport: bool,
pub selectors: bool,
pub clock: Clock,
pub pool: PoolModel,
pub player: MidiPlayer,
pub editor: MidiEditor,
pub size: Measure<Tui>,
pub status: bool,
pub note_buf: Vec<u8>,
@ -26,12 +28,14 @@ from_jack!(|jack|SequencerTui {
None, Some(ItemColor::random().into())
)));
Self {
_jack: jack.clone(),
_jack: jack.clone(),
pool: PoolModel::from(&phrase),
editor: MidiEditor::from(&phrase),
player: MidiPlayer::from((&clock, &phrase)),
transport: true,
selectors: true,
pool: PoolModel::from(&phrase),
editor: MidiEditor::from(&phrase),
player: MidiPlayer::from((&clock, &phrase)),
size: Measure::new(),
midi_buf: vec![vec![];65536],
note_buf: vec![],
@ -44,7 +48,7 @@ render!(Tui: (self: SequencerTui) => {
let w = self.size.w();
let phrase_w = if w > 60 { 20 } else if w > 40 { 15 } else { 10 };
let pool_w = if self.pool.visible { phrase_w } else { 0 };
let pool = Pull::y(1, Fill::y(Align::e(PoolView(&self.pool))));
let pool = Pull::y(1, Fill::y(Align::e(PoolView(self.pool.visible, &self.pool))));
let with_pool = move|x|Bsp::w(Fixed::x(pool_w, pool), x);
let status = SequencerStatus::from(self);
let with_status = |x|Bsp::n(Fixed::x(if self.status { 2 } else { 0 }, status), x);