mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
add sample viewer area
This commit is contained in:
parent
df00fedfd6
commit
b63a5e31ba
5 changed files with 50 additions and 8 deletions
|
|
@ -61,6 +61,7 @@ render!(<Tui>|self:GrooveboxTui|{
|
|||
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 sampler_w = 11;
|
||||
let note_pt = self.editor.note_point();
|
||||
Fill::wh(lay!([
|
||||
&self.size,
|
||||
Fill::wh(Align::s(Fixed::h(2, GrooveboxStatus::from(self)))),
|
||||
|
|
@ -76,8 +77,20 @@ render!(<Tui>|self:GrooveboxTui|{
|
|||
PhraseSelector::next_phrase(&self.player),
|
||||
]))),
|
||||
row!([
|
||||
Tui::split_n(false, 1,
|
||||
MidiEditStatus(&self.editor),
|
||||
Tui::split_n(false, 5,
|
||||
col!([
|
||||
row!(|add|{
|
||||
if let Some(sample) = &self.sampler.mapped[note_pt] {
|
||||
add(&format!("Sample {}", sample.read().unwrap().end))?;
|
||||
}
|
||||
add(&MidiEditStatus(&self.editor))?;
|
||||
Ok(())
|
||||
}),
|
||||
lay!([
|
||||
Outer(Style::default().fg(TuiTheme::g(128))),
|
||||
Fill::w(Fixed::h(4, SampleViewer(None))),
|
||||
]),
|
||||
]),
|
||||
Tui::split_w(false, pool_w,
|
||||
Tui::pull_y(1, Fill::h(Align::e(PoolView(&self.pool)))),
|
||||
Tui::split_e(false, sampler_w, Fill::wh(col!([
|
||||
|
|
@ -91,12 +104,6 @@ render!(<Tui>|self:GrooveboxTui|{
|
|||
]))
|
||||
});
|
||||
|
||||
struct Meters<'a>(&'a[f32]);
|
||||
render!(<Tui>|self: Meters<'a>|col!([
|
||||
&format!("L/{:>+9.3}", self.0[0]),
|
||||
&format!("R/{:>+9.3}", self.0[1]),
|
||||
]));
|
||||
|
||||
struct GrooveboxSamples<'a>(&'a GrooveboxTui);
|
||||
render!(<Tui>|self: GrooveboxSamples<'a>|{
|
||||
let note_lo = self.0.editor.note_lo().load(Relaxed);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue