@dawcore/components 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -979,6 +979,15 @@ declare class DawEditorElement extends LitElement {
|
|
|
979
979
|
connectedCallback(): void;
|
|
980
980
|
disconnectedCallback(): void;
|
|
981
981
|
willUpdate(changedProperties: Map<string, unknown>): void;
|
|
982
|
+
/**
|
|
983
|
+
* Cache of the last ViewportState forwarded to the spectrogram controller.
|
|
984
|
+
* Lit's `updated()` fires on every reactive state change (`_isPlaying`,
|
|
985
|
+
* `_selectedTrackId`, etc.) — most of which don't affect the spectrogram
|
|
986
|
+
* viewport. Skip the cross-controller call when nothing changed.
|
|
987
|
+
*
|
|
988
|
+
* The orchestrator dedupes too, but this avoids the call entirely.
|
|
989
|
+
*/
|
|
990
|
+
private _lastSpectrogramViewport;
|
|
982
991
|
protected updated(_changed: Map<string, unknown>): void;
|
|
983
992
|
private _onTrackConnected;
|
|
984
993
|
private _onTrackRemoved;
|
package/dist/index.d.ts
CHANGED
|
@@ -979,6 +979,15 @@ declare class DawEditorElement extends LitElement {
|
|
|
979
979
|
connectedCallback(): void;
|
|
980
980
|
disconnectedCallback(): void;
|
|
981
981
|
willUpdate(changedProperties: Map<string, unknown>): void;
|
|
982
|
+
/**
|
|
983
|
+
* Cache of the last ViewportState forwarded to the spectrogram controller.
|
|
984
|
+
* Lit's `updated()` fires on every reactive state change (`_isPlaying`,
|
|
985
|
+
* `_selectedTrackId`, etc.) — most of which don't affect the spectrogram
|
|
986
|
+
* viewport. Skip the cross-controller call when nothing changed.
|
|
987
|
+
*
|
|
988
|
+
* The orchestrator dedupes too, but this avoids the call entirely.
|
|
989
|
+
*/
|
|
990
|
+
private _lastSpectrogramViewport;
|
|
982
991
|
protected updated(_changed: Map<string, unknown>): void;
|
|
983
992
|
private _onTrackConnected;
|
|
984
993
|
private _onTrackRemoved;
|
package/dist/index.js
CHANGED
|
@@ -3828,6 +3828,15 @@ var DawEditorElement = class extends import_lit14.LitElement {
|
|
|
3828
3828
|
v.scrollSelector = ".scroll-area";
|
|
3829
3829
|
return v;
|
|
3830
3830
|
})();
|
|
3831
|
+
/**
|
|
3832
|
+
* Cache of the last ViewportState forwarded to the spectrogram controller.
|
|
3833
|
+
* Lit's `updated()` fires on every reactive state change (`_isPlaying`,
|
|
3834
|
+
* `_selectedTrackId`, etc.) — most of which don't affect the spectrogram
|
|
3835
|
+
* viewport. Skip the cross-controller call when nothing changed.
|
|
3836
|
+
*
|
|
3837
|
+
* The orchestrator dedupes too, but this avoids the call entirely.
|
|
3838
|
+
*/
|
|
3839
|
+
this._lastSpectrogramViewport = null;
|
|
3831
3840
|
// --- Track Events ---
|
|
3832
3841
|
this._onTrackConnected = (e) => {
|
|
3833
3842
|
const trackId = e.detail?.trackId;
|
|
@@ -4364,7 +4373,11 @@ var DawEditorElement = class extends import_lit14.LitElement {
|
|
|
4364
4373
|
if (this._spectrogramController) {
|
|
4365
4374
|
const vs = this._viewport.visibleStart;
|
|
4366
4375
|
const ve = this._viewport.visibleEnd;
|
|
4376
|
+
const spp = this._renderSpp;
|
|
4367
4377
|
if (Number.isFinite(vs) && Number.isFinite(ve)) {
|
|
4378
|
+
const prev = this._lastSpectrogramViewport;
|
|
4379
|
+
if (prev && prev.vs === vs && prev.ve === ve && prev.spp === spp) return;
|
|
4380
|
+
this._lastSpectrogramViewport = { vs, ve, spp };
|
|
4368
4381
|
const span = ve - vs;
|
|
4369
4382
|
const bufferPad = span * 0.25;
|
|
4370
4383
|
this._spectrogramController.setViewport({
|
|
@@ -4372,7 +4385,7 @@ var DawEditorElement = class extends import_lit14.LitElement {
|
|
|
4372
4385
|
visibleEndPx: ve,
|
|
4373
4386
|
bufferStartPx: Math.max(0, vs - bufferPad),
|
|
4374
4387
|
bufferEndPx: ve + bufferPad,
|
|
4375
|
-
samplesPerPixel:
|
|
4388
|
+
samplesPerPixel: spp
|
|
4376
4389
|
});
|
|
4377
4390
|
}
|
|
4378
4391
|
}
|