@dawcore/components 0.0.39-next.6 → 0.0.39-next.8
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 +6 -6
- package/dist/index.d.mts +465 -162
- package/dist/index.d.ts +465 -162
- package/dist/index.js +2155 -1127
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2130 -1102
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -390,7 +390,7 @@ const result = await editor.loadFiles(fileList);
|
|
|
390
390
|
</script>
|
|
391
391
|
```
|
|
392
392
|
|
|
393
|
-
A recorded take has no `<daw-clip>` element; its engine clip id is the `clipId` in `daw-recording-clip-add`, and it is also on the take's entry in `editor.tracks[n].clips` (`kind: 'drop'`, `clipId`).
|
|
393
|
+
A recorded take has no `<daw-clip>` element; its engine clip id is the `clipId` in `daw-recording-clip-add`, and it is also on the take's entry in `editor.tracks[n].clips` (`kind: 'drop'`, `clipId`). `editor.tracks` reads the arrangement, so the entry is where the clip is after `updateClip()`, a drag or a trim, and it is gone when the clip goes away (`removeClip()`, undo, a later punch-in over it). Splitting a take keeps its id on the left half (#848); the right half is a new clip, listed with its own id.
|
|
394
394
|
|
|
395
395
|
`daw-recording-clip-add` is not guaranteed after every `daw-recording-complete`: it is skipped when you cancel the complete event, when peak generation for the take fails (`daw-error` with `operation: 'recording-peaks'`), and when the track was removed in the meantime.
|
|
396
396
|
|
|
@@ -498,25 +498,25 @@ Core orchestrator. Attributes:
|
|
|
498
498
|
| `eager-resume` | string | — | Resume AudioContext on first gesture; bare attribute targets the editor, or pass `"document"` / a CSS selector |
|
|
499
499
|
| `time-format` | string | `'hh:mm:ss.sss'` | Clock format read by `<daw-time-display>` / `<daw-time-format>`: `'hh:mm:ss.sss'`, `'hh:mm:ss'`, or `'seconds'` |
|
|
500
500
|
|
|
501
|
-
JS properties: `adapter` (required `PlayoutAdapter`), `recordingStream`, `bpm`, `ppqn`, `timeSignature`, `meterEntries`, `secondsToTicks` / `ticksToSeconds` (variable-tempo callbacks), `spectrogramConfig`, `spectrogramColorMap`. Read-only: `engine`, `audioContext` (from the adapter), `tracks`, `selection`, `selectedTrackId`, `currentTime`, `canUndo` / `canRedo`, `isRecording`.
|
|
501
|
+
JS properties: `adapter` (required `PlayoutAdapter`), `arrangement` (the arrangement the editor plays: its own, whose content the `<daw-track>` children declare, or one the app hands in with `editor.arrangement = createArrangement({ tracks })`, played alone until `null`; the adapter is kept across the swap), `recordingStream`, `bpm`, `ppqn`, `timeSignature`, `meterEntries`, `secondsToTicks` / `ticksToSeconds` (variable-tempo callbacks), `spectrogramConfig`, `spectrogramColorMap`. Read-only: `engine`, `audioContext` (from the adapter), `tracks`, `selection`, `selectedTrackId`, `currentTime`, `canUndo` / `canRedo`, `isRecording`.
|
|
502
502
|
|
|
503
503
|
Methods:
|
|
504
504
|
|
|
505
505
|
- Playback: `play(startTime?)`, `pause()`, `stop()`, `togglePlayPause()`, `seekTo(time)`
|
|
506
|
-
- Loading: `loadFiles(files)`, `loadMidi(urlOrFile, options?)`, `ready()`
|
|
506
|
+
- Loading: `loadFiles(files, options?)`, `loadMidi(urlOrFile, options?)`, `ready()`. `options.signal` cancels the call (an `AbortError`; what it added is taken out, with no undo step)
|
|
507
507
|
- Display: `setTimeFormat(format)` — sugar over the `timeFormat` property, fires `daw-time-format-change`
|
|
508
|
-
- Tracks & clips: `addTrack(config)`, `removeTrack(id)`, `updateTrack(id, partial)`, `addClip(trackId, config)`, `removeClip(trackId, clipId)`, `updateClip(trackId, clipId, partial)`
|
|
508
|
+
- Tracks & clips: `addTrack(config, options?)`, `removeTrack(id)`, `updateTrack(id, partial)`, `reorderTrack(id, toIndex)`, `addClip(trackId, config, options?)`, `removeClip(trackId, clipId)`, `updateClip(trackId, clipId, partial)`. They are calls on `editor.arrangement`: `addTrack` and `addClip` create no element, `updateTrack` / `updateClip` / `reorderTrack` write and move no element, and `removeTrack` / `removeClip` remove the element when there is one
|
|
509
509
|
- Editing: `splitAtPlayhead()`, `undo()`, `redo()`, `setSelection(start, end)`
|
|
510
510
|
- Recording: `startRecording(stream?, options?)`, `stopRecording()`, `pauseRecording()`, `resumeRecording()`, `togglePauseRecording()`. Options include `overdub` (start playback with the take), `latencyOffset` (seconds), and `clipName` (live-preview header + finalized clip name, default `"Recording"`)
|
|
511
511
|
- Effects & export: the master-chain effects API (see [Effects](#effects)), `getEffectsState()` / `setEffectsState(entries)`, `openEffectGui()` / `closeEffectGui()`, `exportAudio(options?)`
|
|
512
512
|
|
|
513
513
|
### `<daw-track>`
|
|
514
514
|
|
|
515
|
-
Declarative track data. Attributes: `src`, `name`, `volume`, `pan`, `muted`, `soloed`, `kind` (`'audio' | 'midi'`, default `'audio'`: what the track holds; set it before the track is added), `render-mode` (`'waveform' | 'spectrogram'`, default `'waveform'`: how an audio track is drawn; a MIDI track is always a piano roll). JS property: `spectrogramConfig` (per-track spectrogram override). Also exposes the per-track effects API (see [Effects](#effects)).
|
|
515
|
+
Declarative track data. Attributes: `src`, `name`, `volume`, `pan`, `muted`, `soloed`, `kind` (`'audio' | 'midi'`, default `'audio'`: what the track holds; set it before the track is added), `render-mode` (`'waveform' | 'spectrogram'`, default `'waveform'`: how an audio track is drawn; a MIDI track is always a piano roll). JS property: `spectrogramConfig` (per-track spectrogram override). Also exposes the per-track effects API (see [Effects](#effects)). The attributes are the declaration and are never written by the editor; the properties `name`, `volume`, `pan`, `muted` and `soloed` read the arrangement live (after an Undo they show the restored values), and setting one, or changing its attribute, is one undo step. `index` is the track's position in the arrangement. An element whose track left the arrangement (an Undo of its arrival, a removal made on the arrangement) or that waits while a handed-in arrangement is set is detached: `:state(detached)` in CSS, its properties read the declaration, and a change warns and does nothing. Moving a `<daw-track>` in the DOM reorders the track; an Undo moves no element. Fires `daw-track-update` `{ trackId, changed }` after a property changes. Loading does not clear the undo history.
|
|
516
516
|
|
|
517
517
|
### `<daw-clip>`
|
|
518
518
|
|
|
519
|
-
Declarative clip data. Attributes: `src`, `peaks-src`, `start`, `duration`, `offset`, `gain`, `name`, `color`, `midi-channel`, `midi-program`. JS-only property: `midiNotes: MidiNoteData[] | null` (note arrays are too large for attributes).
|
|
519
|
+
Declarative clip data. Attributes: `src`, `peaks-src`, `start`, `duration`, `offset`, `gain`, `name`, `color`, `fade-in`, `fade-out`, `fade-type`, `midi-channel`, `midi-program`. JS-only property: `midiNotes: MidiNoteData[] | null` (note arrays are too large for attributes). `start`, `duration`, `offset`, `gain`, `name` and the MIDI fields read the arrangement live (after a drag, `clipEl.start` is where the clip is; the attribute keeps what the page wrote), and setting one is one undo step. A split keeps the clip's id on its left half, so the element follows it.
|
|
520
520
|
|
|
521
521
|
### `<daw-piano-roll>`
|
|
522
522
|
|