Zoom the height of a sound's wave over its level scale (#357)
The Sound tab always drew the wave at the full height of the tab. Quiet stretches were hard to see, and there was no room above a loud wave. - A level scale in dB stands left of the wave, a mark every 6 dB down from 0, as long as a mark lies inside the area and at least 14 px from the middle. - The wheel over the scale zooms the height, from 0.25x to 16x. Over the wave it zooms the time as before. - What is louder than the area stops at its edge. The fade ramps grow with the wave. - Fit puts the height back to 1x. The tab keeps the height with its view when another tab is shown. - The rules live in waveView.ts (zoomLevel, levelMarks), the hooks give the height, the scale and the top of a full-scale wave. Tests: - Unit wave-view: 10 green (2 new), 2 counter-checks each red - e2e 34 (melektaus-atx): ALL PASSED, 87 checks (1 new) - Gate (melektaus-atx): CHECK EXIT 0, 270 files, 4183 tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
25c1d02b06
commit
c7fa1d15b0
5 files changed
+245
-35
No files matched your search
@@ -16,6 +16,11 @@ export function soundHooks({ state, editor }: HookContext) {
|
||||
/** The stretch between the handles, in seconds; null while the file is not there. */
|
||||
span: () => soundEditor.canvas.shownSpan(),
|
||||
duration: () => soundEditor.canvas.fileDuration(),
|
||||
/** The height zoom (#357): the factor, the middle of the level scale, and the top of a full-scale wave. */
|
||||
level: () => soundEditor.canvas.levelZoom,
|
||||
scale: () => soundEditor.canvas.scaleCentre(),
|
||||
fullScaleTop: () => soundEditor.canvas.fullScaleTop(),
|
||||
fitButton: () => centreOf(soundEditor.fitButton),
|
||||
cursor: () => soundEditor.canvas.cursor,
|
||||
playhead: () => soundEditor.canvas.playhead,
|
||||
playing: () => soundEditor.isPlaying,
|
||||
|
||||
Reference in new issue
Block a user