@dawcore/components 0.0.39-next.19 → 0.0.39-next.20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost } from 'lit';
3
- import { AnnotationData, AnnotationShortcutMap, MidiNoteData, PanLaw, TrackKind, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, AudioClip, SnapTo, ColorMapValue, ClipTrack, KeyBinding, KeyboardShortcut } from '@waveform-playlist/core';
3
+ import { AnnotationData, AnnotationShortcutMap, MidiNoteData, PanLaw, TrackKind, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, SnapTo, ColorMapValue, ClipTrack, KeyBinding, KeyboardShortcut } from '@waveform-playlist/core';
4
4
  import WaveformData from 'waveform-data';
5
5
  import { Arrangement, TrackMixerValues, PlayoutAdapter, EditorEngine } from '@waveform-playlist/engine';
6
6
  import { MidiLoadOptions, MidiLoadResult } from '@dawcore/midi';
@@ -1157,13 +1157,6 @@ interface ClipEngineContract {
1157
1157
  /** Move a clip; returns the delta actually applied. One undo step. */
1158
1158
  moveClip(trackId: string, clipId: string, deltaSamples: number): number;
1159
1159
  trimClip(trackId: string, clipId: string, boundary: 'left' | 'right', deltaSamples: number): void;
1160
- /** The loaded clips of each track (a move collides with them, as `moveClip` does). */
1161
- getState(): {
1162
- tracks: readonly {
1163
- id: string;
1164
- clips: readonly AudioClip[];
1165
- }[];
1166
- };
1167
1160
  /** Get a clip's full bounds for trim constraint computation. */
1168
1161
  getClipBounds(trackId: string, clipId: string): ClipBounds | null;
1169
1162
  /** Constrain a trim delta using the engine's collision/bounds logic. */
@@ -1182,6 +1175,11 @@ interface ClipPointerHost {
1182
1175
  readonly effectiveSampleRate: number;
1183
1176
  readonly interactiveClips: boolean;
1184
1177
  readonly engine: ClipEngineContract | null;
1178
+ /**
1179
+ * The arrangement played: a move collides with its clips, loading ones
1180
+ * included, as `moveClip` does (#859), and a drag follows its changes.
1181
+ */
1182
+ readonly arrangement: Pick<Arrangement, 'getTracks' | 'subscribe'>;
1185
1183
  readonly shadowRoot: ShadowRoot | null;
1186
1184
  readonly scaleMode: 'temporal' | 'beats';
1187
1185
  readonly ticksPerPixel: number;
@@ -1209,7 +1207,11 @@ interface ClipPointerHost {
1209
1207
  * during a drag always came from outside.
1210
1208
  *
1211
1209
  * Move: the clip container's `left` follows the pointer, constrained by the
1212
- * track's other loaded clips as `moveClip` will be; one `moveClip` on release.
1210
+ * track's other clips, loading ones included, as `moveClip` will be; one
1211
+ * `moveClip` on release.
1212
+ * A change of the arrangement during a drag (audio arriving next to the clip)
1213
+ * draws the drag again from the last pointer position (#859), so a release
1214
+ * with no move after it commits what is drawn.
1213
1215
  * Trim: updates clip container CSS and peaks imperatively during drag, then
1214
1216
  * applies the cumulative delta to the engine once on release.
1215
1217
  */
@@ -1230,6 +1232,8 @@ declare class ClipPointerHandler {
1230
1232
  private _originalStartSample;
1231
1233
  private _moveClip;
1232
1234
  private _moveSorted;
1235
+ private _lastDeltaPx;
1236
+ private _stopFollowing;
1233
1237
  constructor(host: ClipPointerHost);
1234
1238
  /**
1235
1239
  * Convert a pixel delta to samples, snapping in tick space when in beats mode.
@@ -1269,8 +1273,14 @@ declare class ClipPointerHandler {
1269
1273
  * press is dropped.
1270
1274
  */
1271
1275
  private _startDrag;
1276
+ /** The dragged clip and its neighbours, read from the arrangement now. False when gone. */
1277
+ private _readMoveNeighbours;
1278
+ /** The tracks changed under the drag: draw it again from the last pointer position. */
1279
+ private _onArrangementChange;
1272
1280
  /** Processes pointermove events during an active drag. */
1273
1281
  onPointerMove(e: PointerEvent): void;
1282
+ /** Draw the drag `totalDeltaPx` from its start, constrained as the release will be. */
1283
+ private _applyDrag;
1274
1284
  /** Processes pointerup events to finalize and dispatch result events. */
1275
1285
  onPointerUp(_e: PointerEvent): void;
1276
1286
  /** Processes pointercancel — reverts the in-progress drag.
@@ -1869,6 +1879,13 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
1869
1879
  * mixer frame).
1870
1880
  */
1871
1881
  private _follow;
1882
+ /**
1883
+ * The clips the arrangement took out by itself because nothing of their
1884
+ * audio was left after their offset (#859, maintainer's choice "remove"),
1885
+ * as its change says (`removedClips`), reported with `daw-clip-error`
1886
+ * (maintainer, "a"). Their `<daw-clip>` stays on the page.
1887
+ */
1888
+ private _reportRemovedOnArrival;
1872
1889
  /**
1873
1890
  * A change to the arrangement while a drag is in progress came from
1874
1891
  * elsewhere (a drag writes nothing until its release): cancel the drag
@@ -2116,11 +2133,14 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
2116
2133
  private _taskGesture;
2117
2134
  /** @internal A property or attribute set on a live `<daw-clip>`: one undo step. */
2118
2135
  _requestClipChange(trackId: string, clipId: string, partial: Partial<ClipLinkValues>): void;
2136
+ /** The clip of that id another track of the arrangement holds (a `<daw-clip>` the page moved here), if any. */
2137
+ private _heldElsewhere;
2119
2138
  /**
2120
2139
  * The clips of an entering track that another track of the arrangement
2121
2140
  * holds (the page moved their `<daw-clip>` here while the track waited):
2122
2141
  * the track takes the held clip as it is, and `from` names what leaves
2123
- * where. A held clip of the other kind is refused and stays.
2142
+ * where. A held clip of the other kind, or one that would overlap a clip of
2143
+ * the entering track (#859), is refused and stays.
2124
2144
  */
2125
2145
  private _takeOverMovedClips;
2126
2146
  /** Run `fn` as one undo step of each arrangement it changes. */
@@ -2221,6 +2241,12 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
2221
2241
  * function form, so the track's loading clips stay as they are (#848).
2222
2242
  */
2223
2243
  private _replaceClip;
2244
+ /**
2245
+ * A clip change that would make `clip` overlap another clip of its track
2246
+ * (#859) changes nothing and is reported with `daw-clip-error`, as a change
2247
+ * that would give it the other kind is. True when refused.
2248
+ */
2249
+ private _refusedForOverlap;
2224
2250
  private _applyClipUpdate;
2225
2251
  /**
2226
2252
  * A change to a clip still loading (#848 P10): its times, gain and name in
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost } from 'lit';
3
- import { AnnotationData, AnnotationShortcutMap, MidiNoteData, PanLaw, TrackKind, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, AudioClip, SnapTo, ColorMapValue, ClipTrack, KeyBinding, KeyboardShortcut } from '@waveform-playlist/core';
3
+ import { AnnotationData, AnnotationShortcutMap, MidiNoteData, PanLaw, TrackKind, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, SnapTo, ColorMapValue, ClipTrack, KeyBinding, KeyboardShortcut } from '@waveform-playlist/core';
4
4
  import WaveformData from 'waveform-data';
5
5
  import { Arrangement, TrackMixerValues, PlayoutAdapter, EditorEngine } from '@waveform-playlist/engine';
6
6
  import { MidiLoadOptions, MidiLoadResult } from '@dawcore/midi';
@@ -1157,13 +1157,6 @@ interface ClipEngineContract {
1157
1157
  /** Move a clip; returns the delta actually applied. One undo step. */
1158
1158
  moveClip(trackId: string, clipId: string, deltaSamples: number): number;
1159
1159
  trimClip(trackId: string, clipId: string, boundary: 'left' | 'right', deltaSamples: number): void;
1160
- /** The loaded clips of each track (a move collides with them, as `moveClip` does). */
1161
- getState(): {
1162
- tracks: readonly {
1163
- id: string;
1164
- clips: readonly AudioClip[];
1165
- }[];
1166
- };
1167
1160
  /** Get a clip's full bounds for trim constraint computation. */
1168
1161
  getClipBounds(trackId: string, clipId: string): ClipBounds | null;
1169
1162
  /** Constrain a trim delta using the engine's collision/bounds logic. */
@@ -1182,6 +1175,11 @@ interface ClipPointerHost {
1182
1175
  readonly effectiveSampleRate: number;
1183
1176
  readonly interactiveClips: boolean;
1184
1177
  readonly engine: ClipEngineContract | null;
1178
+ /**
1179
+ * The arrangement played: a move collides with its clips, loading ones
1180
+ * included, as `moveClip` does (#859), and a drag follows its changes.
1181
+ */
1182
+ readonly arrangement: Pick<Arrangement, 'getTracks' | 'subscribe'>;
1185
1183
  readonly shadowRoot: ShadowRoot | null;
1186
1184
  readonly scaleMode: 'temporal' | 'beats';
1187
1185
  readonly ticksPerPixel: number;
@@ -1209,7 +1207,11 @@ interface ClipPointerHost {
1209
1207
  * during a drag always came from outside.
1210
1208
  *
1211
1209
  * Move: the clip container's `left` follows the pointer, constrained by the
1212
- * track's other loaded clips as `moveClip` will be; one `moveClip` on release.
1210
+ * track's other clips, loading ones included, as `moveClip` will be; one
1211
+ * `moveClip` on release.
1212
+ * A change of the arrangement during a drag (audio arriving next to the clip)
1213
+ * draws the drag again from the last pointer position (#859), so a release
1214
+ * with no move after it commits what is drawn.
1213
1215
  * Trim: updates clip container CSS and peaks imperatively during drag, then
1214
1216
  * applies the cumulative delta to the engine once on release.
1215
1217
  */
@@ -1230,6 +1232,8 @@ declare class ClipPointerHandler {
1230
1232
  private _originalStartSample;
1231
1233
  private _moveClip;
1232
1234
  private _moveSorted;
1235
+ private _lastDeltaPx;
1236
+ private _stopFollowing;
1233
1237
  constructor(host: ClipPointerHost);
1234
1238
  /**
1235
1239
  * Convert a pixel delta to samples, snapping in tick space when in beats mode.
@@ -1269,8 +1273,14 @@ declare class ClipPointerHandler {
1269
1273
  * press is dropped.
1270
1274
  */
1271
1275
  private _startDrag;
1276
+ /** The dragged clip and its neighbours, read from the arrangement now. False when gone. */
1277
+ private _readMoveNeighbours;
1278
+ /** The tracks changed under the drag: draw it again from the last pointer position. */
1279
+ private _onArrangementChange;
1272
1280
  /** Processes pointermove events during an active drag. */
1273
1281
  onPointerMove(e: PointerEvent): void;
1282
+ /** Draw the drag `totalDeltaPx` from its start, constrained as the release will be. */
1283
+ private _applyDrag;
1274
1284
  /** Processes pointerup events to finalize and dispatch result events. */
1275
1285
  onPointerUp(_e: PointerEvent): void;
1276
1286
  /** Processes pointercancel — reverts the in-progress drag.
@@ -1869,6 +1879,13 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
1869
1879
  * mixer frame).
1870
1880
  */
1871
1881
  private _follow;
1882
+ /**
1883
+ * The clips the arrangement took out by itself because nothing of their
1884
+ * audio was left after their offset (#859, maintainer's choice "remove"),
1885
+ * as its change says (`removedClips`), reported with `daw-clip-error`
1886
+ * (maintainer, "a"). Their `<daw-clip>` stays on the page.
1887
+ */
1888
+ private _reportRemovedOnArrival;
1872
1889
  /**
1873
1890
  * A change to the arrangement while a drag is in progress came from
1874
1891
  * elsewhere (a drag writes nothing until its release): cancel the drag
@@ -2116,11 +2133,14 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
2116
2133
  private _taskGesture;
2117
2134
  /** @internal A property or attribute set on a live `<daw-clip>`: one undo step. */
2118
2135
  _requestClipChange(trackId: string, clipId: string, partial: Partial<ClipLinkValues>): void;
2136
+ /** The clip of that id another track of the arrangement holds (a `<daw-clip>` the page moved here), if any. */
2137
+ private _heldElsewhere;
2119
2138
  /**
2120
2139
  * The clips of an entering track that another track of the arrangement
2121
2140
  * holds (the page moved their `<daw-clip>` here while the track waited):
2122
2141
  * the track takes the held clip as it is, and `from` names what leaves
2123
- * where. A held clip of the other kind is refused and stays.
2142
+ * where. A held clip of the other kind, or one that would overlap a clip of
2143
+ * the entering track (#859), is refused and stays.
2124
2144
  */
2125
2145
  private _takeOverMovedClips;
2126
2146
  /** Run `fn` as one undo step of each arrangement it changes. */
@@ -2221,6 +2241,12 @@ declare class DawEditorElement extends LitElement implements MidiLoaderHost {
2221
2241
  * function form, so the track's loading clips stay as they are (#848).
2222
2242
  */
2223
2243
  private _replaceClip;
2244
+ /**
2245
+ * A clip change that would make `clip` overlap another clip of its track
2246
+ * (#859) changes nothing and is reported with `daw-clip-error`, as a change
2247
+ * that would give it the other kind is. True when refused.
2248
+ */
2249
+ private _refusedForOverlap;
2224
2250
  private _applyClipUpdate;
2225
2251
  /**
2226
2252
  * A change to a clip still loading (#848 P10): its times, gain and name in