feat(gpui_widgets): add scope widgets and audio level meter

W6 of the oak task list. scopes::math is a pure, unit-tested core
(histogram binning, waveform min/max envelopes, vectorscope chroma
projection, meter segment math, peak-hold decay) feeding three canvas
widgets - Histogram, Waveform, Vectorscope - generic over LumaDataSource /
ChromaDataSource traits the host implements over its frame buffers, plus an
AudioLevelMeter over AudioMeterDataSource with lit segments and a peak
marker. examples/scopes.rs drives all four from mock signals. 96 widget
tests pass.
This commit is contained in:
2026-08-09 06:29:06 +08:00
parent 63dbc64a32
commit bdb1684de7
7 changed files with 649 additions and 2 deletions
+8 -2
View File
@@ -114,9 +114,15 @@
## W6. 示波器与音频表
- [ ] `Histogram` / `Vectorscope` / `Waveform` 检视组件(canvas
- [x] `Histogram` / `Vectorscope` / `Waveform` 检视组件(canvas
绘制,数据来自 oak render C ABI 的帧采样)。
- [ ] `AudioLevelMeter` 表头(数据来自 oak audio C ABI)。
> `gpui_widgets::scopes`:纯数学(直方图分箱、波形 min/max 包络、
> vectorscope 色度投影)单测覆盖;`LumaDataSource`/`ChromaDataSource`
> trait 由 host 经 C ABI 提供帧采样。
- [x] `AudioLevelMeter` 表头(数据来自 oak audio C ABI)。
> `gpui_widgets::audio_meter`:分段点亮 + 峰值保持衰减(纯数学
> 单测);`AudioMeterDataSource` trait。
> `examples/scopes.rs`mock 信号源驱动四个组件。
## W7. 主题系统