@waveform-playlist/core 13.0.0-next.2 → 13.0.0-next.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 +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1578,6 +1578,44 @@ interface AudioTrackOptions {
|
|
|
1578
1578
|
*/
|
|
1579
1579
|
declare function audioTrack(options: AudioTrackOptions): ArrangementTrack;
|
|
1580
1580
|
|
|
1581
|
+
/**
|
|
1582
|
+
* One gesture on a mixer control (a fader drag, a held arrow key) as one
|
|
1583
|
+
* undo step (#843). The mixer setters join changes that carry the same
|
|
1584
|
+
* `gesture` id into one step; this helper makes the id, and ends the gesture
|
|
1585
|
+
* so that the next change starts a new one.
|
|
1586
|
+
*
|
|
1587
|
+
* Framework-free: React's sliders and dawcore's elements both use it. One
|
|
1588
|
+
* helper per control, so two sliders never share an id. It lives in core,
|
|
1589
|
+
* not beside the setters in the engine, because `<daw-editor>` loads the
|
|
1590
|
+
* engine with a dynamic `import()`: a value import of the engine would put
|
|
1591
|
+
* it back in dawcore's first bundle.
|
|
1592
|
+
*/
|
|
1593
|
+
interface MixerGesture {
|
|
1594
|
+
/** The id to pass while a gesture is going on. */
|
|
1595
|
+
readonly id: string;
|
|
1596
|
+
/** The gesture is over: the next change starts a new one. */
|
|
1597
|
+
end(): void;
|
|
1598
|
+
/** Ends the gesture on the input's own events; returns the detach function. */
|
|
1599
|
+
attach(input: HTMLInputElement): () => void;
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* Make the gesture helper of one mixer control.
|
|
1603
|
+
*
|
|
1604
|
+
* ```ts
|
|
1605
|
+
* const gesture = createMixerGesture();
|
|
1606
|
+
* const detach = gesture.attach(slider);
|
|
1607
|
+
* slider.addEventListener('input', () =>
|
|
1608
|
+
* engine.setTrackVolume(trackId, slider.valueAsNumber, { gesture: gesture.id })
|
|
1609
|
+
* );
|
|
1610
|
+
* ```
|
|
1611
|
+
*
|
|
1612
|
+
* `attach` ends the gesture on the input's `change` (the end of a pointer
|
|
1613
|
+
* drag), except while a key that moves the input is held down; then on that
|
|
1614
|
+
* key's `keyup`. A `blur` ends it too. Mute and solo buttons need no helper:
|
|
1615
|
+
* each click is a step of its own.
|
|
1616
|
+
*/
|
|
1617
|
+
declare function createMixerGesture(): MixerGesture;
|
|
1618
|
+
|
|
1581
1619
|
/**
|
|
1582
1620
|
* The effect registry shared by `<daw-editor>` and the React effects hooks:
|
|
1583
1621
|
* one `registerEffect()` call makes a custom effect (an AudioWorklet, or any
|
|
@@ -1686,4 +1724,4 @@ declare function needsPrepare(type: string, audioContext: BaseAudioContext): boo
|
|
|
1686
1724
|
declare function ensureEffectPrepared(type: string, audioContext: BaseAudioContext): Promise<void>;
|
|
1687
1725
|
declare function createEffectInstance(type: string, audioContext: BaseAudioContext, params?: Record<string, number>): CreatedNativeEffect;
|
|
1688
1726
|
|
|
1689
|
-
export { ANNOTATION_LINK_THRESHOLD_TICKS, type AnnotationAction, type AnnotationActionOptions, type AnnotationBoundaryOptions, type AnnotationBoundaryUpdate, type AnnotationBoundsChange, type AnnotationData, type AnnotationEventMap, type AnnotationFormat, type AnnotationListOptions, type AnnotationShortcutAction, type AnnotationShortcutMap, type AnnotationStore, type AnnotationStoreOptions, type ArrangementTrack, type AudioBuffer$1 as AudioBuffer, type AudioClip, type AudioTrackOptions, type Bits, type ClipSource, type ClipTrack, type ColorMapEntry, type ColorMapName, type ColorMapValue, type CreateClipOptions, type CreateClipOptionsSeconds, type CreateClipOptionsTicks, type CreateTrackOptions, type CreatedNativeEffect, DEFAULT_ANNOTATION_SHORTCUTS, DEFAULT_SPECTROGRAM_COLOR_MAP, type EffectParamDef, type FFTSize, type Fade, type FadeConfig, type FadeType, type Gap, InteractionState, type KeyBinding, type KeyboardShortcut, LINK_THRESHOLD, type LoadingClip, MAX_CANVAS_WIDTH, METER_PEAK_DECAY, MIN_ANNOTATION_DURATION, MIN_PIXELS_PER_UNIT, type MeterEntry, type MeterLevels, type MeterReading, type MeterSource, type MicrophoneDeviceInfo, type MicrophoneEnumeration, type MidiNoteData, type MusicalTick, type MusicalTickData, type MusicalTickParams, type NativeEffectDefinition, type NativeEffectInstance, PPQN, type PanMatrix, type PanStage, type PanStageContext, type PeakData, type Peaks, type PlaylistConfig, type PlayoutState, type RangeSupport, type ReadMeterMessageParams, type RecordingProgress, type RecordingProgressSource, type RenderAnnotationItemProps, type RenderMode, SPECTROGRAM_DEFAULTS, type SnapTo, type SourceLoader, type SourceState, type SpectrogramCanvasIdParts, type SpectrogramCanvasRegistration, type SpectrogramComputeConfig, type SpectrogramConfig, type SpectrogramData, type SpectrogramDisplayConfig, type TickType, type TimeSelection, type Timeline, type Track, type TrackChannelSource, type TrackKind, type TrackSpectrogramOverrides, type ValueSource, type ValueSourceHandle, type WaveformConfig, type WaveformDataObject, type ZoomLevel, annotationMinDurationTicks, appendPeaks, appendToAudioBuffer, applyAnnotationBounds, applyFadeIn, applyFadeOut, assertTrackKind, audibleLatencySamples, audioTrack, buildSpectrogramCanvasId, calculateDuration, carveClipRange, clipDurationTime, clipEndTime, clipKind, clipOffsetTime, clipPixelWidth, clipStartTime, clipsOverlap, computeMusicalTicks, concatenateAudioData, createAnnotationStore, createAudioBuffer, createClip, createClipFromSeconds, createClipFromTicks, createEffectInstance, createPanStage, createSourceLoader, createTimeline, createTrack, createValueSource, dBToNormalized, detectMeterChanges, ensureEffectPrepared, enumerateMicrophones, exponentialCurve, findGaps, gainToDb, gainToNormalized, generateCurve, generatePeaks, getClipsAtSample, getClipsInRange, getEffectDefinitions, handleKeyboardEvent, isLoadingClip, keyBelongsToFocusedControl, linearCurve, logarithmicCurve, matchesKeyBinding, needsPrepare, normalizedToDb, panMatrix, parseSpectrogramCanvasId, pixelsToSamples, pixelsToSeconds, prepareEffect, probeRangeSupport, readMeterMessage, registerEffect, resolveAnnotationShortcuts, resolveRecordingOffsetSamples, sCurveCurve, samplesToPixels, samplesToSeconds, samplesToTicks, secondsToPixels, secondsToSamples, silentMeterLevels, snapTickToGrid, snapToGrid, snapToTicks, sortClipsByTime, splitTrackByKind, ticksPerBar, ticksPerBeat, ticksToBarBeat, ticksToSamples, trackChannelCount, trackKind, unregisterEffect, updateAnnotationBoundaries, watchMicrophoneDevices };
|
|
1727
|
+
export { ANNOTATION_LINK_THRESHOLD_TICKS, type AnnotationAction, type AnnotationActionOptions, type AnnotationBoundaryOptions, type AnnotationBoundaryUpdate, type AnnotationBoundsChange, type AnnotationData, type AnnotationEventMap, type AnnotationFormat, type AnnotationListOptions, type AnnotationShortcutAction, type AnnotationShortcutMap, type AnnotationStore, type AnnotationStoreOptions, type ArrangementTrack, type AudioBuffer$1 as AudioBuffer, type AudioClip, type AudioTrackOptions, type Bits, type ClipSource, type ClipTrack, type ColorMapEntry, type ColorMapName, type ColorMapValue, type CreateClipOptions, type CreateClipOptionsSeconds, type CreateClipOptionsTicks, type CreateTrackOptions, type CreatedNativeEffect, DEFAULT_ANNOTATION_SHORTCUTS, DEFAULT_SPECTROGRAM_COLOR_MAP, type EffectParamDef, type FFTSize, type Fade, type FadeConfig, type FadeType, type Gap, InteractionState, type KeyBinding, type KeyboardShortcut, LINK_THRESHOLD, type LoadingClip, MAX_CANVAS_WIDTH, METER_PEAK_DECAY, MIN_ANNOTATION_DURATION, MIN_PIXELS_PER_UNIT, type MeterEntry, type MeterLevels, type MeterReading, type MeterSource, type MicrophoneDeviceInfo, type MicrophoneEnumeration, type MidiNoteData, type MixerGesture, type MusicalTick, type MusicalTickData, type MusicalTickParams, type NativeEffectDefinition, type NativeEffectInstance, PPQN, type PanMatrix, type PanStage, type PanStageContext, type PeakData, type Peaks, type PlaylistConfig, type PlayoutState, type RangeSupport, type ReadMeterMessageParams, type RecordingProgress, type RecordingProgressSource, type RenderAnnotationItemProps, type RenderMode, SPECTROGRAM_DEFAULTS, type SnapTo, type SourceLoader, type SourceState, type SpectrogramCanvasIdParts, type SpectrogramCanvasRegistration, type SpectrogramComputeConfig, type SpectrogramConfig, type SpectrogramData, type SpectrogramDisplayConfig, type TickType, type TimeSelection, type Timeline, type Track, type TrackChannelSource, type TrackKind, type TrackSpectrogramOverrides, type ValueSource, type ValueSourceHandle, type WaveformConfig, type WaveformDataObject, type ZoomLevel, annotationMinDurationTicks, appendPeaks, appendToAudioBuffer, applyAnnotationBounds, applyFadeIn, applyFadeOut, assertTrackKind, audibleLatencySamples, audioTrack, buildSpectrogramCanvasId, calculateDuration, carveClipRange, clipDurationTime, clipEndTime, clipKind, clipOffsetTime, clipPixelWidth, clipStartTime, clipsOverlap, computeMusicalTicks, concatenateAudioData, createAnnotationStore, createAudioBuffer, createClip, createClipFromSeconds, createClipFromTicks, createEffectInstance, createMixerGesture, createPanStage, createSourceLoader, createTimeline, createTrack, createValueSource, dBToNormalized, detectMeterChanges, ensureEffectPrepared, enumerateMicrophones, exponentialCurve, findGaps, gainToDb, gainToNormalized, generateCurve, generatePeaks, getClipsAtSample, getClipsInRange, getEffectDefinitions, handleKeyboardEvent, isLoadingClip, keyBelongsToFocusedControl, linearCurve, logarithmicCurve, matchesKeyBinding, needsPrepare, normalizedToDb, panMatrix, parseSpectrogramCanvasId, pixelsToSamples, pixelsToSeconds, prepareEffect, probeRangeSupport, readMeterMessage, registerEffect, resolveAnnotationShortcuts, resolveRecordingOffsetSamples, sCurveCurve, samplesToPixels, samplesToSeconds, samplesToTicks, secondsToPixels, secondsToSamples, silentMeterLevels, snapTickToGrid, snapToGrid, snapToTicks, sortClipsByTime, splitTrackByKind, ticksPerBar, ticksPerBeat, ticksToBarBeat, ticksToSamples, trackChannelCount, trackKind, unregisterEffect, updateAnnotationBoundaries, watchMicrophoneDevices };
|
package/dist/index.d.ts
CHANGED
|
@@ -1578,6 +1578,44 @@ interface AudioTrackOptions {
|
|
|
1578
1578
|
*/
|
|
1579
1579
|
declare function audioTrack(options: AudioTrackOptions): ArrangementTrack;
|
|
1580
1580
|
|
|
1581
|
+
/**
|
|
1582
|
+
* One gesture on a mixer control (a fader drag, a held arrow key) as one
|
|
1583
|
+
* undo step (#843). The mixer setters join changes that carry the same
|
|
1584
|
+
* `gesture` id into one step; this helper makes the id, and ends the gesture
|
|
1585
|
+
* so that the next change starts a new one.
|
|
1586
|
+
*
|
|
1587
|
+
* Framework-free: React's sliders and dawcore's elements both use it. One
|
|
1588
|
+
* helper per control, so two sliders never share an id. It lives in core,
|
|
1589
|
+
* not beside the setters in the engine, because `<daw-editor>` loads the
|
|
1590
|
+
* engine with a dynamic `import()`: a value import of the engine would put
|
|
1591
|
+
* it back in dawcore's first bundle.
|
|
1592
|
+
*/
|
|
1593
|
+
interface MixerGesture {
|
|
1594
|
+
/** The id to pass while a gesture is going on. */
|
|
1595
|
+
readonly id: string;
|
|
1596
|
+
/** The gesture is over: the next change starts a new one. */
|
|
1597
|
+
end(): void;
|
|
1598
|
+
/** Ends the gesture on the input's own events; returns the detach function. */
|
|
1599
|
+
attach(input: HTMLInputElement): () => void;
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* Make the gesture helper of one mixer control.
|
|
1603
|
+
*
|
|
1604
|
+
* ```ts
|
|
1605
|
+
* const gesture = createMixerGesture();
|
|
1606
|
+
* const detach = gesture.attach(slider);
|
|
1607
|
+
* slider.addEventListener('input', () =>
|
|
1608
|
+
* engine.setTrackVolume(trackId, slider.valueAsNumber, { gesture: gesture.id })
|
|
1609
|
+
* );
|
|
1610
|
+
* ```
|
|
1611
|
+
*
|
|
1612
|
+
* `attach` ends the gesture on the input's `change` (the end of a pointer
|
|
1613
|
+
* drag), except while a key that moves the input is held down; then on that
|
|
1614
|
+
* key's `keyup`. A `blur` ends it too. Mute and solo buttons need no helper:
|
|
1615
|
+
* each click is a step of its own.
|
|
1616
|
+
*/
|
|
1617
|
+
declare function createMixerGesture(): MixerGesture;
|
|
1618
|
+
|
|
1581
1619
|
/**
|
|
1582
1620
|
* The effect registry shared by `<daw-editor>` and the React effects hooks:
|
|
1583
1621
|
* one `registerEffect()` call makes a custom effect (an AudioWorklet, or any
|
|
@@ -1686,4 +1724,4 @@ declare function needsPrepare(type: string, audioContext: BaseAudioContext): boo
|
|
|
1686
1724
|
declare function ensureEffectPrepared(type: string, audioContext: BaseAudioContext): Promise<void>;
|
|
1687
1725
|
declare function createEffectInstance(type: string, audioContext: BaseAudioContext, params?: Record<string, number>): CreatedNativeEffect;
|
|
1688
1726
|
|
|
1689
|
-
export { ANNOTATION_LINK_THRESHOLD_TICKS, type AnnotationAction, type AnnotationActionOptions, type AnnotationBoundaryOptions, type AnnotationBoundaryUpdate, type AnnotationBoundsChange, type AnnotationData, type AnnotationEventMap, type AnnotationFormat, type AnnotationListOptions, type AnnotationShortcutAction, type AnnotationShortcutMap, type AnnotationStore, type AnnotationStoreOptions, type ArrangementTrack, type AudioBuffer$1 as AudioBuffer, type AudioClip, type AudioTrackOptions, type Bits, type ClipSource, type ClipTrack, type ColorMapEntry, type ColorMapName, type ColorMapValue, type CreateClipOptions, type CreateClipOptionsSeconds, type CreateClipOptionsTicks, type CreateTrackOptions, type CreatedNativeEffect, DEFAULT_ANNOTATION_SHORTCUTS, DEFAULT_SPECTROGRAM_COLOR_MAP, type EffectParamDef, type FFTSize, type Fade, type FadeConfig, type FadeType, type Gap, InteractionState, type KeyBinding, type KeyboardShortcut, LINK_THRESHOLD, type LoadingClip, MAX_CANVAS_WIDTH, METER_PEAK_DECAY, MIN_ANNOTATION_DURATION, MIN_PIXELS_PER_UNIT, type MeterEntry, type MeterLevels, type MeterReading, type MeterSource, type MicrophoneDeviceInfo, type MicrophoneEnumeration, type MidiNoteData, type MusicalTick, type MusicalTickData, type MusicalTickParams, type NativeEffectDefinition, type NativeEffectInstance, PPQN, type PanMatrix, type PanStage, type PanStageContext, type PeakData, type Peaks, type PlaylistConfig, type PlayoutState, type RangeSupport, type ReadMeterMessageParams, type RecordingProgress, type RecordingProgressSource, type RenderAnnotationItemProps, type RenderMode, SPECTROGRAM_DEFAULTS, type SnapTo, type SourceLoader, type SourceState, type SpectrogramCanvasIdParts, type SpectrogramCanvasRegistration, type SpectrogramComputeConfig, type SpectrogramConfig, type SpectrogramData, type SpectrogramDisplayConfig, type TickType, type TimeSelection, type Timeline, type Track, type TrackChannelSource, type TrackKind, type TrackSpectrogramOverrides, type ValueSource, type ValueSourceHandle, type WaveformConfig, type WaveformDataObject, type ZoomLevel, annotationMinDurationTicks, appendPeaks, appendToAudioBuffer, applyAnnotationBounds, applyFadeIn, applyFadeOut, assertTrackKind, audibleLatencySamples, audioTrack, buildSpectrogramCanvasId, calculateDuration, carveClipRange, clipDurationTime, clipEndTime, clipKind, clipOffsetTime, clipPixelWidth, clipStartTime, clipsOverlap, computeMusicalTicks, concatenateAudioData, createAnnotationStore, createAudioBuffer, createClip, createClipFromSeconds, createClipFromTicks, createEffectInstance, createPanStage, createSourceLoader, createTimeline, createTrack, createValueSource, dBToNormalized, detectMeterChanges, ensureEffectPrepared, enumerateMicrophones, exponentialCurve, findGaps, gainToDb, gainToNormalized, generateCurve, generatePeaks, getClipsAtSample, getClipsInRange, getEffectDefinitions, handleKeyboardEvent, isLoadingClip, keyBelongsToFocusedControl, linearCurve, logarithmicCurve, matchesKeyBinding, needsPrepare, normalizedToDb, panMatrix, parseSpectrogramCanvasId, pixelsToSamples, pixelsToSeconds, prepareEffect, probeRangeSupport, readMeterMessage, registerEffect, resolveAnnotationShortcuts, resolveRecordingOffsetSamples, sCurveCurve, samplesToPixels, samplesToSeconds, samplesToTicks, secondsToPixels, secondsToSamples, silentMeterLevels, snapTickToGrid, snapToGrid, snapToTicks, sortClipsByTime, splitTrackByKind, ticksPerBar, ticksPerBeat, ticksToBarBeat, ticksToSamples, trackChannelCount, trackKind, unregisterEffect, updateAnnotationBoundaries, watchMicrophoneDevices };
|
|
1727
|
+
export { ANNOTATION_LINK_THRESHOLD_TICKS, type AnnotationAction, type AnnotationActionOptions, type AnnotationBoundaryOptions, type AnnotationBoundaryUpdate, type AnnotationBoundsChange, type AnnotationData, type AnnotationEventMap, type AnnotationFormat, type AnnotationListOptions, type AnnotationShortcutAction, type AnnotationShortcutMap, type AnnotationStore, type AnnotationStoreOptions, type ArrangementTrack, type AudioBuffer$1 as AudioBuffer, type AudioClip, type AudioTrackOptions, type Bits, type ClipSource, type ClipTrack, type ColorMapEntry, type ColorMapName, type ColorMapValue, type CreateClipOptions, type CreateClipOptionsSeconds, type CreateClipOptionsTicks, type CreateTrackOptions, type CreatedNativeEffect, DEFAULT_ANNOTATION_SHORTCUTS, DEFAULT_SPECTROGRAM_COLOR_MAP, type EffectParamDef, type FFTSize, type Fade, type FadeConfig, type FadeType, type Gap, InteractionState, type KeyBinding, type KeyboardShortcut, LINK_THRESHOLD, type LoadingClip, MAX_CANVAS_WIDTH, METER_PEAK_DECAY, MIN_ANNOTATION_DURATION, MIN_PIXELS_PER_UNIT, type MeterEntry, type MeterLevels, type MeterReading, type MeterSource, type MicrophoneDeviceInfo, type MicrophoneEnumeration, type MidiNoteData, type MixerGesture, type MusicalTick, type MusicalTickData, type MusicalTickParams, type NativeEffectDefinition, type NativeEffectInstance, PPQN, type PanMatrix, type PanStage, type PanStageContext, type PeakData, type Peaks, type PlaylistConfig, type PlayoutState, type RangeSupport, type ReadMeterMessageParams, type RecordingProgress, type RecordingProgressSource, type RenderAnnotationItemProps, type RenderMode, SPECTROGRAM_DEFAULTS, type SnapTo, type SourceLoader, type SourceState, type SpectrogramCanvasIdParts, type SpectrogramCanvasRegistration, type SpectrogramComputeConfig, type SpectrogramConfig, type SpectrogramData, type SpectrogramDisplayConfig, type TickType, type TimeSelection, type Timeline, type Track, type TrackChannelSource, type TrackKind, type TrackSpectrogramOverrides, type ValueSource, type ValueSourceHandle, type WaveformConfig, type WaveformDataObject, type ZoomLevel, annotationMinDurationTicks, appendPeaks, appendToAudioBuffer, applyAnnotationBounds, applyFadeIn, applyFadeOut, assertTrackKind, audibleLatencySamples, audioTrack, buildSpectrogramCanvasId, calculateDuration, carveClipRange, clipDurationTime, clipEndTime, clipKind, clipOffsetTime, clipPixelWidth, clipStartTime, clipsOverlap, computeMusicalTicks, concatenateAudioData, createAnnotationStore, createAudioBuffer, createClip, createClipFromSeconds, createClipFromTicks, createEffectInstance, createMixerGesture, createPanStage, createSourceLoader, createTimeline, createTrack, createValueSource, dBToNormalized, detectMeterChanges, ensureEffectPrepared, enumerateMicrophones, exponentialCurve, findGaps, gainToDb, gainToNormalized, generateCurve, generatePeaks, getClipsAtSample, getClipsInRange, getEffectDefinitions, handleKeyboardEvent, isLoadingClip, keyBelongsToFocusedControl, linearCurve, logarithmicCurve, matchesKeyBinding, needsPrepare, normalizedToDb, panMatrix, parseSpectrogramCanvasId, pixelsToSamples, pixelsToSeconds, prepareEffect, probeRangeSupport, readMeterMessage, registerEffect, resolveAnnotationShortcuts, resolveRecordingOffsetSamples, sCurveCurve, samplesToPixels, samplesToSeconds, samplesToTicks, secondsToPixels, secondsToSamples, silentMeterLevels, snapTickToGrid, snapToGrid, snapToTicks, sortClipsByTime, splitTrackByKind, ticksPerBar, ticksPerBeat, ticksToBarBeat, ticksToSamples, trackChannelCount, trackKind, unregisterEffect, updateAnnotationBoundaries, watchMicrophoneDevices };
|
package/dist/index.js
CHANGED
|
@@ -58,6 +58,7 @@ __export(index_exports, {
|
|
|
58
58
|
createClipFromSeconds: () => createClipFromSeconds,
|
|
59
59
|
createClipFromTicks: () => createClipFromTicks,
|
|
60
60
|
createEffectInstance: () => createEffectInstance,
|
|
61
|
+
createMixerGesture: () => createMixerGesture,
|
|
61
62
|
createPanStage: () => createPanStage,
|
|
62
63
|
createSourceLoader: () => createSourceLoader,
|
|
63
64
|
createTimeline: () => createTimeline,
|
|
@@ -1724,6 +1725,66 @@ function audioTrack(options) {
|
|
|
1724
1725
|
return track;
|
|
1725
1726
|
}
|
|
1726
1727
|
|
|
1728
|
+
// src/mixerGesture.ts
|
|
1729
|
+
var RANGE_KEYS = /* @__PURE__ */ new Set([
|
|
1730
|
+
"ArrowUp",
|
|
1731
|
+
"ArrowDown",
|
|
1732
|
+
"ArrowLeft",
|
|
1733
|
+
"ArrowRight",
|
|
1734
|
+
"PageUp",
|
|
1735
|
+
"PageDown",
|
|
1736
|
+
"Home",
|
|
1737
|
+
"End"
|
|
1738
|
+
]);
|
|
1739
|
+
var ID_PREFIX = Math.random().toString(36).slice(2, 10);
|
|
1740
|
+
var idCount = 0;
|
|
1741
|
+
function nextId() {
|
|
1742
|
+
idCount += 1;
|
|
1743
|
+
return `mg-${ID_PREFIX}-${idCount}`;
|
|
1744
|
+
}
|
|
1745
|
+
function createMixerGesture() {
|
|
1746
|
+
let id = nextId();
|
|
1747
|
+
const end = () => {
|
|
1748
|
+
id = nextId();
|
|
1749
|
+
};
|
|
1750
|
+
const attach = (input) => {
|
|
1751
|
+
let heldKey = null;
|
|
1752
|
+
const onKeyDown = (event) => {
|
|
1753
|
+
const { key } = event;
|
|
1754
|
+
if (RANGE_KEYS.has(key)) heldKey = key;
|
|
1755
|
+
};
|
|
1756
|
+
const onKeyUp = (event) => {
|
|
1757
|
+
if (event.key !== heldKey) return;
|
|
1758
|
+
heldKey = null;
|
|
1759
|
+
end();
|
|
1760
|
+
};
|
|
1761
|
+
const onChange = () => {
|
|
1762
|
+
if (heldKey === null) end();
|
|
1763
|
+
};
|
|
1764
|
+
const onBlur = () => {
|
|
1765
|
+
heldKey = null;
|
|
1766
|
+
end();
|
|
1767
|
+
};
|
|
1768
|
+
input.addEventListener("keydown", onKeyDown);
|
|
1769
|
+
input.addEventListener("keyup", onKeyUp);
|
|
1770
|
+
input.addEventListener("change", onChange);
|
|
1771
|
+
input.addEventListener("blur", onBlur);
|
|
1772
|
+
return () => {
|
|
1773
|
+
input.removeEventListener("keydown", onKeyDown);
|
|
1774
|
+
input.removeEventListener("keyup", onKeyUp);
|
|
1775
|
+
input.removeEventListener("change", onChange);
|
|
1776
|
+
input.removeEventListener("blur", onBlur);
|
|
1777
|
+
};
|
|
1778
|
+
};
|
|
1779
|
+
return {
|
|
1780
|
+
get id() {
|
|
1781
|
+
return id;
|
|
1782
|
+
},
|
|
1783
|
+
end,
|
|
1784
|
+
attach
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1727
1788
|
// src/effects/registry.ts
|
|
1728
1789
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("@waveform-playlist/core/effect-registry/v1");
|
|
1729
1790
|
function registryState() {
|
|
@@ -1866,6 +1927,7 @@ function createEffectInstance(type, audioContext, params = {}) {
|
|
|
1866
1927
|
createClipFromSeconds,
|
|
1867
1928
|
createClipFromTicks,
|
|
1868
1929
|
createEffectInstance,
|
|
1930
|
+
createMixerGesture,
|
|
1869
1931
|
createPanStage,
|
|
1870
1932
|
createSourceLoader,
|
|
1871
1933
|
createTimeline,
|