@dawcore/components 0.0.33 → 0.0.35
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/README.md +3 -3
- package/dist/index.d.mts +342 -10
- package/dist/index.d.ts +342 -10
- package/dist/index.js +2290 -473
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2261 -439
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,187 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost } from 'lit';
|
|
3
|
-
import { MidiNoteData, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, SnapTo, ColorMapValue, ClipTrack, KeyboardShortcut } from '@waveform-playlist/core';
|
|
3
|
+
import { AnnotationData, AnnotationShortcutMap, MidiNoteData, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, SnapTo, ColorMapValue, ClipTrack, KeyboardShortcut } from '@waveform-playlist/core';
|
|
4
4
|
import WaveformData from 'waveform-data';
|
|
5
5
|
import { PlayoutAdapter, PlaylistEngine } from '@waveform-playlist/engine';
|
|
6
6
|
import { MidiLoadOptions, MidiLoadResult } from '@dawcore/midi';
|
|
7
7
|
import { ClipRegistration, CanvasRegistration, ViewportState } from '@dawcore/spectrogram';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Declarative annotation data element (light DOM). Its `start`/`end`
|
|
11
|
+
* attributes and text content ARE the single source of truth — the editor's
|
|
12
|
+
* annotation lane and <daw-annotation-list> both derive from them.
|
|
13
|
+
*/
|
|
14
|
+
declare class DawAnnotationElement extends LitElement {
|
|
15
|
+
/** Start time in seconds. Reflected — attribute writes drive both views. */
|
|
16
|
+
get start(): number;
|
|
17
|
+
set start(value: number);
|
|
18
|
+
private _start;
|
|
19
|
+
/** End time in seconds. Reflected. */
|
|
20
|
+
get end(): number;
|
|
21
|
+
set end(value: number);
|
|
22
|
+
private _end;
|
|
23
|
+
/** Musical start position (ticks). Authoritative when end-tick is also set —
|
|
24
|
+
* start/end seconds become a derived cache the host editor keeps fresh
|
|
25
|
+
* (clip startTick pattern). */
|
|
26
|
+
get startTick(): number | null;
|
|
27
|
+
set startTick(value: number | null);
|
|
28
|
+
private _startTick;
|
|
29
|
+
/** Musical end position (ticks). See startTick. */
|
|
30
|
+
get endTick(): number | null;
|
|
31
|
+
set endTick(value: number | null);
|
|
32
|
+
private _endTick;
|
|
33
|
+
/** Tick-based iff BOTH tick attributes are set (authority rule). */
|
|
34
|
+
get isTickBased(): boolean;
|
|
35
|
+
private _warnedHalfTick;
|
|
36
|
+
private readonly _generatedId;
|
|
37
|
+
/** Stable identity: the id attribute when present, else a generated UUID. */
|
|
38
|
+
get annotationId(): string;
|
|
39
|
+
toAnnotationData(): AnnotationData;
|
|
40
|
+
createRenderRoot(): this;
|
|
41
|
+
connectedCallback(): void;
|
|
42
|
+
private _hasRendered;
|
|
43
|
+
updated(changed: PropertyValues): void;
|
|
44
|
+
}
|
|
45
|
+
declare global {
|
|
46
|
+
interface HTMLElementTagNameMap {
|
|
47
|
+
'daw-annotation': DawAnnotationElement;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Declarative annotation track (light DOM). Children are <daw-annotation>
|
|
53
|
+
* elements — their attributes are the single source of truth. This element
|
|
54
|
+
* owns the ephemeral selection state and the programmatic API; the host
|
|
55
|
+
* <daw-editor> renders the timeline lane, <daw-annotation-list> renders the
|
|
56
|
+
* text panel.
|
|
57
|
+
*/
|
|
58
|
+
declare class DawAnnotationTrackElement extends LitElement {
|
|
59
|
+
editable: boolean;
|
|
60
|
+
linkEndpoints: boolean;
|
|
61
|
+
continuousPlay: boolean;
|
|
62
|
+
keyboardControls: boolean;
|
|
63
|
+
/** Lane box label mode: 'text' (default) | 'id' (sonnet-style: explicit id
|
|
64
|
+
* attribute, else 1-based position) | 'none' (pure region bars). The list
|
|
65
|
+
* always shows full text — this only affects the timeline lane. */
|
|
66
|
+
boxLabel: 'text' | 'id' | 'none';
|
|
67
|
+
/** Display label for the editor's controls-column lane row (mirrors
|
|
68
|
+
* <daw-track name>). Empty = blank spacer (opt-in, no layout change). */
|
|
69
|
+
name: string;
|
|
70
|
+
private _activeAnnotationId;
|
|
71
|
+
get activeAnnotationId(): string | null;
|
|
72
|
+
set activeAnnotationId(value: string | null);
|
|
73
|
+
/** Child annotation elements, sorted by start time. */
|
|
74
|
+
get annotationElements(): DawAnnotationElement[];
|
|
75
|
+
get annotations(): AnnotationData[];
|
|
76
|
+
selectNext(): void;
|
|
77
|
+
selectPrevious(): void;
|
|
78
|
+
selectFirst(): void;
|
|
79
|
+
selectLast(): void;
|
|
80
|
+
clearSelection(): void;
|
|
81
|
+
/** offset: +1 next / -1 previous; noSelectionIndex: 0 → first, -1 → last. */
|
|
82
|
+
private _selectByOffset;
|
|
83
|
+
playActive(): void;
|
|
84
|
+
moveStartBoundary(deltaMs: number): void;
|
|
85
|
+
moveEndBoundary(deltaMs: number): void;
|
|
86
|
+
private _moveBoundary;
|
|
87
|
+
private _timelineDuration;
|
|
88
|
+
private _activeElement;
|
|
89
|
+
private _hostEditor;
|
|
90
|
+
private _annotationShortcuts;
|
|
91
|
+
private _resolvedShortcuts;
|
|
92
|
+
get annotationShortcuts(): AnnotationShortcutMap | null;
|
|
93
|
+
set annotationShortcuts(value: AnnotationShortcutMap | null);
|
|
94
|
+
private _shortcutEntries;
|
|
95
|
+
private static readonly _boundaryActions;
|
|
96
|
+
private _onKeyDownCapture;
|
|
97
|
+
private _runShortcutAction;
|
|
98
|
+
private _childObserver;
|
|
99
|
+
createRenderRoot(): this;
|
|
100
|
+
connectedCallback(): void;
|
|
101
|
+
disconnectedCallback(): void;
|
|
102
|
+
}
|
|
103
|
+
declare global {
|
|
104
|
+
interface HTMLElementTagNameMap {
|
|
105
|
+
'daw-annotation-track': DawAnnotationTrackElement;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Scrollable text panel over a <daw-annotation-track>'s children — the same
|
|
111
|
+
* <daw-annotation> elements the editor lane renders (single source of truth).
|
|
112
|
+
* Linked via the `for` attribute (id of the track element).
|
|
113
|
+
*/
|
|
114
|
+
declare class DawAnnotationListElement extends LitElement {
|
|
115
|
+
for: string;
|
|
116
|
+
/** `'time'` (default): m:ss.mmm clock times, unchanged. `'bars'`: B.b – B.b
|
|
117
|
+
* bar.beat ranges resolved via the host editor's meter map — falls back
|
|
118
|
+
* to time display (and warns once) when no `<daw-editor>` ancestor is
|
|
119
|
+
* found via `this.track?.closest('daw-editor')`. */
|
|
120
|
+
timeDisplay: 'time' | 'bars';
|
|
121
|
+
/** Suppress re-render while a row's text is being edited. */
|
|
122
|
+
private _editingId;
|
|
123
|
+
private _activeId;
|
|
124
|
+
/** Playback-following highlight, separate from `_activeId` (selection) so
|
|
125
|
+
* playback never disturbs selection/keyboard editing. Driven by
|
|
126
|
+
* daw-timeupdate, cleared on daw-stop, retained on pause. */
|
|
127
|
+
private _playingId;
|
|
128
|
+
private _observer;
|
|
129
|
+
private _observedTrack;
|
|
130
|
+
private _warnedMissing;
|
|
131
|
+
/** Warn once per resolved `for` target when bars mode can't find a host
|
|
132
|
+
* editor — reset alongside `_warnedMissing` on `for` change so a
|
|
133
|
+
* retargeted list can warn again for its new target. */
|
|
134
|
+
private _warnedNoEditorForBars;
|
|
135
|
+
/** Set around `_cancelEdit`'s `span.blur()` so the resulting synchronous
|
|
136
|
+
* blur event doesn't re-enter `_commitEdit` (cancel already restores the
|
|
137
|
+
* text and clears `_editingId` itself). */
|
|
138
|
+
private _cancelling;
|
|
139
|
+
static styles: lit.CSSResult;
|
|
140
|
+
get track(): DawAnnotationTrackElement | null;
|
|
141
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
142
|
+
connectedCallback(): void;
|
|
143
|
+
disconnectedCallback(): void;
|
|
144
|
+
protected shouldUpdate(): boolean;
|
|
145
|
+
protected updated(): void;
|
|
146
|
+
/**
|
|
147
|
+
* Text content is set imperatively, NOT bound as a Lit expression.
|
|
148
|
+
* contenteditable mutates the span's DOM directly as the user types —
|
|
149
|
+
* that ejects lit-html's ChildPart marker comments for any binding at
|
|
150
|
+
* that position, so a later Lit-driven re-render of the same row throws
|
|
151
|
+
* "ChildPart has no parentNode". Keeping the span's children entirely
|
|
152
|
+
* outside Lit's diffing sidesteps the crash; the (soon-to-commit) edited
|
|
153
|
+
* row is skipped via the _editingId check.
|
|
154
|
+
*/
|
|
155
|
+
private _syncRowText;
|
|
156
|
+
/** (Re)attach the MutationObserver when the resolved track changes. */
|
|
157
|
+
private _ensureObserver;
|
|
158
|
+
private _onSelect;
|
|
159
|
+
/**
|
|
160
|
+
* Update only on annotation-boundary crossings, not per animation frame.
|
|
161
|
+
* `shouldUpdate()` suppresses the resulting render while a row is being
|
|
162
|
+
* edited (`_editingId`) — intentional, not bypassed here. A boundary
|
|
163
|
+
* crossed mid-edit is caught up on the NEXT crossing after the edit ends;
|
|
164
|
+
* the highlight is briefly stale in that window, which is acceptable
|
|
165
|
+
* (edits are rare and short-lived relative to playback).
|
|
166
|
+
*/
|
|
167
|
+
private _onTimeUpdate;
|
|
168
|
+
private _onStop;
|
|
169
|
+
private _onRowClick;
|
|
170
|
+
/** Formats a row's times span per `timeDisplay`. `'bars'` resolves the
|
|
171
|
+
* host editor once (shared across all rows in a render) and falls back
|
|
172
|
+
* to time display, warning once, when no editor is found. */
|
|
173
|
+
private _formatTimes;
|
|
174
|
+
private _annotationElement;
|
|
175
|
+
private _commitEdit;
|
|
176
|
+
private _cancelEdit;
|
|
177
|
+
render(): lit.TemplateResult<1>;
|
|
178
|
+
}
|
|
179
|
+
declare global {
|
|
180
|
+
interface HTMLElementTagNameMap {
|
|
181
|
+
'daw-annotation-list': DawAnnotationListElement;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
9
185
|
declare class DawClipElement extends LitElement {
|
|
10
186
|
src: string;
|
|
11
187
|
peaksSrc: string;
|
|
@@ -108,6 +284,10 @@ type SerializedEffectEntry = {
|
|
|
108
284
|
type: string;
|
|
109
285
|
params: Record<string, number>;
|
|
110
286
|
bypassed: boolean;
|
|
287
|
+
/** Present when the live entry was a failed-plugin placeholder (silent
|
|
288
|
+
* passthrough). Offline export skips these for parity with live
|
|
289
|
+
* playback; restore ignores the flag and retries normally. */
|
|
290
|
+
placeholder?: true;
|
|
111
291
|
} | {
|
|
112
292
|
kind: 'wam';
|
|
113
293
|
/** Module URL for url-loaded plugins. Absent for Faust entries. */
|
|
@@ -119,6 +299,10 @@ type SerializedEffectEntry = {
|
|
|
119
299
|
faustDsp?: string;
|
|
120
300
|
/** Name the Faust entry was compiled under (restores the same label). */
|
|
121
301
|
faustName?: string;
|
|
302
|
+
/** Present when the live entry was a failed-plugin placeholder (silent
|
|
303
|
+
* passthrough). Offline export skips these for parity with live
|
|
304
|
+
* playback; restore ignores the flag and retries the URL/DSP. */
|
|
305
|
+
placeholder?: true;
|
|
122
306
|
};
|
|
123
307
|
/** Result of creating an effect via the registry. */
|
|
124
308
|
interface CreatedEffect {
|
|
@@ -345,6 +529,9 @@ declare class DawPlayButtonElement extends DawTransportButton {
|
|
|
345
529
|
private _onRecEnd;
|
|
346
530
|
connectedCallback(): void;
|
|
347
531
|
disconnectedCallback(): void;
|
|
532
|
+
protected updated(): void;
|
|
533
|
+
private _ensureTargetListeners;
|
|
534
|
+
private _cleanupListeners;
|
|
348
535
|
render(): lit.TemplateResult<1>;
|
|
349
536
|
private _onClick;
|
|
350
537
|
}
|
|
@@ -365,6 +552,9 @@ declare class DawPauseButtonElement extends DawTransportButton {
|
|
|
365
552
|
static styles: lit.CSSResultGroup[];
|
|
366
553
|
connectedCallback(): void;
|
|
367
554
|
disconnectedCallback(): void;
|
|
555
|
+
protected updated(): void;
|
|
556
|
+
private _ensureTargetListeners;
|
|
557
|
+
private _cleanupListeners;
|
|
368
558
|
render(): lit.TemplateResult<1>;
|
|
369
559
|
private _onClick;
|
|
370
560
|
}
|
|
@@ -553,6 +743,10 @@ declare class PeakPipeline {
|
|
|
553
743
|
peaks: PeakData;
|
|
554
744
|
scale: number;
|
|
555
745
|
} | null;
|
|
746
|
+
/** Scale of the cached WaveformData for this buffer — 0 when not cached.
|
|
747
|
+
* Worker generation caches at baseScale; injected .dat data at its own
|
|
748
|
+
* scale. This is the finest zoom the buffer's peaks can render at. */
|
|
749
|
+
getCachedScale(audioBuffer: AudioBuffer): number;
|
|
556
750
|
/**
|
|
557
751
|
* Return the coarsest (largest) scale among cached WaveformData entries
|
|
558
752
|
* that correspond to the given clip buffers. Returns 0 if none are cached.
|
|
@@ -779,6 +973,10 @@ declare class RecordingController implements ReactiveController {
|
|
|
779
973
|
* start calls both pass the _sessions guard and build two capture
|
|
780
974
|
* pipelines feeding one session (garbled audio + a leaked worklet). */
|
|
781
975
|
private _starting;
|
|
976
|
+
/** True between hostDisconnected and hostConnected. An in-flight
|
|
977
|
+
* startRecording consults this after its awaits so a teardown mid-setup
|
|
978
|
+
* doesn't leak a live capture session on a detached editor. */
|
|
979
|
+
private _hostDisconnected;
|
|
782
980
|
private _workletLoadedCtx;
|
|
783
981
|
/** Tracks worklet pause state explicitly so external consumers (editor,
|
|
784
982
|
* pause button, spacebar) can share one source of truth. */
|
|
@@ -794,6 +992,7 @@ declare class RecordingController implements ReactiveController {
|
|
|
794
992
|
resumeRecording(trackId?: string): void;
|
|
795
993
|
stopRecording(trackId?: string): Promise<void>;
|
|
796
994
|
private _finishStopRecording;
|
|
995
|
+
private _finalizeRecording;
|
|
797
996
|
/** Drain the event-loop queue of pending worklet flush messages. During
|
|
798
997
|
* recording the worklet posts a flush every ~16ms; if main was slower,
|
|
799
998
|
* messages back up. Yield repeatedly until session.totalSamples stabilizes
|
|
@@ -804,6 +1003,12 @@ declare class RecordingController implements ReactiveController {
|
|
|
804
1003
|
private _processWorkletSamples;
|
|
805
1004
|
private _createClipFromRecording;
|
|
806
1005
|
private _removeTrackEndedListener;
|
|
1006
|
+
private _dispatchRecordingError;
|
|
1007
|
+
/** Shared teardown for finalize paths that end without a take (no data
|
|
1008
|
+
* captured / too short after latency compensation): restore the armed-track
|
|
1009
|
+
* mute, drop the session, and notify via daw-recording-error so record
|
|
1010
|
+
* buttons reset their state. */
|
|
1011
|
+
private _abandonFinalize;
|
|
807
1012
|
/** Restore the armed track's pre-session mute state (idempotent — safe to
|
|
808
1013
|
* call from both the finalize path and _cleanupSession). */
|
|
809
1014
|
private _restoreArmedTrackMute;
|
|
@@ -914,10 +1119,23 @@ declare class ClipPointerHandler {
|
|
|
914
1119
|
onPointerMove(e: PointerEvent): void;
|
|
915
1120
|
/** Processes pointerup events to finalize and dispatch result events. */
|
|
916
1121
|
onPointerUp(_e: PointerEvent): void;
|
|
1122
|
+
/** Processes pointercancel — reverts the in-progress drag.
|
|
1123
|
+
*
|
|
1124
|
+
* pointercancel fires INSTEAD of pointerup on touch interruption, pen
|
|
1125
|
+
* leaving hover range, or OS gestures. Without this handler the drag stays
|
|
1126
|
+
* armed (hover keeps moving the clip), the engine transaction stays open
|
|
1127
|
+
* (every later edit becomes un-undoable until some drag commits), and the
|
|
1128
|
+
* per-frame skipAdapter moveClip mutations are never synced or rolled back
|
|
1129
|
+
* (waveform and audio permanently disagree). */
|
|
1130
|
+
onPointerCancel(_e: PointerEvent): void;
|
|
917
1131
|
/** Re-extract peaks from cache and set on waveform elements during trim drag.
|
|
918
1132
|
* Returns true if peaks were successfully updated. */
|
|
919
1133
|
private _updateWaveformPeaks;
|
|
920
|
-
/** Restore clip container CSS to original values after
|
|
1134
|
+
/** Restore clip container CSS AND waveform peaks to original values after
|
|
1135
|
+
* a trim visual preview. Peaks matter: the drag wrote re-extracted peak
|
|
1136
|
+
* arrays imperatively onto the <daw-waveform> elements (bypassing Lit), and
|
|
1137
|
+
* a cancelled/zero-delta trim makes no engine mutation — so no statechange
|
|
1138
|
+
* re-render will ever repair them. */
|
|
921
1139
|
private _restoreTrimVisual;
|
|
922
1140
|
private _reset;
|
|
923
1141
|
}
|
|
@@ -963,6 +1181,11 @@ interface DawTrackIdDetail {
|
|
|
963
1181
|
interface DawTrackErrorDetail {
|
|
964
1182
|
trackId: string;
|
|
965
1183
|
error: unknown;
|
|
1184
|
+
/** Present when the load was CANCELLED rather than failed: the track was
|
|
1185
|
+
* removed (or the editor disconnected) while its clips were still loading.
|
|
1186
|
+
* Consumer error UIs should filter these — nothing actually failed; the
|
|
1187
|
+
* event exists so addTrack()/loadMidi() awaiters settle. */
|
|
1188
|
+
reason?: 'removed' | 'disconnected';
|
|
966
1189
|
}
|
|
967
1190
|
interface DawFilesLoadErrorDetail {
|
|
968
1191
|
file: File;
|
|
@@ -1085,8 +1308,24 @@ interface DawEffectErrorDetail {
|
|
|
1085
1308
|
source?: {
|
|
1086
1309
|
faust: string;
|
|
1087
1310
|
};
|
|
1311
|
+
/** Native effect type of the failed entry (restore of an unregistered
|
|
1312
|
+
* custom type), when applicable. */
|
|
1313
|
+
type?: string;
|
|
1088
1314
|
message: string;
|
|
1089
1315
|
}
|
|
1316
|
+
interface DawAnnotationConnectedDetail {
|
|
1317
|
+
annotationId: string;
|
|
1318
|
+
element: HTMLElement;
|
|
1319
|
+
}
|
|
1320
|
+
interface DawAnnotationUpdateDetail {
|
|
1321
|
+
annotationId: string;
|
|
1322
|
+
}
|
|
1323
|
+
interface DawAnnotationSelectDetail {
|
|
1324
|
+
annotation: AnnotationData | null;
|
|
1325
|
+
}
|
|
1326
|
+
interface DawAnnotationTrackConnectedDetail {
|
|
1327
|
+
element: HTMLElement;
|
|
1328
|
+
}
|
|
1090
1329
|
interface DawEventMap {
|
|
1091
1330
|
'daw-selection': CustomEvent<DawSelectionDetail>;
|
|
1092
1331
|
'daw-seek': CustomEvent<DawSeekDetail>;
|
|
@@ -1127,6 +1366,10 @@ interface DawEventMap {
|
|
|
1127
1366
|
'daw-effect-bypass': CustomEvent<DawEffectBypassDetail>;
|
|
1128
1367
|
'daw-effect-reorder': CustomEvent<DawEffectReorderDetail>;
|
|
1129
1368
|
'daw-effect-error': CustomEvent<DawEffectErrorDetail>;
|
|
1369
|
+
'daw-annotation-connected': CustomEvent<DawAnnotationConnectedDetail>;
|
|
1370
|
+
'daw-annotation-update': CustomEvent<DawAnnotationUpdateDetail>;
|
|
1371
|
+
'daw-annotation-select': CustomEvent<DawAnnotationSelectDetail>;
|
|
1372
|
+
'daw-annotation-track-connected': CustomEvent<DawAnnotationTrackConnectedDetail>;
|
|
1130
1373
|
}
|
|
1131
1374
|
type DawEvent<K extends keyof DawEventMap> = DawEventMap[K];
|
|
1132
1375
|
interface LoadFilesResult {
|
|
@@ -1191,6 +1434,9 @@ interface ExportAudioHost {
|
|
|
1191
1434
|
/** Natural session duration in seconds. */
|
|
1192
1435
|
duration: number;
|
|
1193
1436
|
tracks: ExportTrack[];
|
|
1437
|
+
/** Master output gain (engine setMasterVolume). Default 1. Without it the
|
|
1438
|
+
* export renders louder/quieter than what the user mixed against. */
|
|
1439
|
+
masterVolume?: number;
|
|
1194
1440
|
getMasterEffectsState(): Promise<SerializedEffectEntry[]>;
|
|
1195
1441
|
getTrackEffectsState(trackId: string): Promise<SerializedEffectEntry[]>;
|
|
1196
1442
|
}
|
|
@@ -1199,6 +1445,19 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1199
1445
|
get samplesPerPixel(): number;
|
|
1200
1446
|
set samplesPerPixel(value: number);
|
|
1201
1447
|
private _samplesPerPixel;
|
|
1448
|
+
/** Raise the zoom floor and re-clamp the LIVE samplesPerPixel when it's
|
|
1449
|
+
* now below the floor. Peaks can only be extracted at >= the floor scale —
|
|
1450
|
+
* the setter alone clamps only FUTURE sets, so without the re-clamp an
|
|
1451
|
+
* already-finer spp keeps sizing clip containers while the waveforms
|
|
1452
|
+
* render at the coarser scale: half/quarter width, misaligned against the
|
|
1453
|
+
* ruler and playhead. */
|
|
1454
|
+
_raiseZoomFloor(scale: number): void;
|
|
1455
|
+
/** Recompute the floor from the surviving cached scales (track removal /
|
|
1456
|
+
* load cancellation / preview cleanup). Usually LOWERS the floor, freeing
|
|
1457
|
+
* finer zoom — but a buffer whose scale never raised the floor (or a mix
|
|
1458
|
+
* of scales) can raise it above the live spp, so re-clamp like
|
|
1459
|
+
* _raiseZoomFloor. Never mutate _minSamplesPerPixel directly. */
|
|
1460
|
+
private _recomputeZoomFloor;
|
|
1202
1461
|
private _timeFormat;
|
|
1203
1462
|
/**
|
|
1204
1463
|
* Time display format used by <daw-time-display> and (future, #463) the
|
|
@@ -1309,15 +1568,19 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1309
1568
|
_engineTracks: Map<string, ClipTrack>;
|
|
1310
1569
|
_peaksData: Map<string, PeakData>;
|
|
1311
1570
|
_isPlaying: boolean;
|
|
1312
|
-
|
|
1571
|
+
_duration: number;
|
|
1313
1572
|
_selectedTrackId: string | null;
|
|
1314
1573
|
_dragOver: boolean;
|
|
1315
1574
|
_selectionStartTime: number;
|
|
1316
1575
|
_selectionEndTime: number;
|
|
1317
1576
|
_currentTime: number;
|
|
1577
|
+
_activePlayEndTime: number | null;
|
|
1318
1578
|
set adapter(value: PlayoutAdapter | null);
|
|
1319
1579
|
get adapter(): PlayoutAdapter | null;
|
|
1320
1580
|
private _externalAdapter;
|
|
1581
|
+
/** True after a disconnect disposed the consumer's adapter via the engine
|
|
1582
|
+
* — rebuild attempts fail loudly until a fresh adapter is set. */
|
|
1583
|
+
private _adapterConsumedByDispose;
|
|
1321
1584
|
private _effectsManager;
|
|
1322
1585
|
private get _effects();
|
|
1323
1586
|
/** Master effects chain — inserted between the master bus and the destination. */
|
|
@@ -1404,10 +1667,19 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1404
1667
|
/** Coarsest scale from pre-computed peaks — zoom cannot go finer than this. 0 = no limit. */
|
|
1405
1668
|
private _minSamplesPerPixel;
|
|
1406
1669
|
private _trackElements;
|
|
1670
|
+
/** Track ids with a _loadTrack in flight. Distinct from `_engineTracks`
|
|
1671
|
+
* membership: the peaks-first path inserts a render-only PREVIEW track
|
|
1672
|
+
* into _engineTracks mid-load, so `has()` alone cannot answer "is this
|
|
1673
|
+
* track still loading?". */
|
|
1674
|
+
private _loadingTracks;
|
|
1407
1675
|
private _childObserver;
|
|
1408
1676
|
private _audioResume;
|
|
1409
1677
|
eagerResume?: string;
|
|
1410
1678
|
private _recordingController;
|
|
1679
|
+
private _annotations;
|
|
1680
|
+
/** Last engine BPM seen by the statechange handler — re-derives tick
|
|
1681
|
+
* annotation seconds caches only when it actually changes. */
|
|
1682
|
+
private _lastAnnotationBpm;
|
|
1411
1683
|
private _playbackAnimation;
|
|
1412
1684
|
/**
|
|
1413
1685
|
* True while a seek-while-playing stop+play transition is in flight.
|
|
@@ -1416,8 +1688,17 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1416
1688
|
* play-start position). Non-private: pointer-handler's seek path sets it.
|
|
1417
1689
|
*/
|
|
1418
1690
|
_inSeekTransition: boolean;
|
|
1691
|
+
/**
|
|
1692
|
+
* True while `stop()` (the public API) is actively calling `this._engine.stop()`.
|
|
1693
|
+
* Suppresses the engine 'stop' handler's own `daw-stop` dispatch — `stop()`
|
|
1694
|
+
* dispatches its own, and without this guard a consumer-initiated stop would
|
|
1695
|
+
* fire `daw-stop` twice. See the engine 'stop' handler for the counterpart
|
|
1696
|
+
* engine-initiated case this flag does NOT suppress.
|
|
1697
|
+
*/
|
|
1698
|
+
private _inConsumerStop;
|
|
1419
1699
|
private _spectrogramController;
|
|
1420
1700
|
private _clipPointer;
|
|
1701
|
+
private _annotationDrag;
|
|
1421
1702
|
get _clipHandler(): ClipPointerHandler | null;
|
|
1422
1703
|
get engine(): PlaylistEngine | null;
|
|
1423
1704
|
get renderSamplesPerPixel(): number;
|
|
@@ -1439,11 +1720,15 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1439
1720
|
* In beats mode, derive samplesPerPixel from ticksPerPixel so that
|
|
1440
1721
|
* clip positions, waveforms, and the tick-space grid all align.
|
|
1441
1722
|
*/
|
|
1442
|
-
|
|
1723
|
+
get _renderSpp(): number;
|
|
1443
1724
|
/** Convert seconds to ticks — uses callback if provided, otherwise single-BPM fallback. */
|
|
1444
1725
|
_secondsToTicks(seconds: number): number;
|
|
1445
1726
|
/** Convert ticks to seconds — uses callback if provided, otherwise single-BPM fallback. */
|
|
1446
1727
|
_ticksToSeconds(ticks: number): number;
|
|
1728
|
+
/** Clamp limit for annotation boundary edits. indefinite-playback removes the
|
|
1729
|
+
* end-of-timeline bound — annotations may extend past the audio (DAW-style
|
|
1730
|
+
* unbounded timeline); the shared boundary math treats Infinity as "no end cap". */
|
|
1731
|
+
get _annotationClampDuration(): number;
|
|
1447
1732
|
private get _totalWidth();
|
|
1448
1733
|
/** Grid height when no tracks exist — matches scroll area's rendered height. */
|
|
1449
1734
|
private get _emptyGridHeight();
|
|
@@ -1471,11 +1756,24 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1471
1756
|
*/
|
|
1472
1757
|
private _lastSpectrogramViewport;
|
|
1473
1758
|
protected updated(_changed: Map<string, unknown>): void;
|
|
1759
|
+
private _onAnnotationTrackConnected;
|
|
1760
|
+
private _onAnnotationSelect;
|
|
1474
1761
|
private _onTrackConnected;
|
|
1475
1762
|
private _onTrackRemoved;
|
|
1476
1763
|
private _onTrackUpdate;
|
|
1477
1764
|
/** Drop the controller when no spectrogram tracks remain. */
|
|
1478
1765
|
private _disposeSpectrogramControllerIfEmpty;
|
|
1766
|
+
/** Reconcile `_tracks` descriptors with the engine's track list.
|
|
1767
|
+
*
|
|
1768
|
+
* ADD: engine.undo() restores removed tracks in ENGINE state only —
|
|
1769
|
+
* without a synthesized descriptor the track plays and renders but shows
|
|
1770
|
+
* "Untitled" controls and is missing from `editor.tracks`.
|
|
1771
|
+
* PRUNE (the symmetric half): redo removes the track from engine state
|
|
1772
|
+
* again — without pruning, the synthesized descriptor is a permanent
|
|
1773
|
+
* ghost that even removeTrack() can't clean (no element, no engine
|
|
1774
|
+
* entry). Never prunes tracks that are mid-load or element-backed —
|
|
1775
|
+
* their descriptors legitimately precede their engine entries. */
|
|
1776
|
+
_reconcileDescriptorsWithEngineTracks(tracks: ClipTrack[]): void;
|
|
1479
1777
|
private static _CONTROL_PROPS;
|
|
1480
1778
|
private _onTrackControl;
|
|
1481
1779
|
private _onTrackRemoveRequest;
|
|
@@ -1623,11 +1921,23 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1623
1921
|
*/
|
|
1624
1922
|
updateClip(trackId: string, clipId: string, partial: Partial<ClipConfig>): void;
|
|
1625
1923
|
private _buildClipElement;
|
|
1626
|
-
|
|
1924
|
+
/**
|
|
1925
|
+
* Start playback, optionally seeking to `startTime` first. When `endTime`
|
|
1926
|
+
* is provided, playback stops at that time (selection/annotation playback).
|
|
1927
|
+
*/
|
|
1928
|
+
play(startTime?: number, endTime?: number): Promise<void>;
|
|
1627
1929
|
pause(): void;
|
|
1628
1930
|
stop(): void;
|
|
1629
1931
|
/** Toggle between play and pause. */
|
|
1630
1932
|
togglePlayPause(): void;
|
|
1933
|
+
/** Run `fn` with the stop-settle daw-timeupdate suppressed. Every
|
|
1934
|
+
* stop-adjacent code path that immediately re-positions (seek, split,
|
|
1935
|
+
* empty-timeline rewind) must use this — engine.stop() rewinds to the
|
|
1936
|
+
* play-start position and the settle would leak a backward-jumping
|
|
1937
|
+
* daw-timeupdate to consumers (CLAUDE.md seek-while-playing invariant).
|
|
1938
|
+
* The `finally` is load-bearing: a wedged true silently drops every
|
|
1939
|
+
* subsequent stop-settle dispatch. */
|
|
1940
|
+
private _withSeekSuppression;
|
|
1631
1941
|
seekTo(time: number): void;
|
|
1632
1942
|
/** Undo the last structural edit. */
|
|
1633
1943
|
undo(): void;
|
|
@@ -1665,6 +1975,11 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1665
1975
|
createAudioWorkletNode(name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode;
|
|
1666
1976
|
createMediaStreamSource(stream: MediaStream): MediaStreamAudioSourceNode;
|
|
1667
1977
|
startRecording(stream?: MediaStream, options?: RecordingOptions): Promise<void>;
|
|
1978
|
+
/** Live-recording preview left/width. Beats mode uses the same tick-space
|
|
1979
|
+
* math as finalized clips — the sample÷renderSpp path is ceil-quantized,
|
|
1980
|
+
* so the take would visibly jump sideways on finalization (drift grows
|
|
1981
|
+
* with distance from t=0; CLAUDE.md live-preview parity invariant). */
|
|
1982
|
+
private _previewPosition;
|
|
1668
1983
|
private _renderRecordingPreview;
|
|
1669
1984
|
/** Convert playback seconds to a timeline pixel offset for the active mode. */
|
|
1670
1985
|
private _timeToPixels;
|
|
@@ -1747,11 +2062,19 @@ declare class DawKeyboardShortcutsElement extends LitElement {
|
|
|
1747
2062
|
playback: boolean;
|
|
1748
2063
|
splitting: boolean;
|
|
1749
2064
|
undo: boolean;
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
2065
|
+
private _playbackShortcuts;
|
|
2066
|
+
get playbackShortcuts(): PlaybackShortcutMap | null;
|
|
2067
|
+
set playbackShortcuts(value: PlaybackShortcutMap | null);
|
|
2068
|
+
private _splittingShortcuts;
|
|
2069
|
+
get splittingShortcuts(): SplittingShortcutMap | null;
|
|
2070
|
+
set splittingShortcuts(value: SplittingShortcutMap | null);
|
|
2071
|
+
private _undoShortcuts;
|
|
2072
|
+
get undoShortcuts(): UndoShortcutMap | null;
|
|
2073
|
+
set undoShortcuts(value: UndoShortcutMap | null);
|
|
1753
2074
|
/** Additional custom shortcuts. */
|
|
1754
|
-
|
|
2075
|
+
private _customShortcuts;
|
|
2076
|
+
get customShortcuts(): KeyboardShortcut[];
|
|
2077
|
+
set customShortcuts(value: KeyboardShortcut[]);
|
|
1755
2078
|
private _editor;
|
|
1756
2079
|
private _cachedShortcuts;
|
|
1757
2080
|
/** All active shortcuts (read-only, cached). */
|
|
@@ -1893,6 +2216,9 @@ declare class DawPlayerElement extends LitElement {
|
|
|
1893
2216
|
set playbackRate(value: number);
|
|
1894
2217
|
private _playbackRate;
|
|
1895
2218
|
private _engine;
|
|
2219
|
+
/** Set by disconnectedCallback — a reconnect (DOM reparent, framework
|
|
2220
|
+
* re-render) must rebuild the engine + track or the player is dead. */
|
|
2221
|
+
private _engineDisposed;
|
|
1896
2222
|
private _trackId;
|
|
1897
2223
|
private _anim;
|
|
1898
2224
|
private _metadataLoaded;
|
|
@@ -2015,6 +2341,12 @@ declare class AudioResumeController implements ReactiveController {
|
|
|
2015
2341
|
private _removeListeners;
|
|
2016
2342
|
}
|
|
2017
2343
|
|
|
2344
|
+
/**
|
|
2345
|
+
* Fixed lane height. A TS constant (not a CSS var) because the frozen-panes
|
|
2346
|
+
* controls-column spacer and the beats-grid top offset need it in layout math.
|
|
2347
|
+
*/
|
|
2348
|
+
declare const ANNOTATION_LANE_HEIGHT = 32;
|
|
2349
|
+
|
|
2018
2350
|
interface PlayheadLike {
|
|
2019
2351
|
setPosition(px: number): void;
|
|
2020
2352
|
}
|
|
@@ -2129,4 +2461,4 @@ declare function registerEffect(type: string, definition: EffectDefinition): voi
|
|
|
2129
2461
|
declare function getEffectDefinitions(): Map<string, EffectDefinition>;
|
|
2130
2462
|
declare function createEffectInstance(type: string, audioContext: BaseAudioContext, params?: Record<string, number>): CreatedEffect;
|
|
2131
2463
|
|
|
2132
|
-
export { AudioResumeController, type ClipConfig, type ClipDescriptor, type ClipEngineContract, ClipPointerHandler, type ClipPointerHost, type DawClipConnectedDetail, DawClipElement, type DawClipErrorDetail, type DawClipIdDetail, type DawClipMoveDetail, type DawClipSplitDetail, type DawClipTrimDetail, type DawClipUpdateDetail, DawEditorElement, type DawEffectAddDetail, type DawEffectBypassDetail, type DawEffectChangeDetail, type DawEffectErrorDetail, type DawEffectRemoveDetail, type DawEffectReorderDetail, type DawErrorDetail, type DawEvent, type DawEventMap, type DawFilesLoadErrorDetail, DawGridElement, DawKeyboardShortcutsElement, DawPauseButtonElement, DawPianoRollElement, DawPlayButtonElement, DawPlayerElement, DawPlayheadElement, DawRecordButtonElement, type DawRecordingCompleteDetail, type DawRecordingErrorDetail, type DawRecordingStartDetail, DawRulerElement, type DawSeekDetail, type DawSelectionDetail, DawSelectionElement, DawSpectrogramElement, DawStopButtonElement, DawTimeDisplayElement, type DawTimeFormatChangeDetail, DawTimeFormatElement, type DawTimeUpdateDetail, type DawTrackConnectedDetail, type DawTrackControlDetail, DawTrackControlsElement, DawTrackElement, type DawTrackErrorDetail, type DawTrackIdDetail, type DawTrackRemoveDetail, type DawTrackSelectDetail, DawTransportButton, DawTransportElement, DawWaveformElement, type DomClipDescriptor, type DropClipDescriptor, type EffectDefinition, type EffectInstance, type EffectParamDef, type EffectState, type ExportAudioHost, type ExportOptions, type KeyBinding, type LoadFilesResult, PlaybackAnimationController, type PlaybackAnimationOptions, type PlaybackShortcutMap, type PlayheadLike, type PointerEngineContract, RecordingController, type RecordingOptions, type RecordingSession, type SerializedEffectEntry, SpectrogramController, type SplitEngineContract, type SplitHost, type SplittingShortcutMap, TIME_DISPLAY_FORMATS, type TimeDisplayFormat, type TrackConfig, type TrackDescriptor, type TrackRenderMode, type TrackWithId, type UndoShortcutMap, type WaveformSegment, createEffectInstance, formatDisplayTime, getEffectDefinitions, isDomClip, isTimeDisplayFormat, parseDisplayTime, registerEffect, resolveTransportTarget, splitAtPlayhead, targetSupports, warnOnce, warnUnsupportedOnce };
|
|
2464
|
+
export { ANNOTATION_LANE_HEIGHT, AudioResumeController, type ClipConfig, type ClipDescriptor, type ClipEngineContract, ClipPointerHandler, type ClipPointerHost, type DawAnnotationConnectedDetail, DawAnnotationElement, DawAnnotationListElement, type DawAnnotationSelectDetail, type DawAnnotationTrackConnectedDetail, DawAnnotationTrackElement, type DawAnnotationUpdateDetail, type DawClipConnectedDetail, DawClipElement, type DawClipErrorDetail, type DawClipIdDetail, type DawClipMoveDetail, type DawClipSplitDetail, type DawClipTrimDetail, type DawClipUpdateDetail, DawEditorElement, type DawEffectAddDetail, type DawEffectBypassDetail, type DawEffectChangeDetail, type DawEffectErrorDetail, type DawEffectRemoveDetail, type DawEffectReorderDetail, type DawErrorDetail, type DawEvent, type DawEventMap, type DawFilesLoadErrorDetail, DawGridElement, DawKeyboardShortcutsElement, DawPauseButtonElement, DawPianoRollElement, DawPlayButtonElement, DawPlayerElement, DawPlayheadElement, DawRecordButtonElement, type DawRecordingCompleteDetail, type DawRecordingErrorDetail, type DawRecordingStartDetail, DawRulerElement, type DawSeekDetail, type DawSelectionDetail, DawSelectionElement, DawSpectrogramElement, DawStopButtonElement, DawTimeDisplayElement, type DawTimeFormatChangeDetail, DawTimeFormatElement, type DawTimeUpdateDetail, type DawTrackConnectedDetail, type DawTrackControlDetail, DawTrackControlsElement, DawTrackElement, type DawTrackErrorDetail, type DawTrackIdDetail, type DawTrackRemoveDetail, type DawTrackSelectDetail, DawTransportButton, DawTransportElement, DawWaveformElement, type DomClipDescriptor, type DropClipDescriptor, type EffectDefinition, type EffectInstance, type EffectParamDef, type EffectState, type ExportAudioHost, type ExportOptions, type KeyBinding, type LoadFilesResult, PlaybackAnimationController, type PlaybackAnimationOptions, type PlaybackShortcutMap, type PlayheadLike, type PointerEngineContract, RecordingController, type RecordingOptions, type RecordingSession, type SerializedEffectEntry, SpectrogramController, type SplitEngineContract, type SplitHost, type SplittingShortcutMap, TIME_DISPLAY_FORMATS, type TimeDisplayFormat, type TrackConfig, type TrackDescriptor, type TrackRenderMode, type TrackWithId, type UndoShortcutMap, type WaveformSegment, createEffectInstance, formatDisplayTime, getEffectDefinitions, isDomClip, isTimeDisplayFormat, parseDisplayTime, registerEffect, resolveTransportTarget, splitAtPlayhead, targetSupports, warnOnce, warnUnsupportedOnce };
|