@waveform-playlist/browser 17.0.0-next.6 → 17.0.0-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 +5 -5
- package/dist/index.d.mts +51 -52
- package/dist/index.d.ts +51 -52
- package/dist/index.js +180 -181
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +179 -180
- package/dist/index.mjs.map +1 -1
- package/dist/tone.js +2 -2
- package/dist/tone.js.map +1 -1
- package/dist/tone.mjs +2 -2
- package/dist/tone.mjs.map +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ React components, hooks, and context providers for building a multitrack Web Aud
|
|
|
10
10
|
- **Split context providers** — `WaveformPlaylistProvider` (multitrack, Tone.js-backed) and `MediaElementPlaylistProvider` (single-track, `<audio>`-backed with pitch-preserving playback rate)
|
|
11
11
|
- **Focused context hooks** — one hook per group of fields that change together (`useIsPlaying`, `useCurrentTime`, `useSelection`, `useAnnotations`, `usePlaybackControls`, `usePlaybackRefs`, `usePlaylistView`, `usePlaylistTimeline`, `usePlaylistMixer`, `useLoop`, `useEditorControls` and more), so a component re-renders only for the group it reads, not on every pointer move, slider step or annotation boundary
|
|
12
12
|
- **Audio effects** — 20 Tone.js effects (reverb, delay, modulation, filter, distortion, dynamics, spatial) with runtime parameter control, master and per-track chains, plus WAM 2.0 plugin hosting
|
|
13
|
-
- **Recording** — pairs with `@waveform-playlist/recording` for mic input, overdubbing, and live waveform preview; punch-in takes replace overlapped content, and `useRecordingSession({ isRecording, trackId })` (or `setRecordingActive(active,
|
|
13
|
+
- **Recording** — pairs with `@waveform-playlist/recording` for mic input, overdubbing, and live waveform preview; punch-in takes replace overlapped content, and `useRecordingSession({ isRecording, trackId })` (or `setRecordingActive(active, recordingTrackId)` directly) suppresses the end-of-timeline auto-stop and mutes the recorded-over track for the take (its Mute button shows it and is disabled; the track's own mute is not changed, so a mute set during the take stays)
|
|
14
14
|
- **Annotations & spectrogram** — optional integration contexts for `@waveform-playlist/annotations` and `@waveform-playlist/spectrogram`. Under either provider, `<WaveformAnnotationBoxes>` (a part of the view; it wires the drag of the box edges itself) and `<AnnotationList>` (the text list, anywhere under the provider) draw the annotations
|
|
15
15
|
- **WAV export** — render the full mix (including effects) offline to a downloadable WAV file
|
|
16
16
|
- **MediaElement player mode** — a lightweight single-track player with pitch-preserving speed control, for podcast/audiobook-style use cases that don't need multitrack mixing
|
|
@@ -104,12 +104,12 @@ Under either provider:
|
|
|
104
104
|
| Hook | Exposes | Re-renders on |
|
|
105
105
|
|------|---------|---------------|
|
|
106
106
|
| `useArrangement` | The provider's `Arrangement`: change the tracks through it | never |
|
|
107
|
-
| `useEditorControls` | Actions — track mute/solo/volume/pan (by track id), track order, zoom, loop, undo/redo (on the arrangement, engine or not), `setRecordingActive` (recording-session suppression +
|
|
107
|
+
| `useEditorControls` | Actions — track mute/solo/volume/pan (by track id; each an undo step, `{ gesture }` makes a slider drag one), track order, zoom, loop, undo/redo (on the arrangement, engine or not), `setRecordingActive` (recording-session suppression + the take's mute on the recorded track) | never |
|
|
108
108
|
| `useEngineRefs` | `playoutRef` (the engine), `getPlaybackTime()`, `getAudioContextTime()`, `getLookAhead()`, `getOutputLatency()`, `playbackStartTimeRef`, `audioStartPositionRef` | never |
|
|
109
109
|
| `usePlaylistTimeline` | `tracks` (loaded clips only, read-only), `peaksDataArray` (with placeholder records for clips still loading), `duration` (loaded audio), `isReady` | every clip operation (a trim once, on release), a zoom (`peaksDataArray` is computed per zoom level), audio or peaks arriving, `isReady` changing |
|
|
110
|
-
| `usePlaylistMixer` | `trackStates` (one entry per track in the order of `tracks`, also while a track loads), `masterVolume` | every mute, solo, volume or pan change (each step of a slider drag); tracks added, removed, renamed or reordered |
|
|
111
|
-
| `useTrack` | Among the children of `<WaveformTrackControls>` only: the track whose panel is being drawn (id, name, mixer state, `isSelected`, `
|
|
112
|
-
| `useTrackReorderPreview` | `trackDragPreview
|
|
110
|
+
| `usePlaylistMixer` | `trackStates` (one entry per track in the order of `tracks`, also while a track loads), `masterVolume` | every mute, solo, volume or pan change (each step of a slider drag, an undo or a redo of one); a take starting or ending on a track; tracks added, removed, renamed or reordered |
|
|
111
|
+
| `useTrack` | Among the children of `<WaveformTrackControls>` only: the track whose panel is being drawn (id, name, mixer state, `isSelected`, `isRecording`) and actions bound to it (`setMuted`, `setVolume`, `moveUp`, …) | a change of that track's state, position or selection |
|
|
112
|
+
| `useTrackReorderPreview` | `trackDragPreview` | every drag-over of a track reorder |
|
|
113
113
|
| `useLoop` | `isLoopEnabled`, `loopStart`, `loopEnd` | a loop change |
|
|
114
114
|
| `useSelectedTrackId` | `selectedTrackId` | another track being selected |
|
|
115
115
|
| `useUndoRedo` | `canUndo`, `canRedo` | after an edit |
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { ReactNode, RefObject } from 'react';
|
|
3
3
|
import { EffectsFunction, TrackEffectsFunction, SoundFontCache } from '@waveform-playlist/playout';
|
|
4
|
-
import { PlaylistEngine, Arrangement, PlayoutAdapter, EngineState, LoadSource, ArrangementSourcesValue } from '@waveform-playlist/engine';
|
|
4
|
+
import { MixerChangeOptions, PlaylistEngine, Arrangement, PlayoutAdapter, EngineState, LoadSource, ArrangementSourcesValue } from '@waveform-playlist/engine';
|
|
5
5
|
import { ValueSourceHandle, AnnotationData, AnnotationStore, ClipTrack, PeakData, Fade, MidiNoteData, WaveformDataObject, KeyboardShortcut, ArrangementTrack, AnnotationStoreOptions, RecordingProgressSource, AnnotationAction, RenderAnnotationItemProps, TrackKind, RenderMode, AnnotationActionOptions, TrackSpectrogramOverrides, SpectrogramConfig, ColorMapValue, SpectrogramCanvasRegistration } from '@waveform-playlist/core';
|
|
6
6
|
import { TimeFormat, WaveformPlaylistTheme, RenderPlayheadFunction, TrackMenuItem, BeatsAndBarsSnapTo } from '@waveform-playlist/ui-components';
|
|
7
7
|
import { FadeConfig, MediaElementPlayout } from '@waveform-playlist/media-element-playout';
|
|
@@ -284,20 +284,14 @@ interface EditorControlsContextValue {
|
|
|
284
284
|
* from a control; this is for the view's own press and drag handling.
|
|
285
285
|
*/
|
|
286
286
|
setCurrentTime: (time: number) => void;
|
|
287
|
-
setTrackMute: (trackId: string, muted: boolean) => void;
|
|
288
|
-
setTrackSolo: (trackId: string, soloed: boolean) => void;
|
|
289
|
-
setTrackVolume: (trackId: string, volume: number) => void;
|
|
290
|
-
setTrackPan: (trackId: string, pan: number) => void;
|
|
287
|
+
setTrackMute: (trackId: string, muted: boolean, options?: MixerChangeOptions) => void;
|
|
288
|
+
setTrackSolo: (trackId: string, soloed: boolean, options?: MixerChangeOptions) => void;
|
|
289
|
+
setTrackVolume: (trackId: string, volume: number, options?: MixerChangeOptions) => void;
|
|
290
|
+
setTrackPan: (trackId: string, pan: number, options?: MixerChangeOptions) => void;
|
|
291
291
|
/** Move a track to a new index in the vertical track order. Purely
|
|
292
292
|
* organizational — playback is not interrupted. An undo step of the
|
|
293
293
|
* arrangement (#812). */
|
|
294
294
|
reorderTrack: (trackId: string, toIndex: number) => void;
|
|
295
|
-
/** Internal: call after every track-reorder DRAG interaction ends
|
|
296
|
-
* (committed or canceled) to force the view's track-controls part to remount
|
|
297
|
-
* its slots, discarding any @dnd-kit sortable-plugin DOM
|
|
298
|
-
* corruption. Not needed for button-driven reorderTrack calls (they never
|
|
299
|
-
* touch dnd-kit's DOM). See bumpTrackReorderEpoch in the provider. */
|
|
300
|
-
bumpTrackReorderEpoch: () => void;
|
|
301
295
|
/** INTERNAL wiring for ClipInteractionProvider: publishes/clears the live
|
|
302
296
|
* track-reorder drag preview. Custom drag integrations may call it, but
|
|
303
297
|
* most consumers only ever READ trackDragPreview from useTrackReorderPreview(). */
|
|
@@ -314,18 +308,21 @@ interface EditorControlsContextValue {
|
|
|
314
308
|
redo: () => void;
|
|
315
309
|
/** Mark a recording session active/inactive. While active: (1) the
|
|
316
310
|
* end-of-audio auto-stop is suppressed so overdub playback runs past the
|
|
317
|
-
* end of existing material, and (2) with
|
|
318
|
-
*
|
|
319
|
-
* recording replaces whatever the
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
|
|
311
|
+
* end of existing material, and (2) with a `recordingTrackId`, that track
|
|
312
|
+
* is marked in the arrangement as the one the take is recording onto
|
|
313
|
+
* (`setTrackRecording`, #843): punch-in recording replaces whatever the
|
|
314
|
+
* take overlaps (#579), so the doomed material must not play under the
|
|
315
|
+
* overdub. The take's mute plays the track muted and is no undo step.
|
|
316
|
+
* `trackStates` and the track's Mute button show it muted, the built-in
|
|
317
|
+
* `<TrackMuteButton />` of that track is disabled, and
|
|
318
|
+
* `useTrack().isRecording` is true for it, while
|
|
319
|
+
* `arrangement.getMixer()` keeps the track's own mute: nothing is written
|
|
320
|
+
* to it, so a mute changed during the take stays after it. One track is
|
|
321
|
+
* recorded onto at a time: naming one clears any other, and
|
|
322
|
+
* `setRecordingActive(false)` clears every track. `useRecordingSession`
|
|
323
|
+
* calls it for the length of a take; overdub flows should also call it
|
|
324
|
+
* eagerly (before `play()`). */
|
|
325
|
+
setRecordingActive: (active: boolean, recordingTrackId?: string | null) => void;
|
|
329
326
|
}
|
|
330
327
|
/**
|
|
331
328
|
* Refs and functions of the multitrack engine (#688). Like
|
|
@@ -407,11 +404,6 @@ interface TrackReorderPreviewContextValue {
|
|
|
407
404
|
* layout from it; a track's panel can read it to mirror the preview in
|
|
408
405
|
* its own UI. */
|
|
409
406
|
trackDragPreview: TrackDragPreview | null;
|
|
410
|
-
/** Internal: incremented after every track-reorder drag interaction ends.
|
|
411
|
-
* The view's track-controls part folds this into each slot's `key` to
|
|
412
|
-
* force a remount, working around @dnd-kit sortable-plugin DOM corruption
|
|
413
|
-
* (see bumpTrackReorderEpoch in EditorControlsContextValue). */
|
|
414
|
-
trackReorderEpoch: number;
|
|
415
407
|
}
|
|
416
408
|
/** The playback speed and its setter (#688). Changes when the speed does. */
|
|
417
409
|
interface PlaybackRateContextValue {
|
|
@@ -529,7 +521,7 @@ declare const usePlaylistTimeline: () => PlaylistTimelineContextValue;
|
|
|
529
521
|
*/
|
|
530
522
|
declare const usePlaylistMixer: () => PlaylistMixerContextValue;
|
|
531
523
|
/**
|
|
532
|
-
* `{ trackDragPreview
|
|
524
|
+
* `{ trackDragPreview }`. A component that calls this
|
|
533
525
|
* re-renders on every drag-over of a track reorder.
|
|
534
526
|
*/
|
|
535
527
|
declare const useTrackReorderPreview: () => TrackReorderPreviewContextValue;
|
|
@@ -586,6 +578,7 @@ type TrackClipPeaks = ClipPeaks[];
|
|
|
586
578
|
|
|
587
579
|
interface TrackState {
|
|
588
580
|
name: string;
|
|
581
|
+
/** The track's own mute, or true while a take is recording onto it (#843). */
|
|
589
582
|
muted: boolean;
|
|
590
583
|
soloed: boolean;
|
|
591
584
|
volume: number;
|
|
@@ -1745,8 +1738,9 @@ declare const DefaultTrackControls: react__default.MemoExoticComponent<typeof De
|
|
|
1745
1738
|
declare const TrackName: react__default.FC;
|
|
1746
1739
|
/**
|
|
1747
1740
|
* Mutes and unmutes the track. Disabled while a take is recorded onto the
|
|
1748
|
-
* track (`useTrack().
|
|
1749
|
-
*
|
|
1741
|
+
* track (`useTrack().isRecording`): the take plays the track muted and
|
|
1742
|
+
* the button shows it pressed, so a click would set the track's own mute
|
|
1743
|
+
* from the take's mute (#812, #843).
|
|
1750
1744
|
*/
|
|
1751
1745
|
declare const TrackMuteButton: react__default.FC;
|
|
1752
1746
|
/** Solos and unsolos the track. */
|
|
@@ -1788,6 +1782,7 @@ interface TrackContextValue {
|
|
|
1788
1782
|
index: number;
|
|
1789
1783
|
/** The track's name, or "Track N" (N is the position, from 1) when it has none and while it is loading. */
|
|
1790
1784
|
name: string;
|
|
1785
|
+
/** The track's own mute, or true while a take is recording onto it (`isRecording`). */
|
|
1791
1786
|
muted: boolean;
|
|
1792
1787
|
soloed: boolean;
|
|
1793
1788
|
/** 0 to 1. */
|
|
@@ -1807,16 +1802,18 @@ interface TrackContextValue {
|
|
|
1807
1802
|
hasSpectrogram: boolean;
|
|
1808
1803
|
/**
|
|
1809
1804
|
* True while a take is being recorded onto this track (`setRecordingActive`,
|
|
1810
|
-
* `useRecordingSession`). The track
|
|
1811
|
-
*
|
|
1812
|
-
*
|
|
1813
|
-
*
|
|
1805
|
+
* `useRecordingSession`). The track plays muted for the take and `muted` is
|
|
1806
|
+
* true, while the track's own mute (`arrangement.getMixer()`) is not
|
|
1807
|
+
* changed by the take: a mute set meanwhile stays after it (#843). The
|
|
1808
|
+
* built-in `<TrackMuteButton />` is disabled while this is true; an app's
|
|
1809
|
+
* own mute control can do the same, since toggling from `muted` here would
|
|
1810
|
+
* set the track's own mute from the take's mute.
|
|
1814
1811
|
*/
|
|
1815
|
-
|
|
1816
|
-
setMuted: (muted: boolean) => void;
|
|
1817
|
-
setSoloed: (soloed: boolean) => void;
|
|
1818
|
-
setVolume: (volume: number) => void;
|
|
1819
|
-
setPan: (pan: number) => void;
|
|
1812
|
+
isRecording: boolean;
|
|
1813
|
+
setMuted: (muted: boolean, options?: MixerChangeOptions) => void;
|
|
1814
|
+
setSoloed: (soloed: boolean, options?: MixerChangeOptions) => void;
|
|
1815
|
+
setVolume: (volume: number, options?: MixerChangeOptions) => void;
|
|
1816
|
+
setPan: (pan: number, options?: MixerChangeOptions) => void;
|
|
1820
1817
|
/** Makes this the selected track. */
|
|
1821
1818
|
select: () => void;
|
|
1822
1819
|
/** Moves the track one position up. Nothing happens for the first track. */
|
|
@@ -1849,7 +1846,8 @@ interface TrackReorderHandle {
|
|
|
1849
1846
|
* calls for one track register the same sortable id twice.
|
|
1850
1847
|
*
|
|
1851
1848
|
* The item that moves is the slot `<WaveformTrackControls>` draws around the
|
|
1852
|
-
* panel
|
|
1849
|
+
* panel (the keyed element React reorders, #796), not an element of the
|
|
1850
|
+
* caller. The per-source modifiers REPLACE the
|
|
1853
1851
|
* provider's clip modifiers for this operation, so track drags are
|
|
1854
1852
|
* vertical-only and skip clip collision and snap. Data kind 'track-reorder'
|
|
1855
1853
|
* is the discriminator the shared drag handlers branch on.
|
|
@@ -1865,20 +1863,21 @@ interface RecordingSessionOptions {
|
|
|
1865
1863
|
/**
|
|
1866
1864
|
* Tells the playlist that a take is being recorded into a track, for as long
|
|
1867
1865
|
* as `isRecording` is true (#685). The provider then keeps playback running
|
|
1868
|
-
* past the end of the audio and
|
|
1869
|
-
* the take
|
|
1870
|
-
*
|
|
1871
|
-
*
|
|
1872
|
-
*
|
|
1873
|
-
*
|
|
1874
|
-
*
|
|
1875
|
-
*
|
|
1876
|
-
*
|
|
1877
|
-
*
|
|
1866
|
+
* past the end of the audio and marks the track in the arrangement as the
|
|
1867
|
+
* one the take is recording onto (`setTrackRecording`, #843), which plays it
|
|
1868
|
+
* muted for the take, so what it already holds does not play under a
|
|
1869
|
+
* punch-in that replaces it (`trackStates` shows the track muted, its
|
|
1870
|
+
* built-in Mute button is disabled and `useTrack().isRecording` is true).
|
|
1871
|
+
* The track's own mute is not written, so a mute changed during the take
|
|
1872
|
+
* stays after it. The take's mute is cleared when the take ends, the track
|
|
1873
|
+
* changes or the component unmounts; the provider also clears it in its own
|
|
1874
|
+
* cleanup (its unmount or an `<Activity>` hide) while a track is still
|
|
1875
|
+
* recording. An `<Activity>` hide of the component ends the session the same
|
|
1876
|
+
* way, and the reveal mutes the track again.
|
|
1878
1877
|
*
|
|
1879
1878
|
* Call it in the component that calls `useIntegratedRecording`, under
|
|
1880
1879
|
* `WaveformPlaylistProvider`. `<WaveformRecordingPreview>` only draws the
|
|
1881
|
-
* take: without this hook the
|
|
1880
|
+
* take: without this hook the track is not muted for the take and plays as it is.
|
|
1882
1881
|
*
|
|
1883
1882
|
* A handler that starts playback together with the recording should also call
|
|
1884
1883
|
* `setRecordingActive(true, trackId)` (from `useEditorControls()`) before
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { ReactNode, RefObject } from 'react';
|
|
3
3
|
import { EffectsFunction, TrackEffectsFunction, SoundFontCache } from '@waveform-playlist/playout';
|
|
4
|
-
import { PlaylistEngine, Arrangement, PlayoutAdapter, EngineState, LoadSource, ArrangementSourcesValue } from '@waveform-playlist/engine';
|
|
4
|
+
import { MixerChangeOptions, PlaylistEngine, Arrangement, PlayoutAdapter, EngineState, LoadSource, ArrangementSourcesValue } from '@waveform-playlist/engine';
|
|
5
5
|
import { ValueSourceHandle, AnnotationData, AnnotationStore, ClipTrack, PeakData, Fade, MidiNoteData, WaveformDataObject, KeyboardShortcut, ArrangementTrack, AnnotationStoreOptions, RecordingProgressSource, AnnotationAction, RenderAnnotationItemProps, TrackKind, RenderMode, AnnotationActionOptions, TrackSpectrogramOverrides, SpectrogramConfig, ColorMapValue, SpectrogramCanvasRegistration } from '@waveform-playlist/core';
|
|
6
6
|
import { TimeFormat, WaveformPlaylistTheme, RenderPlayheadFunction, TrackMenuItem, BeatsAndBarsSnapTo } from '@waveform-playlist/ui-components';
|
|
7
7
|
import { FadeConfig, MediaElementPlayout } from '@waveform-playlist/media-element-playout';
|
|
@@ -284,20 +284,14 @@ interface EditorControlsContextValue {
|
|
|
284
284
|
* from a control; this is for the view's own press and drag handling.
|
|
285
285
|
*/
|
|
286
286
|
setCurrentTime: (time: number) => void;
|
|
287
|
-
setTrackMute: (trackId: string, muted: boolean) => void;
|
|
288
|
-
setTrackSolo: (trackId: string, soloed: boolean) => void;
|
|
289
|
-
setTrackVolume: (trackId: string, volume: number) => void;
|
|
290
|
-
setTrackPan: (trackId: string, pan: number) => void;
|
|
287
|
+
setTrackMute: (trackId: string, muted: boolean, options?: MixerChangeOptions) => void;
|
|
288
|
+
setTrackSolo: (trackId: string, soloed: boolean, options?: MixerChangeOptions) => void;
|
|
289
|
+
setTrackVolume: (trackId: string, volume: number, options?: MixerChangeOptions) => void;
|
|
290
|
+
setTrackPan: (trackId: string, pan: number, options?: MixerChangeOptions) => void;
|
|
291
291
|
/** Move a track to a new index in the vertical track order. Purely
|
|
292
292
|
* organizational — playback is not interrupted. An undo step of the
|
|
293
293
|
* arrangement (#812). */
|
|
294
294
|
reorderTrack: (trackId: string, toIndex: number) => void;
|
|
295
|
-
/** Internal: call after every track-reorder DRAG interaction ends
|
|
296
|
-
* (committed or canceled) to force the view's track-controls part to remount
|
|
297
|
-
* its slots, discarding any @dnd-kit sortable-plugin DOM
|
|
298
|
-
* corruption. Not needed for button-driven reorderTrack calls (they never
|
|
299
|
-
* touch dnd-kit's DOM). See bumpTrackReorderEpoch in the provider. */
|
|
300
|
-
bumpTrackReorderEpoch: () => void;
|
|
301
295
|
/** INTERNAL wiring for ClipInteractionProvider: publishes/clears the live
|
|
302
296
|
* track-reorder drag preview. Custom drag integrations may call it, but
|
|
303
297
|
* most consumers only ever READ trackDragPreview from useTrackReorderPreview(). */
|
|
@@ -314,18 +308,21 @@ interface EditorControlsContextValue {
|
|
|
314
308
|
redo: () => void;
|
|
315
309
|
/** Mark a recording session active/inactive. While active: (1) the
|
|
316
310
|
* end-of-audio auto-stop is suppressed so overdub playback runs past the
|
|
317
|
-
* end of existing material, and (2) with
|
|
318
|
-
*
|
|
319
|
-
* recording replaces whatever the
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
|
|
311
|
+
* end of existing material, and (2) with a `recordingTrackId`, that track
|
|
312
|
+
* is marked in the arrangement as the one the take is recording onto
|
|
313
|
+
* (`setTrackRecording`, #843): punch-in recording replaces whatever the
|
|
314
|
+
* take overlaps (#579), so the doomed material must not play under the
|
|
315
|
+
* overdub. The take's mute plays the track muted and is no undo step.
|
|
316
|
+
* `trackStates` and the track's Mute button show it muted, the built-in
|
|
317
|
+
* `<TrackMuteButton />` of that track is disabled, and
|
|
318
|
+
* `useTrack().isRecording` is true for it, while
|
|
319
|
+
* `arrangement.getMixer()` keeps the track's own mute: nothing is written
|
|
320
|
+
* to it, so a mute changed during the take stays after it. One track is
|
|
321
|
+
* recorded onto at a time: naming one clears any other, and
|
|
322
|
+
* `setRecordingActive(false)` clears every track. `useRecordingSession`
|
|
323
|
+
* calls it for the length of a take; overdub flows should also call it
|
|
324
|
+
* eagerly (before `play()`). */
|
|
325
|
+
setRecordingActive: (active: boolean, recordingTrackId?: string | null) => void;
|
|
329
326
|
}
|
|
330
327
|
/**
|
|
331
328
|
* Refs and functions of the multitrack engine (#688). Like
|
|
@@ -407,11 +404,6 @@ interface TrackReorderPreviewContextValue {
|
|
|
407
404
|
* layout from it; a track's panel can read it to mirror the preview in
|
|
408
405
|
* its own UI. */
|
|
409
406
|
trackDragPreview: TrackDragPreview | null;
|
|
410
|
-
/** Internal: incremented after every track-reorder drag interaction ends.
|
|
411
|
-
* The view's track-controls part folds this into each slot's `key` to
|
|
412
|
-
* force a remount, working around @dnd-kit sortable-plugin DOM corruption
|
|
413
|
-
* (see bumpTrackReorderEpoch in EditorControlsContextValue). */
|
|
414
|
-
trackReorderEpoch: number;
|
|
415
407
|
}
|
|
416
408
|
/** The playback speed and its setter (#688). Changes when the speed does. */
|
|
417
409
|
interface PlaybackRateContextValue {
|
|
@@ -529,7 +521,7 @@ declare const usePlaylistTimeline: () => PlaylistTimelineContextValue;
|
|
|
529
521
|
*/
|
|
530
522
|
declare const usePlaylistMixer: () => PlaylistMixerContextValue;
|
|
531
523
|
/**
|
|
532
|
-
* `{ trackDragPreview
|
|
524
|
+
* `{ trackDragPreview }`. A component that calls this
|
|
533
525
|
* re-renders on every drag-over of a track reorder.
|
|
534
526
|
*/
|
|
535
527
|
declare const useTrackReorderPreview: () => TrackReorderPreviewContextValue;
|
|
@@ -586,6 +578,7 @@ type TrackClipPeaks = ClipPeaks[];
|
|
|
586
578
|
|
|
587
579
|
interface TrackState {
|
|
588
580
|
name: string;
|
|
581
|
+
/** The track's own mute, or true while a take is recording onto it (#843). */
|
|
589
582
|
muted: boolean;
|
|
590
583
|
soloed: boolean;
|
|
591
584
|
volume: number;
|
|
@@ -1745,8 +1738,9 @@ declare const DefaultTrackControls: react__default.MemoExoticComponent<typeof De
|
|
|
1745
1738
|
declare const TrackName: react__default.FC;
|
|
1746
1739
|
/**
|
|
1747
1740
|
* Mutes and unmutes the track. Disabled while a take is recorded onto the
|
|
1748
|
-
* track (`useTrack().
|
|
1749
|
-
*
|
|
1741
|
+
* track (`useTrack().isRecording`): the take plays the track muted and
|
|
1742
|
+
* the button shows it pressed, so a click would set the track's own mute
|
|
1743
|
+
* from the take's mute (#812, #843).
|
|
1750
1744
|
*/
|
|
1751
1745
|
declare const TrackMuteButton: react__default.FC;
|
|
1752
1746
|
/** Solos and unsolos the track. */
|
|
@@ -1788,6 +1782,7 @@ interface TrackContextValue {
|
|
|
1788
1782
|
index: number;
|
|
1789
1783
|
/** The track's name, or "Track N" (N is the position, from 1) when it has none and while it is loading. */
|
|
1790
1784
|
name: string;
|
|
1785
|
+
/** The track's own mute, or true while a take is recording onto it (`isRecording`). */
|
|
1791
1786
|
muted: boolean;
|
|
1792
1787
|
soloed: boolean;
|
|
1793
1788
|
/** 0 to 1. */
|
|
@@ -1807,16 +1802,18 @@ interface TrackContextValue {
|
|
|
1807
1802
|
hasSpectrogram: boolean;
|
|
1808
1803
|
/**
|
|
1809
1804
|
* True while a take is being recorded onto this track (`setRecordingActive`,
|
|
1810
|
-
* `useRecordingSession`). The track
|
|
1811
|
-
*
|
|
1812
|
-
*
|
|
1813
|
-
*
|
|
1805
|
+
* `useRecordingSession`). The track plays muted for the take and `muted` is
|
|
1806
|
+
* true, while the track's own mute (`arrangement.getMixer()`) is not
|
|
1807
|
+
* changed by the take: a mute set meanwhile stays after it (#843). The
|
|
1808
|
+
* built-in `<TrackMuteButton />` is disabled while this is true; an app's
|
|
1809
|
+
* own mute control can do the same, since toggling from `muted` here would
|
|
1810
|
+
* set the track's own mute from the take's mute.
|
|
1814
1811
|
*/
|
|
1815
|
-
|
|
1816
|
-
setMuted: (muted: boolean) => void;
|
|
1817
|
-
setSoloed: (soloed: boolean) => void;
|
|
1818
|
-
setVolume: (volume: number) => void;
|
|
1819
|
-
setPan: (pan: number) => void;
|
|
1812
|
+
isRecording: boolean;
|
|
1813
|
+
setMuted: (muted: boolean, options?: MixerChangeOptions) => void;
|
|
1814
|
+
setSoloed: (soloed: boolean, options?: MixerChangeOptions) => void;
|
|
1815
|
+
setVolume: (volume: number, options?: MixerChangeOptions) => void;
|
|
1816
|
+
setPan: (pan: number, options?: MixerChangeOptions) => void;
|
|
1820
1817
|
/** Makes this the selected track. */
|
|
1821
1818
|
select: () => void;
|
|
1822
1819
|
/** Moves the track one position up. Nothing happens for the first track. */
|
|
@@ -1849,7 +1846,8 @@ interface TrackReorderHandle {
|
|
|
1849
1846
|
* calls for one track register the same sortable id twice.
|
|
1850
1847
|
*
|
|
1851
1848
|
* The item that moves is the slot `<WaveformTrackControls>` draws around the
|
|
1852
|
-
* panel
|
|
1849
|
+
* panel (the keyed element React reorders, #796), not an element of the
|
|
1850
|
+
* caller. The per-source modifiers REPLACE the
|
|
1853
1851
|
* provider's clip modifiers for this operation, so track drags are
|
|
1854
1852
|
* vertical-only and skip clip collision and snap. Data kind 'track-reorder'
|
|
1855
1853
|
* is the discriminator the shared drag handlers branch on.
|
|
@@ -1865,20 +1863,21 @@ interface RecordingSessionOptions {
|
|
|
1865
1863
|
/**
|
|
1866
1864
|
* Tells the playlist that a take is being recorded into a track, for as long
|
|
1867
1865
|
* as `isRecording` is true (#685). The provider then keeps playback running
|
|
1868
|
-
* past the end of the audio and
|
|
1869
|
-
* the take
|
|
1870
|
-
*
|
|
1871
|
-
*
|
|
1872
|
-
*
|
|
1873
|
-
*
|
|
1874
|
-
*
|
|
1875
|
-
*
|
|
1876
|
-
*
|
|
1877
|
-
*
|
|
1866
|
+
* past the end of the audio and marks the track in the arrangement as the
|
|
1867
|
+
* one the take is recording onto (`setTrackRecording`, #843), which plays it
|
|
1868
|
+
* muted for the take, so what it already holds does not play under a
|
|
1869
|
+
* punch-in that replaces it (`trackStates` shows the track muted, its
|
|
1870
|
+
* built-in Mute button is disabled and `useTrack().isRecording` is true).
|
|
1871
|
+
* The track's own mute is not written, so a mute changed during the take
|
|
1872
|
+
* stays after it. The take's mute is cleared when the take ends, the track
|
|
1873
|
+
* changes or the component unmounts; the provider also clears it in its own
|
|
1874
|
+
* cleanup (its unmount or an `<Activity>` hide) while a track is still
|
|
1875
|
+
* recording. An `<Activity>` hide of the component ends the session the same
|
|
1876
|
+
* way, and the reveal mutes the track again.
|
|
1878
1877
|
*
|
|
1879
1878
|
* Call it in the component that calls `useIntegratedRecording`, under
|
|
1880
1879
|
* `WaveformPlaylistProvider`. `<WaveformRecordingPreview>` only draws the
|
|
1881
|
-
* take: without this hook the
|
|
1880
|
+
* take: without this hook the track is not muted for the take and plays as it is.
|
|
1882
1881
|
*
|
|
1883
1882
|
* A handler that starts playback together with the recording should also call
|
|
1884
1883
|
* `setRecordingActive(true, trackId)` (from `useEditorControls()`) before
|