@dawcore/components 0.0.26 → 0.0.28
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 +117 -12
- package/dist/index.d.ts +117 -12
- package/dist/index.js +431 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +430 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -6
package/dist/index.d.mts
CHANGED
|
@@ -392,6 +392,12 @@ interface TrackDescriptor {
|
|
|
392
392
|
spectrogramConfig?: SpectrogramConfig | null;
|
|
393
393
|
clips: ClipDescriptor[];
|
|
394
394
|
}
|
|
395
|
+
/** A `TrackDescriptor` plus its `trackId` — the shape returned by `editor.tracks`
|
|
396
|
+
* so consumers can map a track's name to the `trackId` the per-track APIs
|
|
397
|
+
* (`addTrackEffect`, `removeTrack`, `updateTrack`, …) are keyed by. */
|
|
398
|
+
type TrackWithId = TrackDescriptor & {
|
|
399
|
+
trackId: string;
|
|
400
|
+
};
|
|
395
401
|
/**
|
|
396
402
|
* Common fields shared by all clip descriptors regardless of source.
|
|
397
403
|
*/
|
|
@@ -1028,8 +1034,11 @@ interface DawEventMap {
|
|
|
1028
1034
|
'daw-track-connected': CustomEvent<DawTrackConnectedDetail>;
|
|
1029
1035
|
'daw-track-update': CustomEvent<DawTrackIdDetail>;
|
|
1030
1036
|
'daw-track-ready': CustomEvent<DawTrackIdDetail>;
|
|
1037
|
+
'daw-track-removed': CustomEvent<DawTrackIdDetail>;
|
|
1031
1038
|
'daw-track-error': CustomEvent<DawTrackErrorDetail>;
|
|
1032
1039
|
'daw-files-load-error': CustomEvent<DawFilesLoadErrorDetail>;
|
|
1040
|
+
'daw-ready': CustomEvent<void>;
|
|
1041
|
+
'daw-ended': CustomEvent<void>;
|
|
1033
1042
|
'daw-play': CustomEvent<void>;
|
|
1034
1043
|
'daw-pause': CustomEvent<void>;
|
|
1035
1044
|
'daw-stop': CustomEvent<void>;
|
|
@@ -1275,18 +1284,37 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1275
1284
|
* with their live state). Returns the rendered AudioBuffer.
|
|
1276
1285
|
*/
|
|
1277
1286
|
exportAudio(options?: ExportOptions): Promise<AudioBuffer>;
|
|
1278
|
-
/**
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1287
|
+
/** Add a native registry effect to a track's chain. */
|
|
1288
|
+
addTrackEffect(trackId: string, type: string, params?: Record<string, number>): string;
|
|
1289
|
+
/** Snapshot of a track's effect chain (empty array for an unknown track). */
|
|
1290
|
+
trackEffects(trackId: string): EffectState[];
|
|
1291
|
+
removeTrackEffect(trackId: string, effectId: string): void;
|
|
1292
|
+
setTrackEffectParams(trackId: string, effectId: string, params: Record<string, number>): void;
|
|
1293
|
+
setTrackEffectBypassed(trackId: string, effectId: string, bypassed: boolean): void;
|
|
1294
|
+
moveTrackEffect(trackId: string, effectId: string, newIndex: number): void;
|
|
1295
|
+
/** Load a WAM plugin (via the optional @dawcore/wam peer) into a track's chain. */
|
|
1296
|
+
addTrackWamPlugin(trackId: string, url: string, initialState?: unknown): Promise<string>;
|
|
1297
|
+
/** Compile Faust DSP (via the optional @dawcore/faust peer) into a track's chain. */
|
|
1298
|
+
addTrackFaustEffect(trackId: string, dspCode: string, options?: {
|
|
1284
1299
|
name?: string;
|
|
1285
1300
|
}): Promise<string>;
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1301
|
+
/** Open (lazily creating) the GUI for a track-chain effect into a container. */
|
|
1302
|
+
openTrackEffectGui(trackId: string, effectId: string, container: HTMLElement): Promise<HTMLElement>;
|
|
1303
|
+
/** Hide a track-chain effect's GUI (cached for reopen — never destroys). */
|
|
1304
|
+
closeTrackEffectGui(_trackId: string, effectId: string): void;
|
|
1305
|
+
/** Snapshot a track's chain in its persisted form (see dawcore README). */
|
|
1306
|
+
getTrackEffectsState(trackId: string): Promise<SerializedEffectEntry[]>;
|
|
1307
|
+
/** Replace a track's chain from a persisted snapshot. */
|
|
1308
|
+
setTrackEffectsState(trackId: string, entries: SerializedEffectEntry[]): Promise<void>;
|
|
1309
|
+
/**
|
|
1310
|
+
* Event-dispatch source for a per-track effect op: the track's `<daw-track>`
|
|
1311
|
+
* element when one exists (so `daw-effect-*` bubble from it exactly as the
|
|
1312
|
+
* element-method path does), else the editor itself for element-less tracks
|
|
1313
|
+
* (drag-dropped / programmatic). Reads the `_trackElements` index the editor
|
|
1314
|
+
* already maintains across the track connect/remove lifecycle — O(1), and the
|
|
1315
|
+
* same resolution `removeTrack` uses — rather than re-querying the DOM per op.
|
|
1316
|
+
*/
|
|
1317
|
+
private _trackEventTarget;
|
|
1290
1318
|
get audioContext(): AudioContext;
|
|
1291
1319
|
_engine: PlaylistEngine | null;
|
|
1292
1320
|
private _warnedMissingTicksToSeconds;
|
|
@@ -1347,7 +1375,7 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1347
1375
|
/** Grid height when no tracks exist — matches scroll area's rendered height. */
|
|
1348
1376
|
private get _emptyGridHeight();
|
|
1349
1377
|
_setSelectedTrackId(trackId: string | null): void;
|
|
1350
|
-
get tracks():
|
|
1378
|
+
get tracks(): TrackWithId[];
|
|
1351
1379
|
get selectedTrackId(): string | null;
|
|
1352
1380
|
get selection(): {
|
|
1353
1381
|
start: number;
|
|
@@ -1772,6 +1800,83 @@ declare global {
|
|
|
1772
1800
|
}
|
|
1773
1801
|
}
|
|
1774
1802
|
|
|
1803
|
+
/**
|
|
1804
|
+
* `<daw-player>` — lightweight single-track HTMLMediaElement player.
|
|
1805
|
+
* Wraps a MediaElementPlayout engine for playback and composes
|
|
1806
|
+
* <daw-ruler>/<daw-waveform>/<daw-playhead> for visuals. No PlaylistEngine,
|
|
1807
|
+
* no adapter, no AudioContext. See docs/specs/2026-06-29-daw-player-core-design.md.
|
|
1808
|
+
*/
|
|
1809
|
+
declare class DawPlayerElement extends LitElement {
|
|
1810
|
+
src: string;
|
|
1811
|
+
peaksSrc: string;
|
|
1812
|
+
waveHeight: number;
|
|
1813
|
+
timescale: boolean;
|
|
1814
|
+
mono: boolean;
|
|
1815
|
+
barWidth: number;
|
|
1816
|
+
barGap: number;
|
|
1817
|
+
get playbackRate(): number;
|
|
1818
|
+
set playbackRate(value: number);
|
|
1819
|
+
private _playbackRate;
|
|
1820
|
+
private _engine;
|
|
1821
|
+
private _trackId;
|
|
1822
|
+
private _anim;
|
|
1823
|
+
private _metadataLoaded;
|
|
1824
|
+
private _readyDispatched;
|
|
1825
|
+
/** True once peaks resolution is complete: succeeded, failed, or no peaks-src set. */
|
|
1826
|
+
private _peaksSettled;
|
|
1827
|
+
private _waveformData;
|
|
1828
|
+
private _channelPeaks;
|
|
1829
|
+
private _sampleRate;
|
|
1830
|
+
private _resizeObserver;
|
|
1831
|
+
static styles: lit.CSSResult;
|
|
1832
|
+
connectedCallback(): void;
|
|
1833
|
+
render(): lit.TemplateResult<1>;
|
|
1834
|
+
protected updated(changed: PropertyValues): void;
|
|
1835
|
+
private _loadPeaks;
|
|
1836
|
+
/** Recompute fit-to-width peaks from the loaded WaveformData. No-op without data. */
|
|
1837
|
+
private _renderWaveform;
|
|
1838
|
+
/**
|
|
1839
|
+
* Samples-per-pixel used by the ruler so its time labels span the full width.
|
|
1840
|
+
* This is intentionally a separate time-based SPP (duration × sampleRate / width)
|
|
1841
|
+
* for the ruler labels — equivalent to the waveform SPP when the WaveformData spans
|
|
1842
|
+
* the full audio duration; may differ for pre-trimmed peaks.
|
|
1843
|
+
*/
|
|
1844
|
+
private _channelSpp;
|
|
1845
|
+
private _loadSource;
|
|
1846
|
+
play(): void;
|
|
1847
|
+
pause(): void;
|
|
1848
|
+
stop(): void;
|
|
1849
|
+
seekTo(time: number): void;
|
|
1850
|
+
setPlaybackRate(rate: number): void;
|
|
1851
|
+
setVolume(volume: number): void;
|
|
1852
|
+
get isPlaying(): boolean;
|
|
1853
|
+
get duration(): number;
|
|
1854
|
+
get currentTime(): number;
|
|
1855
|
+
set currentTime(time: number);
|
|
1856
|
+
get volume(): number;
|
|
1857
|
+
set volume(value: number);
|
|
1858
|
+
get audioElement(): HTMLAudioElement | null;
|
|
1859
|
+
private _onPointerDown;
|
|
1860
|
+
disconnectedCallback(): void;
|
|
1861
|
+
private _dispatch;
|
|
1862
|
+
private _onLoadedMetadata;
|
|
1863
|
+
private _onPlay;
|
|
1864
|
+
private _onPause;
|
|
1865
|
+
private _onEnded;
|
|
1866
|
+
private _onError;
|
|
1867
|
+
/** rAF tick while playing: positions the playhead and emits daw-timeupdate. */
|
|
1868
|
+
private _frame;
|
|
1869
|
+
private _maybeDispatchReady;
|
|
1870
|
+
private get _playhead();
|
|
1871
|
+
private _updatePlayhead;
|
|
1872
|
+
private get _timelineWidth();
|
|
1873
|
+
}
|
|
1874
|
+
declare global {
|
|
1875
|
+
interface HTMLElementTagNameMap {
|
|
1876
|
+
'daw-player': DawPlayerElement;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1775
1880
|
interface SpectrogramControllerHost extends ReactiveControllerHost {
|
|
1776
1881
|
dispatchEvent(event: Event): boolean;
|
|
1777
1882
|
}
|
|
@@ -1949,4 +2054,4 @@ declare function registerEffect(type: string, definition: EffectDefinition): voi
|
|
|
1949
2054
|
declare function getEffectDefinitions(): Map<string, EffectDefinition>;
|
|
1950
2055
|
declare function createEffectInstance(type: string, audioContext: BaseAudioContext, params?: Record<string, number>): CreatedEffect;
|
|
1951
2056
|
|
|
1952
|
-
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, 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 UndoShortcutMap, type WaveformSegment, createEffectInstance, formatDisplayTime, getEffectDefinitions, isDomClip, isTimeDisplayFormat, parseDisplayTime, registerEffect, resolveTransportTarget, splitAtPlayhead, targetSupports, warnOnce, warnUnsupportedOnce };
|
|
2057
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -392,6 +392,12 @@ interface TrackDescriptor {
|
|
|
392
392
|
spectrogramConfig?: SpectrogramConfig | null;
|
|
393
393
|
clips: ClipDescriptor[];
|
|
394
394
|
}
|
|
395
|
+
/** A `TrackDescriptor` plus its `trackId` — the shape returned by `editor.tracks`
|
|
396
|
+
* so consumers can map a track's name to the `trackId` the per-track APIs
|
|
397
|
+
* (`addTrackEffect`, `removeTrack`, `updateTrack`, …) are keyed by. */
|
|
398
|
+
type TrackWithId = TrackDescriptor & {
|
|
399
|
+
trackId: string;
|
|
400
|
+
};
|
|
395
401
|
/**
|
|
396
402
|
* Common fields shared by all clip descriptors regardless of source.
|
|
397
403
|
*/
|
|
@@ -1028,8 +1034,11 @@ interface DawEventMap {
|
|
|
1028
1034
|
'daw-track-connected': CustomEvent<DawTrackConnectedDetail>;
|
|
1029
1035
|
'daw-track-update': CustomEvent<DawTrackIdDetail>;
|
|
1030
1036
|
'daw-track-ready': CustomEvent<DawTrackIdDetail>;
|
|
1037
|
+
'daw-track-removed': CustomEvent<DawTrackIdDetail>;
|
|
1031
1038
|
'daw-track-error': CustomEvent<DawTrackErrorDetail>;
|
|
1032
1039
|
'daw-files-load-error': CustomEvent<DawFilesLoadErrorDetail>;
|
|
1040
|
+
'daw-ready': CustomEvent<void>;
|
|
1041
|
+
'daw-ended': CustomEvent<void>;
|
|
1033
1042
|
'daw-play': CustomEvent<void>;
|
|
1034
1043
|
'daw-pause': CustomEvent<void>;
|
|
1035
1044
|
'daw-stop': CustomEvent<void>;
|
|
@@ -1275,18 +1284,37 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1275
1284
|
* with their live state). Returns the rendered AudioBuffer.
|
|
1276
1285
|
*/
|
|
1277
1286
|
exportAudio(options?: ExportOptions): Promise<AudioBuffer>;
|
|
1278
|
-
/**
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1287
|
+
/** Add a native registry effect to a track's chain. */
|
|
1288
|
+
addTrackEffect(trackId: string, type: string, params?: Record<string, number>): string;
|
|
1289
|
+
/** Snapshot of a track's effect chain (empty array for an unknown track). */
|
|
1290
|
+
trackEffects(trackId: string): EffectState[];
|
|
1291
|
+
removeTrackEffect(trackId: string, effectId: string): void;
|
|
1292
|
+
setTrackEffectParams(trackId: string, effectId: string, params: Record<string, number>): void;
|
|
1293
|
+
setTrackEffectBypassed(trackId: string, effectId: string, bypassed: boolean): void;
|
|
1294
|
+
moveTrackEffect(trackId: string, effectId: string, newIndex: number): void;
|
|
1295
|
+
/** Load a WAM plugin (via the optional @dawcore/wam peer) into a track's chain. */
|
|
1296
|
+
addTrackWamPlugin(trackId: string, url: string, initialState?: unknown): Promise<string>;
|
|
1297
|
+
/** Compile Faust DSP (via the optional @dawcore/faust peer) into a track's chain. */
|
|
1298
|
+
addTrackFaustEffect(trackId: string, dspCode: string, options?: {
|
|
1284
1299
|
name?: string;
|
|
1285
1300
|
}): Promise<string>;
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1301
|
+
/** Open (lazily creating) the GUI for a track-chain effect into a container. */
|
|
1302
|
+
openTrackEffectGui(trackId: string, effectId: string, container: HTMLElement): Promise<HTMLElement>;
|
|
1303
|
+
/** Hide a track-chain effect's GUI (cached for reopen — never destroys). */
|
|
1304
|
+
closeTrackEffectGui(_trackId: string, effectId: string): void;
|
|
1305
|
+
/** Snapshot a track's chain in its persisted form (see dawcore README). */
|
|
1306
|
+
getTrackEffectsState(trackId: string): Promise<SerializedEffectEntry[]>;
|
|
1307
|
+
/** Replace a track's chain from a persisted snapshot. */
|
|
1308
|
+
setTrackEffectsState(trackId: string, entries: SerializedEffectEntry[]): Promise<void>;
|
|
1309
|
+
/**
|
|
1310
|
+
* Event-dispatch source for a per-track effect op: the track's `<daw-track>`
|
|
1311
|
+
* element when one exists (so `daw-effect-*` bubble from it exactly as the
|
|
1312
|
+
* element-method path does), else the editor itself for element-less tracks
|
|
1313
|
+
* (drag-dropped / programmatic). Reads the `_trackElements` index the editor
|
|
1314
|
+
* already maintains across the track connect/remove lifecycle — O(1), and the
|
|
1315
|
+
* same resolution `removeTrack` uses — rather than re-querying the DOM per op.
|
|
1316
|
+
*/
|
|
1317
|
+
private _trackEventTarget;
|
|
1290
1318
|
get audioContext(): AudioContext;
|
|
1291
1319
|
_engine: PlaylistEngine | null;
|
|
1292
1320
|
private _warnedMissingTicksToSeconds;
|
|
@@ -1347,7 +1375,7 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
|
|
|
1347
1375
|
/** Grid height when no tracks exist — matches scroll area's rendered height. */
|
|
1348
1376
|
private get _emptyGridHeight();
|
|
1349
1377
|
_setSelectedTrackId(trackId: string | null): void;
|
|
1350
|
-
get tracks():
|
|
1378
|
+
get tracks(): TrackWithId[];
|
|
1351
1379
|
get selectedTrackId(): string | null;
|
|
1352
1380
|
get selection(): {
|
|
1353
1381
|
start: number;
|
|
@@ -1772,6 +1800,83 @@ declare global {
|
|
|
1772
1800
|
}
|
|
1773
1801
|
}
|
|
1774
1802
|
|
|
1803
|
+
/**
|
|
1804
|
+
* `<daw-player>` — lightweight single-track HTMLMediaElement player.
|
|
1805
|
+
* Wraps a MediaElementPlayout engine for playback and composes
|
|
1806
|
+
* <daw-ruler>/<daw-waveform>/<daw-playhead> for visuals. No PlaylistEngine,
|
|
1807
|
+
* no adapter, no AudioContext. See docs/specs/2026-06-29-daw-player-core-design.md.
|
|
1808
|
+
*/
|
|
1809
|
+
declare class DawPlayerElement extends LitElement {
|
|
1810
|
+
src: string;
|
|
1811
|
+
peaksSrc: string;
|
|
1812
|
+
waveHeight: number;
|
|
1813
|
+
timescale: boolean;
|
|
1814
|
+
mono: boolean;
|
|
1815
|
+
barWidth: number;
|
|
1816
|
+
barGap: number;
|
|
1817
|
+
get playbackRate(): number;
|
|
1818
|
+
set playbackRate(value: number);
|
|
1819
|
+
private _playbackRate;
|
|
1820
|
+
private _engine;
|
|
1821
|
+
private _trackId;
|
|
1822
|
+
private _anim;
|
|
1823
|
+
private _metadataLoaded;
|
|
1824
|
+
private _readyDispatched;
|
|
1825
|
+
/** True once peaks resolution is complete: succeeded, failed, or no peaks-src set. */
|
|
1826
|
+
private _peaksSettled;
|
|
1827
|
+
private _waveformData;
|
|
1828
|
+
private _channelPeaks;
|
|
1829
|
+
private _sampleRate;
|
|
1830
|
+
private _resizeObserver;
|
|
1831
|
+
static styles: lit.CSSResult;
|
|
1832
|
+
connectedCallback(): void;
|
|
1833
|
+
render(): lit.TemplateResult<1>;
|
|
1834
|
+
protected updated(changed: PropertyValues): void;
|
|
1835
|
+
private _loadPeaks;
|
|
1836
|
+
/** Recompute fit-to-width peaks from the loaded WaveformData. No-op without data. */
|
|
1837
|
+
private _renderWaveform;
|
|
1838
|
+
/**
|
|
1839
|
+
* Samples-per-pixel used by the ruler so its time labels span the full width.
|
|
1840
|
+
* This is intentionally a separate time-based SPP (duration × sampleRate / width)
|
|
1841
|
+
* for the ruler labels — equivalent to the waveform SPP when the WaveformData spans
|
|
1842
|
+
* the full audio duration; may differ for pre-trimmed peaks.
|
|
1843
|
+
*/
|
|
1844
|
+
private _channelSpp;
|
|
1845
|
+
private _loadSource;
|
|
1846
|
+
play(): void;
|
|
1847
|
+
pause(): void;
|
|
1848
|
+
stop(): void;
|
|
1849
|
+
seekTo(time: number): void;
|
|
1850
|
+
setPlaybackRate(rate: number): void;
|
|
1851
|
+
setVolume(volume: number): void;
|
|
1852
|
+
get isPlaying(): boolean;
|
|
1853
|
+
get duration(): number;
|
|
1854
|
+
get currentTime(): number;
|
|
1855
|
+
set currentTime(time: number);
|
|
1856
|
+
get volume(): number;
|
|
1857
|
+
set volume(value: number);
|
|
1858
|
+
get audioElement(): HTMLAudioElement | null;
|
|
1859
|
+
private _onPointerDown;
|
|
1860
|
+
disconnectedCallback(): void;
|
|
1861
|
+
private _dispatch;
|
|
1862
|
+
private _onLoadedMetadata;
|
|
1863
|
+
private _onPlay;
|
|
1864
|
+
private _onPause;
|
|
1865
|
+
private _onEnded;
|
|
1866
|
+
private _onError;
|
|
1867
|
+
/** rAF tick while playing: positions the playhead and emits daw-timeupdate. */
|
|
1868
|
+
private _frame;
|
|
1869
|
+
private _maybeDispatchReady;
|
|
1870
|
+
private get _playhead();
|
|
1871
|
+
private _updatePlayhead;
|
|
1872
|
+
private get _timelineWidth();
|
|
1873
|
+
}
|
|
1874
|
+
declare global {
|
|
1875
|
+
interface HTMLElementTagNameMap {
|
|
1876
|
+
'daw-player': DawPlayerElement;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1775
1880
|
interface SpectrogramControllerHost extends ReactiveControllerHost {
|
|
1776
1881
|
dispatchEvent(event: Event): boolean;
|
|
1777
1882
|
}
|
|
@@ -1949,4 +2054,4 @@ declare function registerEffect(type: string, definition: EffectDefinition): voi
|
|
|
1949
2054
|
declare function getEffectDefinitions(): Map<string, EffectDefinition>;
|
|
1950
2055
|
declare function createEffectInstance(type: string, audioContext: BaseAudioContext, params?: Record<string, number>): CreatedEffect;
|
|
1951
2056
|
|
|
1952
|
-
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, 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 UndoShortcutMap, type WaveformSegment, createEffectInstance, formatDisplayTime, getEffectDefinitions, isDomClip, isTimeDisplayFormat, parseDisplayTime, registerEffect, resolveTransportTarget, splitAtPlayhead, targetSupports, warnOnce, warnUnsupportedOnce };
|
|
2057
|
+
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 };
|