mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
sampler, meter: switch to rms; reenable viewer
This commit is contained in:
parent
6db5df5210
commit
b9c101081b
5 changed files with 45 additions and 31 deletions
|
|
@ -90,13 +90,14 @@ impl Sampler {
|
|||
}
|
||||
|
||||
pub fn view_sample (&self, note_pt: usize) -> impl Content<TuiOut> + use<'_> {
|
||||
Outer(true, Style::default().fg(Tui::g(96))).enclose(draw_viewer(if let Some((_, sample)) = &self.recording {
|
||||
Some(sample)
|
||||
} else if let Some(sample) = &self.mapped[note_pt] {
|
||||
Some(sample)
|
||||
} else {
|
||||
None
|
||||
}))
|
||||
Outer(true, Style::default().fg(Tui::g(96)))
|
||||
.enclose(Fill::xy(draw_viewer(if let Some((_, sample)) = &self.recording {
|
||||
Some(sample)
|
||||
} else if let Some(sample) = &self.mapped[note_pt] {
|
||||
Some(sample)
|
||||
} else {
|
||||
None
|
||||
})))
|
||||
}
|
||||
|
||||
pub fn status (&self, index: usize) -> impl Content<TuiOut> {
|
||||
|
|
@ -105,13 +106,13 @@ impl Sampler {
|
|||
|
||||
pub fn view_meters_input (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
Tui::bg(Black, Fixed::x(2, Map::east(1, ||self.input_meters.iter(), |value, _index|{
|
||||
Fill::y(Meter(*value))
|
||||
Fill::y(RmsMeter(*value))
|
||||
})))
|
||||
}
|
||||
|
||||
pub fn view_meters_output (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
Tui::bg(Black, Fixed::x(2, Map::east(1, ||self.output_meters.iter(), |value, _index|{
|
||||
Fill::y(Meter(*value))
|
||||
Fill::y(RmsMeter(*value))
|
||||
})))
|
||||
}
|
||||
}
|
||||
|
|
@ -132,7 +133,7 @@ fn draw_list_item (sample: &Option<Arc<RwLock<Sample>>>) -> String {
|
|||
}
|
||||
|
||||
fn draw_viewer (sample: Option<&Arc<RwLock<Sample>>>) -> impl Content<TuiOut> + use<'_> {
|
||||
let min_db = -40.0;
|
||||
let min_db = -64.0;
|
||||
ThunkRender::new(move|to: &mut TuiOut|{
|
||||
let [x, y, width, height] = to.area();
|
||||
let area = Rect { x, y, width, height };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue