shrink sampler

This commit is contained in:
🪞👃🪞 2025-01-02 21:11:15 +01:00
parent 6c266fcfca
commit 5bd9068bbe
3 changed files with 8 additions and 7 deletions

View file

@ -89,15 +89,14 @@ render!(Tui: (self: Groovebox) => {
let w = self.size.w(); let w = self.size.w();
let phrase_w = if w > 60 { 20 } else if w > 40 { 15 } else { 10 }; let phrase_w = if w > 60 { 20 } else if w > 40 { 15 } else { 10 };
let pool_w = if !self.compact { phrase_w } else { 5 }; let pool_w = if !self.compact { phrase_w } else { 5 };
let sampler_w = if !self.compact { phrase_w } else { 4 }; let sampler_w = if !self.compact { 11 } else { 4 };
let sample_h = if !self.compact { 5 } else { 0 }; let sample_h = if !self.compact { 5 } else { 0 };
let note_pt = self.editor.note_point(); let note_pt = self.editor.note_point();
let color = self.player.play_phrase().as_ref() let color = self.player.play_phrase().as_ref()
.and_then(|(_,p)|p.as_ref().map(|p|p.read().unwrap().color)) .and_then(|(_,p)|p.as_ref().map(|p|p.read().unwrap().color))
.clone(); .clone();
let sampler = Fixed::x(sampler_w, Push::y(if self.compact { 1 } else { 0 },
let sampler = Align::w(Fill::y(SampleList::new(self.compact, &self.sampler, &self.editor)))));
Fixed::x(sampler_w, Push::y(1, Align::w(Fill::y(SampleList::new(self.compact, &self.sampler, &self.editor)))));
let selectors = let selectors =
Bsp::e(ClipSelected::play_phrase(&self.player), ClipSelected::next_phrase(&self.player)); Bsp::e(ClipSelected::play_phrase(&self.player), ClipSelected::next_phrase(&self.player));
let edit_clip = let edit_clip =
@ -125,7 +124,7 @@ render!(Tui: (self: Groovebox) => {
Align::x(Fixed::y(1, MidiEditStatus(&self.editor))), Align::x(Fixed::y(1, MidiEditStatus(&self.editor))),
), ),
Bsp::w( Bsp::w(
Fixed::x(pool_w, Align::e(Fill::y(PoolView(self.compact, &self.pool)))), Fixed::x(pool_w, PoolView(self.compact, &self.pool)),
Fill::xy(Bsp::e(sampler, &self.editor)), Fill::xy(Bsp::e(sampler, &self.editor)),
), ),
) )

View file

@ -33,8 +33,10 @@ impl PianoHorizontal {
'╎' '╎'
} else if time % note_len == 0 { } else if time % note_len == 0 {
'┊' '┊'
} else if (127 - note) % 12 == 1 { } else if (127 - note) % 12 == 0 {
'=' '='
} else if (127 - note) % 6 == 0 {
'—'
} else { } else {
'·' '·'
}); });

View file

@ -17,7 +17,7 @@ render!(Tui: (self: SampleList<'a>) => {
let note_lo = editor.note_lo().load(Relaxed); let note_lo = editor.note_lo().load(Relaxed);
let note_pt = editor.note_point(); let note_pt = editor.note_point();
let note_hi = editor.note_hi(); let note_hi = editor.note_hi();
Fill::xy(Tui::map(move||(note_lo..=note_hi).rev(), move|note, i| { Outer(Style::default().fg(TuiTheme::g(96))).enclose(Tui::map(move||(note_lo..=note_hi).rev(), move|note, i| {
let offset = |a|Push::y(i as u16, Align::n(Fixed::y(1, Fill::x(a)))); let offset = |a|Push::y(i as u16, Align::n(Fixed::y(1, Fill::x(a))));