Fit the Compressor's tab to any size, make auto-gain a switch (#378)
Two things came up on the new tab. Floated and sized down, it spilled its knobs out of its window, and sized up it left the window empty. Auto-gain lifted far too much: it brought 0 dB back to 0 dB, which at -40 dB, 4:1 and knee 6 is +28.1 dB, so a sound at -24 dB came out at -6 dB. And as a knob from 0 to 1 it blended between makeup and auto-gain, so at 1 the makeup knob did nothing. Layout: - The knobs stay on the bottom line, centred, with the help line above them. - The levels fill the height left above. The curve is a square at their right, centred up and down. It grows with the tab from 180 to 360 px and takes no more than 40 % of its width (picturesLayout). - A floated window cannot be sized below what its pane needs. A pane says so in its minWidth and minHeight, and the Compressor's is every knob and the smallest pictures. Other panes keep 320 x 200. - A pane put into an open window that is too small grows the window. Auto-gain, as decided in #378: - A Compressor's auto-gain gives back what it takes from a sound at -18 dB, so that one comes out as loud as it went in. At the numbers above that is +14.6 dB. - Auto-gain is a switch on the Compressor, the Limiter and the Saturation alike, a setting and no longer an input. The makeup or output is added on top of it instead of being blended with it. - A project from before reads a number as on above 0. Nodes never set keep their defaults: off on the Compressor, on on the other two. - The tab shows the switch at the right of the knobs, with the dB it gives below it. With it on, the curve has a line at -18 dB from the curve up to the diagonal. - Every level reading keeps the gain of its time. Before, the whole picture was read by the current makeup, so after a change the tinting of the last seconds was wrong or missing. Findings: - My first e2e run of the layout clicked Dock where it was before the window was sized up, so the window stayed open and the next check went red. The check reads the button again. Tests: - Gate (melektaus-atx): 282 files, 4344 tests (6 new) - e2e 34 (melektaus-atx): ALL PASSED, 118 checks (2 new) - Offline in Chrome: a sine at -18 dB through -24 dB and 4:1 came out at -17.92 dB with auto-gain on and -22.42 dB with it off. - Counter-checks: the curve set at the top instead of the middle, and every reading read at a gain of 0, each fail exactly their test. - Looked at the window in screenshots: at its least every knob and the switch show. At 1280 x 797 the levels fill the height, the curve is centred at the right and the knobs are at the bottom. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1df38bd430
commit
2d4909d248
15 files changed
+424
-120
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { type Container, type FederatedPointerEvent, Graphics, Rectangle } from 'pixi.js';
|
||||
import { Button, crisp, drawFloatingBox, Icon, Label, Spacer, Theme, ui, Widget } from '../ui';
|
||||
import { onScreen, sized, type WindowBox } from './floating';
|
||||
import { leastBox, onScreen, sized, type WindowBox } from './floating';
|
||||
import { TabHeader } from './TabHeader';
|
||||
|
||||
/** The corner taken hold of to size the window. */
|
||||
@@ -93,6 +93,8 @@ export class FloatWindow extends Widget {
|
||||
content.visible = true;
|
||||
this.addChildAt(content, this.getChildIndex(this.bar));
|
||||
this.layout();
|
||||
// A pane that needs more than the window has grows the window.
|
||||
if (this.isOpen) this.place(this.box);
|
||||
}
|
||||
|
||||
/** The name and the icon of the document shown, as its tab had them. */
|
||||
@@ -139,15 +141,22 @@ export class FloatWindow extends Widget {
|
||||
const screen = ui().app.screen;
|
||||
const dx = e.global.x - g.x;
|
||||
const dy = e.global.y - g.y;
|
||||
if (g.kind === 'size') this.place(sized(g.box, dx, dy, screen.width, screen.height));
|
||||
if (g.kind === 'size') this.place(sized(g.box, dx, dy, screen.width, screen.height, this.least()));
|
||||
else this.place({ ...g.box, x: g.box.x + dx, y: g.box.y + dy });
|
||||
}
|
||||
|
||||
private readonly keepOnScreen = () => this.place(this.box);
|
||||
|
||||
/** The window's least size: the usual one, or more where the pane in it says it needs more. */
|
||||
least(): { w: number; h: number } {
|
||||
const content = this.content;
|
||||
if (!content) return leastBox(0, 0);
|
||||
return leastBox(content.minWidth + 2, content.minHeight + this.bar.measure().h + 2);
|
||||
}
|
||||
|
||||
private place(box: WindowBox): void {
|
||||
const screen = ui().app.screen;
|
||||
const fit = onScreen(box, screen.width, screen.height);
|
||||
const fit = onScreen(box, screen.width, screen.height, this.least());
|
||||
this.position.set(fit.x, fit.y);
|
||||
this.resize(fit.w, fit.h);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user