@dawcore/components 0.0.1 → 0.0.3
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 +260 -10
- package/dist/index.d.ts +260 -10
- package/dist/index.js +1138 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1159 -108
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost } from 'lit';
|
|
3
|
-
import { Peaks, Bits, FadeType, PeakData, ClipTrack } from '@waveform-playlist/core';
|
|
3
|
+
import { Peaks, Bits, FadeType, PeakData, ClipTrack, KeyboardShortcut } from '@waveform-playlist/core';
|
|
4
4
|
import { PlaylistEngine } from '@waveform-playlist/engine';
|
|
5
5
|
|
|
6
6
|
declare class DawClipElement extends LitElement {
|
|
@@ -130,6 +130,12 @@ declare class DawTransportButton extends LitElement {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
declare class DawPlayButtonElement extends DawTransportButton {
|
|
133
|
+
private _isRecording;
|
|
134
|
+
private _targetRef;
|
|
135
|
+
private _onRecStart;
|
|
136
|
+
private _onRecEnd;
|
|
137
|
+
connectedCallback(): void;
|
|
138
|
+
disconnectedCallback(): void;
|
|
133
139
|
render(): lit.TemplateResult<1>;
|
|
134
140
|
private _onClick;
|
|
135
141
|
}
|
|
@@ -140,6 +146,14 @@ declare global {
|
|
|
140
146
|
}
|
|
141
147
|
|
|
142
148
|
declare class DawPauseButtonElement extends DawTransportButton {
|
|
149
|
+
private _isPaused;
|
|
150
|
+
private _isRecording;
|
|
151
|
+
private _targetRef;
|
|
152
|
+
private _onRecStart;
|
|
153
|
+
private _onRecEnd;
|
|
154
|
+
static styles: lit.CSSResultGroup[];
|
|
155
|
+
connectedCallback(): void;
|
|
156
|
+
disconnectedCallback(): void;
|
|
143
157
|
render(): lit.TemplateResult<1>;
|
|
144
158
|
private _onClick;
|
|
145
159
|
}
|
|
@@ -196,19 +210,25 @@ declare class PeakPipeline {
|
|
|
196
210
|
private _worker;
|
|
197
211
|
private _cache;
|
|
198
212
|
private _inflight;
|
|
213
|
+
private _baseScale;
|
|
214
|
+
private _bits;
|
|
215
|
+
constructor(baseScale?: number, bits?: 8 | 16);
|
|
199
216
|
/**
|
|
200
217
|
* Generate PeakData for a clip from its AudioBuffer.
|
|
201
218
|
* Uses cached WaveformData when available; otherwise generates via worker.
|
|
202
|
-
*
|
|
219
|
+
* Worker generates at baseScale (default 128); extractPeaks resamples to the requested zoom.
|
|
203
220
|
*/
|
|
204
|
-
generatePeaks(audioBuffer: AudioBuffer, samplesPerPixel: number, isMono: boolean): Promise<PeakData>;
|
|
221
|
+
generatePeaks(audioBuffer: AudioBuffer, samplesPerPixel: number, isMono: boolean, offsetSamples?: number, durationSamples?: number): Promise<PeakData>;
|
|
205
222
|
/**
|
|
206
223
|
* Re-extract peaks for all clips at a new zoom level using cached WaveformData.
|
|
207
224
|
* Only works for zoom levels coarser than (or equal to) the cached base scale.
|
|
208
225
|
* Returns a new Map of clipId → PeakData. Clips without cached data or where
|
|
209
226
|
* the target scale is finer than the cached base are skipped.
|
|
210
227
|
*/
|
|
211
|
-
reextractPeaks(clipBuffers: ReadonlyMap<string, AudioBuffer>, samplesPerPixel: number, isMono: boolean
|
|
228
|
+
reextractPeaks(clipBuffers: ReadonlyMap<string, AudioBuffer>, samplesPerPixel: number, isMono: boolean, clipOffsets?: ReadonlyMap<string, {
|
|
229
|
+
offsetSamples: number;
|
|
230
|
+
durationSamples: number;
|
|
231
|
+
}>): Map<string, PeakData>;
|
|
212
232
|
terminate(): void;
|
|
213
233
|
private _getWaveformData;
|
|
214
234
|
}
|
|
@@ -240,6 +260,8 @@ interface RecordingOptions {
|
|
|
240
260
|
trackId?: string;
|
|
241
261
|
bits?: 8 | 16;
|
|
242
262
|
startSample?: number;
|
|
263
|
+
/** Start playback during recording so user hears existing tracks. */
|
|
264
|
+
overdub?: boolean;
|
|
243
265
|
}
|
|
244
266
|
interface RecordingSession {
|
|
245
267
|
readonly trackId: string;
|
|
@@ -259,12 +281,16 @@ interface RecordingSession {
|
|
|
259
281
|
readonly channelCount: number;
|
|
260
282
|
readonly bits: Bits;
|
|
261
283
|
isFirstMessage: boolean;
|
|
284
|
+
/** Latency samples to skip in live preview (outputLatency + lookAhead). */
|
|
285
|
+
readonly latencySamples: number;
|
|
286
|
+
readonly wasOverdub: boolean;
|
|
262
287
|
/** Stored so it can be removed on stop/cleanup — not just when stream ends. */
|
|
263
288
|
readonly _onTrackEnded: (() => void) | null;
|
|
264
289
|
readonly _audioTrack: MediaStreamTrack | null;
|
|
265
290
|
}
|
|
266
291
|
/** Readonly view of a recording session for external consumers. */
|
|
267
|
-
type ReadonlyRecordingSession = Readonly<Omit<RecordingSession, 'chunks' | 'peaks' | '_onTrackEnded' | '_audioTrack'>> & {
|
|
292
|
+
type ReadonlyRecordingSession = Readonly<Omit<RecordingSession, 'chunks' | 'peaks' | '_onTrackEnded' | '_audioTrack' | 'latencySamples'>> & {
|
|
293
|
+
readonly latencySamples: number;
|
|
268
294
|
readonly chunks: ReadonlyArray<ReadonlyArray<Float32Array>>;
|
|
269
295
|
readonly peaks: ReadonlyArray<Int8Array | Int16Array>;
|
|
270
296
|
};
|
|
@@ -276,7 +302,9 @@ interface RecordingHost extends ReactiveControllerHost {
|
|
|
276
302
|
readonly _currentTime: number;
|
|
277
303
|
readonly shadowRoot: ShadowRoot | null;
|
|
278
304
|
resolveAudioContextSampleRate(rate: number): void;
|
|
279
|
-
_addRecordedClip?(trackId: string, buf: AudioBuffer, startSample: number, durSamples: number): void;
|
|
305
|
+
_addRecordedClip?(trackId: string, buf: AudioBuffer, startSample: number, durSamples: number, offsetSamples?: number): void;
|
|
306
|
+
play?(startTime?: number): Promise<void>;
|
|
307
|
+
stop?(): void;
|
|
280
308
|
dispatchEvent(event: Event): boolean;
|
|
281
309
|
}
|
|
282
310
|
declare class RecordingController implements ReactiveController {
|
|
@@ -289,6 +317,8 @@ declare class RecordingController implements ReactiveController {
|
|
|
289
317
|
get isRecording(): boolean;
|
|
290
318
|
getSession(trackId: string): ReadonlyRecordingSession | undefined;
|
|
291
319
|
startRecording(stream: MediaStream, options?: RecordingOptions): Promise<void>;
|
|
320
|
+
pauseRecording(trackId?: string): void;
|
|
321
|
+
resumeRecording(trackId?: string): void;
|
|
292
322
|
stopRecording(trackId?: string): void;
|
|
293
323
|
private _onWorkletMessage;
|
|
294
324
|
private _createClipFromRecording;
|
|
@@ -296,6 +326,91 @@ declare class RecordingController implements ReactiveController {
|
|
|
296
326
|
private _cleanupSession;
|
|
297
327
|
}
|
|
298
328
|
|
|
329
|
+
/** Snapshot of a clip's bounds for trim constraint computation. */
|
|
330
|
+
interface ClipBounds {
|
|
331
|
+
readonly offsetSamples: number;
|
|
332
|
+
readonly durationSamples: number;
|
|
333
|
+
readonly startSample: number;
|
|
334
|
+
readonly sourceDurationSamples: number;
|
|
335
|
+
}
|
|
336
|
+
/** Narrow engine contract for clip move/trim interactions. */
|
|
337
|
+
interface ClipEngineContract {
|
|
338
|
+
moveClip(trackId: string, clipId: string, deltaSamples: number, skipAdapter?: boolean): number;
|
|
339
|
+
trimClip(trackId: string, clipId: string, boundary: 'left' | 'right', deltaSamples: number, skipAdapter?: boolean): void;
|
|
340
|
+
updateTrack(trackId: string): void;
|
|
341
|
+
/** Get a clip's full bounds for trim constraint computation. */
|
|
342
|
+
getClipBounds(trackId: string, clipId: string): ClipBounds | null;
|
|
343
|
+
/** Constrain a trim delta using the engine's collision/bounds logic. */
|
|
344
|
+
constrainTrimDelta(trackId: string, clipId: string, boundary: 'left' | 'right', deltaSamples: number): number;
|
|
345
|
+
/** Begin a transaction — groups mutations into one undo step. */
|
|
346
|
+
beginTransaction(): void;
|
|
347
|
+
/** Commit the transaction — pushes one undo step for all grouped mutations. */
|
|
348
|
+
commitTransaction(): void;
|
|
349
|
+
/** Abort the transaction — restores pre-transaction state without pushing to undo. */
|
|
350
|
+
abortTransaction(): void;
|
|
351
|
+
}
|
|
352
|
+
/** Peak data returned by reextractClipPeaks for imperative waveform updates. */
|
|
353
|
+
interface ClipPeakSlice {
|
|
354
|
+
data: ArrayLike<number>[];
|
|
355
|
+
length: number;
|
|
356
|
+
}
|
|
357
|
+
/** Host interface required by ClipPointerHandler. */
|
|
358
|
+
interface ClipPointerHost {
|
|
359
|
+
readonly samplesPerPixel: number;
|
|
360
|
+
readonly effectiveSampleRate: number;
|
|
361
|
+
readonly interactiveClips: boolean;
|
|
362
|
+
readonly engine: ClipEngineContract | null;
|
|
363
|
+
readonly shadowRoot: ShadowRoot | null;
|
|
364
|
+
dispatchEvent(event: Event): boolean;
|
|
365
|
+
/** Re-extract peaks for a clip at new offset/duration from cached WaveformData. */
|
|
366
|
+
reextractClipPeaks(clipId: string, offsetSamples: number, durationSamples: number): ClipPeakSlice | null;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Handles pointer interactions for clip move and trim drag operations.
|
|
370
|
+
* Converts pixel deltas to sample deltas and delegates to the engine.
|
|
371
|
+
*
|
|
372
|
+
* Move: sends incremental deltas per-frame with skipAdapter=true (engine shifts
|
|
373
|
+
* startSample additively without touching audio adapter). Adapter synced once
|
|
374
|
+
* via updateTrack() at drag end.
|
|
375
|
+
* Trim: updates clip container CSS imperatively during drag for visual feedback,
|
|
376
|
+
* then applies cumulative delta to engine once at drag end.
|
|
377
|
+
*/
|
|
378
|
+
declare class ClipPointerHandler {
|
|
379
|
+
private _host;
|
|
380
|
+
private _mode;
|
|
381
|
+
private _clipId;
|
|
382
|
+
private _trackId;
|
|
383
|
+
private _startPx;
|
|
384
|
+
private _isDragging;
|
|
385
|
+
private _lastDeltaPx;
|
|
386
|
+
private _cumulativeDeltaSamples;
|
|
387
|
+
private _clipContainer;
|
|
388
|
+
private _boundaryEl;
|
|
389
|
+
private _originalLeft;
|
|
390
|
+
private _originalWidth;
|
|
391
|
+
private _originalOffsetSamples;
|
|
392
|
+
private _originalDurationSamples;
|
|
393
|
+
constructor(host: ClipPointerHost);
|
|
394
|
+
/** Returns true if a drag interaction is currently in progress. */
|
|
395
|
+
get isActive(): boolean;
|
|
396
|
+
/**
|
|
397
|
+
* Attempts to handle a pointerdown event on the given target element.
|
|
398
|
+
* Returns true if the target is a recognized clip interaction element.
|
|
399
|
+
*/
|
|
400
|
+
tryHandle(target: Element, e: PointerEvent): boolean;
|
|
401
|
+
private _beginDrag;
|
|
402
|
+
/** Processes pointermove events during an active drag. */
|
|
403
|
+
onPointerMove(e: PointerEvent): void;
|
|
404
|
+
/** Processes pointerup events to finalize and dispatch result events. */
|
|
405
|
+
onPointerUp(_e: PointerEvent): void;
|
|
406
|
+
/** Re-extract peaks from cache and set on waveform elements during trim drag.
|
|
407
|
+
* Returns true if peaks were successfully updated. */
|
|
408
|
+
private _updateWaveformPeaks;
|
|
409
|
+
/** Restore clip container CSS to original values after trim visual preview. */
|
|
410
|
+
private _restoreTrimVisual;
|
|
411
|
+
private _reset;
|
|
412
|
+
}
|
|
413
|
+
|
|
299
414
|
interface DawSelectionDetail {
|
|
300
415
|
start: number;
|
|
301
416
|
end: number;
|
|
@@ -342,11 +457,33 @@ interface DawRecordingCompleteDetail {
|
|
|
342
457
|
audioBuffer: AudioBuffer;
|
|
343
458
|
startSample: number;
|
|
344
459
|
durationSamples: number;
|
|
460
|
+
offsetSamples: number;
|
|
345
461
|
}
|
|
346
462
|
interface DawRecordingErrorDetail {
|
|
347
463
|
trackId: string;
|
|
348
464
|
error: unknown;
|
|
349
465
|
}
|
|
466
|
+
interface DawClipMoveDetail {
|
|
467
|
+
readonly trackId: string;
|
|
468
|
+
readonly clipId: string;
|
|
469
|
+
/** Requested cumulative delta. May exceed actual applied movement due to
|
|
470
|
+
* collision constraints. Query engine state for actual clip positions. */
|
|
471
|
+
readonly deltaSamples: number;
|
|
472
|
+
}
|
|
473
|
+
interface DawClipTrimDetail {
|
|
474
|
+
readonly trackId: string;
|
|
475
|
+
readonly clipId: string;
|
|
476
|
+
readonly boundary: 'left' | 'right';
|
|
477
|
+
/** Constrained cumulative delta applied by the engine. Already clamped
|
|
478
|
+
* by collision and boundary constraints during drag. */
|
|
479
|
+
readonly deltaSamples: number;
|
|
480
|
+
}
|
|
481
|
+
interface DawClipSplitDetail {
|
|
482
|
+
readonly trackId: string;
|
|
483
|
+
readonly originalClipId: string;
|
|
484
|
+
readonly leftClipId: string;
|
|
485
|
+
readonly rightClipId: string;
|
|
486
|
+
}
|
|
350
487
|
interface DawEventMap {
|
|
351
488
|
'daw-selection': CustomEvent<DawSelectionDetail>;
|
|
352
489
|
'daw-seek': CustomEvent<DawSeekDetail>;
|
|
@@ -365,6 +502,9 @@ interface DawEventMap {
|
|
|
365
502
|
'daw-recording-start': CustomEvent<DawRecordingStartDetail>;
|
|
366
503
|
'daw-recording-complete': CustomEvent<DawRecordingCompleteDetail>;
|
|
367
504
|
'daw-recording-error': CustomEvent<DawRecordingErrorDetail>;
|
|
505
|
+
'daw-clip-move': CustomEvent<DawClipMoveDetail>;
|
|
506
|
+
'daw-clip-trim': CustomEvent<DawClipTrimDetail>;
|
|
507
|
+
'daw-clip-split': CustomEvent<DawClipSplitDetail>;
|
|
368
508
|
}
|
|
369
509
|
type DawEvent<K extends keyof DawEventMap> = DawEventMap[K];
|
|
370
510
|
interface LoadFilesResult {
|
|
@@ -383,6 +523,9 @@ declare class DawEditorElement extends LitElement {
|
|
|
383
523
|
barWidth: number;
|
|
384
524
|
barGap: number;
|
|
385
525
|
fileDrop: boolean;
|
|
526
|
+
clipHeaders: boolean;
|
|
527
|
+
clipHeaderHeight: number;
|
|
528
|
+
interactiveClips: boolean;
|
|
386
529
|
/** Initial sample rate hint. Overridden by decoded audio buffer's actual rate. */
|
|
387
530
|
sampleRate: number;
|
|
388
531
|
/** Resolved sample rate — falls back to sampleRate property until first audio decode. */
|
|
@@ -399,15 +542,26 @@ declare class DawEditorElement extends LitElement {
|
|
|
399
542
|
_currentTime: number;
|
|
400
543
|
_engine: PlaylistEngine | null;
|
|
401
544
|
private _enginePromise;
|
|
402
|
-
private _audioInitialized;
|
|
403
545
|
_audioCache: Map<string, Promise<AudioBuffer>>;
|
|
404
546
|
_clipBuffers: Map<string, AudioBuffer>;
|
|
547
|
+
_clipOffsets: Map<string, {
|
|
548
|
+
offsetSamples: number;
|
|
549
|
+
durationSamples: number;
|
|
550
|
+
}>;
|
|
405
551
|
_peakPipeline: PeakPipeline;
|
|
406
552
|
private _trackElements;
|
|
407
553
|
private _childObserver;
|
|
408
554
|
private _audioResume;
|
|
409
555
|
eagerResume?: string;
|
|
410
556
|
private _recordingController;
|
|
557
|
+
private _clipPointer;
|
|
558
|
+
get _clipHandler(): ClipPointerHandler | null;
|
|
559
|
+
get engine(): PlaylistEngine | null;
|
|
560
|
+
/** Re-extract peaks for a clip at new offset/duration from cached WaveformData. */
|
|
561
|
+
reextractClipPeaks(clipId: string, offsetSamples: number, durationSamples: number): {
|
|
562
|
+
data: Peaks[];
|
|
563
|
+
length: number;
|
|
564
|
+
} | null;
|
|
411
565
|
private _pointer;
|
|
412
566
|
private _viewport;
|
|
413
567
|
static styles: lit.CSSResult[];
|
|
@@ -442,14 +596,29 @@ declare class DawEditorElement extends LitElement {
|
|
|
442
596
|
private _onDragLeave;
|
|
443
597
|
private _onDrop;
|
|
444
598
|
loadFiles(files: FileList | File[]): Promise<LoadFilesResult>;
|
|
445
|
-
play(): Promise<void>;
|
|
599
|
+
play(startTime?: number): Promise<void>;
|
|
446
600
|
pause(): void;
|
|
447
601
|
stop(): void;
|
|
602
|
+
/** Toggle between play and pause. */
|
|
603
|
+
togglePlayPause(): void;
|
|
448
604
|
seekTo(time: number): void;
|
|
605
|
+
/** Undo the last structural edit. */
|
|
606
|
+
undo(): void;
|
|
607
|
+
/** Redo the last undone edit. */
|
|
608
|
+
redo(): void;
|
|
609
|
+
/** Whether undo is available. */
|
|
610
|
+
get canUndo(): boolean;
|
|
611
|
+
/** Whether redo is available. */
|
|
612
|
+
get canRedo(): boolean;
|
|
613
|
+
/** Split the clip under the playhead on the selected track. */
|
|
614
|
+
splitAtPlayhead(): boolean;
|
|
449
615
|
recordingStream: MediaStream | null;
|
|
616
|
+
get currentTime(): number;
|
|
450
617
|
get isRecording(): boolean;
|
|
618
|
+
pauseRecording(): void;
|
|
619
|
+
resumeRecording(): void;
|
|
451
620
|
stopRecording(): void;
|
|
452
|
-
_addRecordedClip(trackId: string, buf: AudioBuffer, startSample: number, durSamples: number): void;
|
|
621
|
+
_addRecordedClip(trackId: string, buf: AudioBuffer, startSample: number, durSamples: number, offsetSamples?: number): void;
|
|
453
622
|
startRecording(stream?: MediaStream, options?: RecordingOptions): Promise<void>;
|
|
454
623
|
private _renderRecordingPreview;
|
|
455
624
|
_startPlayhead(): void;
|
|
@@ -514,6 +683,59 @@ declare global {
|
|
|
514
683
|
}
|
|
515
684
|
}
|
|
516
685
|
|
|
686
|
+
/** Key binding for remapping — derived from KeyboardShortcut to stay in sync. */
|
|
687
|
+
type KeyBinding = Pick<KeyboardShortcut, 'key' | 'ctrlKey' | 'shiftKey' | 'metaKey' | 'altKey'>;
|
|
688
|
+
interface PlaybackShortcutMap {
|
|
689
|
+
playPause?: KeyBinding;
|
|
690
|
+
stop?: KeyBinding;
|
|
691
|
+
rewindToStart?: KeyBinding;
|
|
692
|
+
}
|
|
693
|
+
interface SplittingShortcutMap {
|
|
694
|
+
splitAtPlayhead?: KeyBinding;
|
|
695
|
+
}
|
|
696
|
+
interface UndoShortcutMap {
|
|
697
|
+
undo?: KeyBinding;
|
|
698
|
+
redo?: KeyBinding;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Render-less element that enables keyboard shortcuts for a parent <daw-editor>.
|
|
702
|
+
* Place inside the editor element. Boolean attributes enable preset categories;
|
|
703
|
+
* JS properties allow remapping and custom shortcuts.
|
|
704
|
+
*
|
|
705
|
+
* ```html
|
|
706
|
+
* <daw-editor>
|
|
707
|
+
* <daw-keyboard-shortcuts playback splitting undo></daw-keyboard-shortcuts>
|
|
708
|
+
* </daw-editor>
|
|
709
|
+
* ```
|
|
710
|
+
*/
|
|
711
|
+
declare class DawKeyboardShortcutsElement extends LitElement {
|
|
712
|
+
playback: boolean;
|
|
713
|
+
splitting: boolean;
|
|
714
|
+
undo: boolean;
|
|
715
|
+
playbackShortcuts: PlaybackShortcutMap | null;
|
|
716
|
+
splittingShortcuts: SplittingShortcutMap | null;
|
|
717
|
+
undoShortcuts: UndoShortcutMap | null;
|
|
718
|
+
/** Additional custom shortcuts. */
|
|
719
|
+
customShortcuts: KeyboardShortcut[];
|
|
720
|
+
private _editor;
|
|
721
|
+
private _cachedShortcuts;
|
|
722
|
+
/** All active shortcuts (read-only, cached). */
|
|
723
|
+
get shortcuts(): KeyboardShortcut[];
|
|
724
|
+
/** Invalidate cached shortcuts when Lit properties change. */
|
|
725
|
+
updated(): void;
|
|
726
|
+
connectedCallback(): void;
|
|
727
|
+
disconnectedCallback(): void;
|
|
728
|
+
createRenderRoot(): this;
|
|
729
|
+
private _buildShortcuts;
|
|
730
|
+
private _makeShortcut;
|
|
731
|
+
private _onKeyDown;
|
|
732
|
+
}
|
|
733
|
+
declare global {
|
|
734
|
+
interface HTMLElementTagNameMap {
|
|
735
|
+
'daw-keyboard-shortcuts': DawKeyboardShortcutsElement;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
517
739
|
declare class AudioResumeController implements ReactiveController {
|
|
518
740
|
private _host;
|
|
519
741
|
private _target;
|
|
@@ -538,4 +760,32 @@ interface PointerEngineContract {
|
|
|
538
760
|
selectTrack(trackId: string | null): void;
|
|
539
761
|
}
|
|
540
762
|
|
|
541
|
-
|
|
763
|
+
/** Narrow engine contract for split operations. */
|
|
764
|
+
interface SplitEngineContract {
|
|
765
|
+
getState(): {
|
|
766
|
+
selectedTrackId: string | null;
|
|
767
|
+
tracks: ClipTrack[];
|
|
768
|
+
};
|
|
769
|
+
splitClip(trackId: string, clipId: string, atSample: number): void;
|
|
770
|
+
}
|
|
771
|
+
/** Host interface for splitAtPlayhead. */
|
|
772
|
+
interface SplitHost {
|
|
773
|
+
readonly effectiveSampleRate: number;
|
|
774
|
+
readonly currentTime: number;
|
|
775
|
+
readonly isPlaying: boolean;
|
|
776
|
+
readonly engine: SplitEngineContract | null;
|
|
777
|
+
dispatchEvent(event: Event): boolean;
|
|
778
|
+
stop(): void;
|
|
779
|
+
play(time: number): void;
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Split the clip under the playhead on the selected track.
|
|
783
|
+
* Stops playback before split and resumes after to avoid duplicate audio
|
|
784
|
+
* from Transport rescheduling during playback.
|
|
785
|
+
*
|
|
786
|
+
* Returns true if the split occurred and dispatched a daw-clip-split event.
|
|
787
|
+
* Returns false for any guard failure or engine no-op.
|
|
788
|
+
*/
|
|
789
|
+
declare function splitAtPlayhead(host: SplitHost): boolean;
|
|
790
|
+
|
|
791
|
+
export { AudioResumeController, type ClipDescriptor, type ClipEngineContract, ClipPointerHandler, type ClipPointerHost, DawClipElement, type DawClipMoveDetail, type DawClipSplitDetail, type DawClipTrimDetail, DawEditorElement, type DawErrorDetail, type DawEvent, type DawEventMap, type DawFilesLoadErrorDetail, DawKeyboardShortcutsElement, DawPauseButtonElement, DawPlayButtonElement, DawPlayheadElement, DawRecordButtonElement, type DawRecordingCompleteDetail, type DawRecordingErrorDetail, type DawRecordingStartDetail, DawRulerElement, type DawSeekDetail, type DawSelectionDetail, DawSelectionElement, DawStopButtonElement, type DawTrackConnectedDetail, type DawTrackControlDetail, DawTrackControlsElement, DawTrackElement, type DawTrackErrorDetail, type DawTrackIdDetail, type DawTrackRemoveDetail, type DawTrackSelectDetail, DawTransportButton, DawTransportElement, DawWaveformElement, type KeyBinding, type LoadFilesResult, type PlaybackShortcutMap, type PointerEngineContract, RecordingController, type RecordingOptions, type RecordingSession, type SplitEngineContract, type SplitHost, type SplittingShortcutMap, type TrackDescriptor, type UndoShortcutMap, splitAtPlayhead };
|