pub struct TerminalCanvas {
pub width: usize,
pub height: usize,
}Fields§
§width: usize§height: usizeImplementations§
Source§impl TerminalCanvas
impl TerminalCanvas
pub fn new(width: usize, height: usize) -> Self
pub fn clear_screen(&self)
pub fn restore_cursor(&self)
pub fn show_cursor(&self)
pub fn move_to(&self, row: usize, col: usize)
pub fn clear_region(&self, top: usize, left: usize, w: usize, h: usize)
Sourcepub fn draw_panel(
&self,
top: usize,
left: usize,
w: usize,
h: usize,
title: &str,
status: Option<&str>,
)
pub fn draw_panel( &self, top: usize, left: usize, w: usize, h: usize, title: &str, status: Option<&str>, )
Gambar panel dengan border metal, title bar, dan optional status teks. Mirip tampilan hardware compressor/limiter di studio profesional.
Sourcepub fn draw_vu_meter(
&self,
row: usize,
col: usize,
label: &str,
current_linear: f32,
peak_linear: f32,
db_value: f32,
width: usize,
)
pub fn draw_vu_meter( &self, row: usize, col: usize, label: &str, current_linear: f32, peak_linear: f32, db_value: f32, width: usize, )
Render VU Meter bergaya plugin DAW lengkap:
- Bar gradien hijau → kuning → merah (segmen LED)
- Peak hold indicator (⬤) yang persist antar-frame
- Panah arah (▲/▼) menunjukkan level naik/turun
- Nilai dBFS digital di samping
Sourcepub fn draw_vu_simple(
&self,
row: usize,
col: usize,
label: &str,
level_linear: f32,
width: usize,
)
pub fn draw_vu_simple( &self, row: usize, col: usize, label: &str, level_linear: f32, width: usize, )
Versi ringkas tanpa peak hold & arrow
Sourcepub fn draw_smooth_spectrum(
&self,
top: usize,
left: usize,
height: usize,
bands: &[(f32, &str)],
)
pub fn draw_smooth_spectrum( &self, top: usize, left: usize, height: usize, bands: &[(f32, &str)], )
Spectrum analyzer vertikal dengan tepi mulus (antialiasing). Setiap kolom merepresentasikan satu band frekuensi. Menggunakan █ penuh + ▀ setengah atas untuk kesan halus seperti hardware spectrum analyzer analog.
Sourcepub fn draw_waveform(
&self,
top: usize,
left: usize,
width: usize,
height: usize,
samples: &[f32],
)
pub fn draw_waveform( &self, top: usize, left: usize, width: usize, height: usize, samples: &[f32], )
Render mini waveform horizontal dalam area tertentu. Setiap sample direpresentasikan sebagai titik • pada posisi Y sesuai amplitude.
Sourcepub fn draw_rolling_meter(
&self,
top: usize,
left: usize,
width: usize,
height: usize,
value: f32,
peak_value: f32,
label: &str,
)
pub fn draw_rolling_meter( &self, top: usize, left: usize, width: usize, height: usize, value: f32, peak_value: f32, label: &str, )
Rolling/falling level meter bergaya hardware mixer. Level turun secara gradual memberi kesan “live”.
Sourcepub fn draw_stereo_pan(
&self,
row: usize,
col: usize,
pan_left: f32,
_pan_right: f32,
width: usize,
)
pub fn draw_stereo_pan( &self, row: usize, col: usize, pan_left: f32, _pan_right: f32, width: usize, )
Indikator stereo pan/phase balance horizontal.
Sourcepub fn draw_h_slider(
&self,
row: usize,
col: usize,
value_pct: f32,
min_val: f32,
max_val: f32,
label: &str,
width: usize,
)
pub fn draw_h_slider( &self, row: usize, col: usize, value_pct: f32, min_val: f32, max_val: f32, label: &str, width: usize, )
Visualisasi slider/knob horizontal bergaya mixer untuk parameter EQ atau gain.
Sourcepub fn draw_processing_status(
&self,
row: usize,
col: usize,
active_tags: &[&str],
)
pub fn draw_processing_status( &self, row: usize, col: usize, active_tags: &[&str], )
Badge status proses DSP aktif — tampil seperti indikator di hardware compressor.
Sourcepub fn draw_header(
&self,
row: usize,
col: usize,
title: &str,
sample_rate: u32,
channels: usize,
)
pub fn draw_header( &self, row: usize, col: usize, title: &str, sample_rate: u32, channels: usize, )
Header bergaya judul plugin DAW dengan info teknis sistem.