@waveform-playlist/playout 8.0.0 → 8.1.0
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 +48 -11
- package/dist/index.d.ts +48 -11
- package/dist/index.js +349 -172
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +369 -185
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -20,35 +20,67 @@ interface ToneTrackOptions {
|
|
|
20
20
|
destination?: ToneAudioNode;
|
|
21
21
|
}
|
|
22
22
|
declare class ToneTrack {
|
|
23
|
-
private
|
|
23
|
+
private scheduledClips;
|
|
24
|
+
private activeSources;
|
|
24
25
|
private volumeNode;
|
|
25
26
|
private panNode;
|
|
26
27
|
private muteGain;
|
|
27
28
|
private track;
|
|
28
29
|
private effectsCleanup?;
|
|
29
|
-
private
|
|
30
|
-
private activePlayers;
|
|
30
|
+
private _scheduleGuardOffset;
|
|
31
31
|
constructor(options: ToneTrackOptions);
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Create and start an AudioBufferSourceNode for a clip.
|
|
34
|
+
* Sources are one-shot: each play or loop iteration creates a fresh one.
|
|
35
|
+
*/
|
|
36
|
+
private startClipSource;
|
|
37
|
+
/**
|
|
38
|
+
* Set the schedule guard offset. Schedule callbacks for clips before this
|
|
39
|
+
* offset are suppressed (already handled by startMidClipSources).
|
|
40
|
+
* Must be called before transport.start() and in the loop handler.
|
|
41
|
+
*/
|
|
42
|
+
setScheduleGuardOffset(offset: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* Start sources for clips that span the given Transport position.
|
|
45
|
+
* Used for mid-playback seeking and loop boundary handling where
|
|
46
|
+
* Transport.schedule() callbacks have already passed.
|
|
47
|
+
*
|
|
48
|
+
* Uses strict < for absClipStart to avoid double-creation with
|
|
49
|
+
* schedule callbacks at exact Transport position (e.g., loopStart).
|
|
50
|
+
*/
|
|
51
|
+
startMidClipSources(transportOffset: number, audioContextTime: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* Stop all active AudioBufferSourceNodes and clear the set.
|
|
54
|
+
* Native AudioBufferSourceNodes ignore Transport state changes —
|
|
55
|
+
* they must be explicitly stopped.
|
|
56
|
+
*/
|
|
57
|
+
stopAllSources(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Schedule fade envelopes for a clip at the given AudioContext time.
|
|
60
|
+
* Uses native GainNode.gain (AudioParam) directly — no _param workaround needed.
|
|
34
61
|
*/
|
|
35
62
|
private scheduleFades;
|
|
63
|
+
/**
|
|
64
|
+
* Prepare fade envelopes for all clips based on Transport offset.
|
|
65
|
+
* Called before Transport.start() to schedule fades at correct AudioContext times.
|
|
66
|
+
*/
|
|
67
|
+
prepareFades(when: number, transportOffset: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* Cancel all scheduled fade automation and reset to nominal gain.
|
|
70
|
+
* Called on pause/stop to prevent stale fade envelopes.
|
|
71
|
+
*/
|
|
72
|
+
cancelFades(): void;
|
|
36
73
|
private gainToDb;
|
|
37
74
|
setVolume(gain: number): void;
|
|
38
75
|
setPan(pan: number): void;
|
|
39
76
|
setMute(muted: boolean): void;
|
|
40
77
|
setSolo(soloed: boolean): void;
|
|
41
|
-
play(when?: number, offset?: number, duration?: number): void;
|
|
42
|
-
pause(): void;
|
|
43
|
-
stop(when?: number): void;
|
|
44
78
|
dispose(): void;
|
|
45
79
|
get id(): string;
|
|
46
80
|
get duration(): number;
|
|
47
81
|
get buffer(): AudioBuffer;
|
|
48
|
-
get isPlaying(): boolean;
|
|
49
82
|
get muted(): boolean;
|
|
50
83
|
get startTime(): number;
|
|
51
|
-
setOnStopCallback(callback: () => void): void;
|
|
52
84
|
}
|
|
53
85
|
|
|
54
86
|
type EffectsFunction = (masterGainNode: Volume, destination: ToneAudioNode, isOffline: boolean) => void | (() => void);
|
|
@@ -65,10 +97,14 @@ declare class TonePlayout {
|
|
|
65
97
|
private manualMuteState;
|
|
66
98
|
private effectsCleanup?;
|
|
67
99
|
private onPlaybackCompleteCallback?;
|
|
68
|
-
private
|
|
69
|
-
private
|
|
100
|
+
private _completionEventId;
|
|
101
|
+
private _loopHandler;
|
|
102
|
+
private _loopEnabled;
|
|
103
|
+
private _loopStart;
|
|
104
|
+
private _loopEnd;
|
|
70
105
|
constructor(options?: TonePlayoutOptions);
|
|
71
106
|
private gainToDb;
|
|
107
|
+
private clearCompletionEvent;
|
|
72
108
|
init(): Promise<void>;
|
|
73
109
|
addTrack(trackOptions: ToneTrackOptions): ToneTrack;
|
|
74
110
|
/**
|
|
@@ -85,6 +121,7 @@ declare class TonePlayout {
|
|
|
85
121
|
setSolo(trackId: string, soloed: boolean): void;
|
|
86
122
|
private updateSoloMuting;
|
|
87
123
|
setMute(trackId: string, muted: boolean): void;
|
|
124
|
+
setLoop(enabled: boolean, loopStart: number, loopEnd: number): void;
|
|
88
125
|
getCurrentTime(): number;
|
|
89
126
|
seekTo(time: number): void;
|
|
90
127
|
dispose(): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,35 +20,67 @@ interface ToneTrackOptions {
|
|
|
20
20
|
destination?: ToneAudioNode;
|
|
21
21
|
}
|
|
22
22
|
declare class ToneTrack {
|
|
23
|
-
private
|
|
23
|
+
private scheduledClips;
|
|
24
|
+
private activeSources;
|
|
24
25
|
private volumeNode;
|
|
25
26
|
private panNode;
|
|
26
27
|
private muteGain;
|
|
27
28
|
private track;
|
|
28
29
|
private effectsCleanup?;
|
|
29
|
-
private
|
|
30
|
-
private activePlayers;
|
|
30
|
+
private _scheduleGuardOffset;
|
|
31
31
|
constructor(options: ToneTrackOptions);
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Create and start an AudioBufferSourceNode for a clip.
|
|
34
|
+
* Sources are one-shot: each play or loop iteration creates a fresh one.
|
|
35
|
+
*/
|
|
36
|
+
private startClipSource;
|
|
37
|
+
/**
|
|
38
|
+
* Set the schedule guard offset. Schedule callbacks for clips before this
|
|
39
|
+
* offset are suppressed (already handled by startMidClipSources).
|
|
40
|
+
* Must be called before transport.start() and in the loop handler.
|
|
41
|
+
*/
|
|
42
|
+
setScheduleGuardOffset(offset: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* Start sources for clips that span the given Transport position.
|
|
45
|
+
* Used for mid-playback seeking and loop boundary handling where
|
|
46
|
+
* Transport.schedule() callbacks have already passed.
|
|
47
|
+
*
|
|
48
|
+
* Uses strict < for absClipStart to avoid double-creation with
|
|
49
|
+
* schedule callbacks at exact Transport position (e.g., loopStart).
|
|
50
|
+
*/
|
|
51
|
+
startMidClipSources(transportOffset: number, audioContextTime: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* Stop all active AudioBufferSourceNodes and clear the set.
|
|
54
|
+
* Native AudioBufferSourceNodes ignore Transport state changes —
|
|
55
|
+
* they must be explicitly stopped.
|
|
56
|
+
*/
|
|
57
|
+
stopAllSources(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Schedule fade envelopes for a clip at the given AudioContext time.
|
|
60
|
+
* Uses native GainNode.gain (AudioParam) directly — no _param workaround needed.
|
|
34
61
|
*/
|
|
35
62
|
private scheduleFades;
|
|
63
|
+
/**
|
|
64
|
+
* Prepare fade envelopes for all clips based on Transport offset.
|
|
65
|
+
* Called before Transport.start() to schedule fades at correct AudioContext times.
|
|
66
|
+
*/
|
|
67
|
+
prepareFades(when: number, transportOffset: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* Cancel all scheduled fade automation and reset to nominal gain.
|
|
70
|
+
* Called on pause/stop to prevent stale fade envelopes.
|
|
71
|
+
*/
|
|
72
|
+
cancelFades(): void;
|
|
36
73
|
private gainToDb;
|
|
37
74
|
setVolume(gain: number): void;
|
|
38
75
|
setPan(pan: number): void;
|
|
39
76
|
setMute(muted: boolean): void;
|
|
40
77
|
setSolo(soloed: boolean): void;
|
|
41
|
-
play(when?: number, offset?: number, duration?: number): void;
|
|
42
|
-
pause(): void;
|
|
43
|
-
stop(when?: number): void;
|
|
44
78
|
dispose(): void;
|
|
45
79
|
get id(): string;
|
|
46
80
|
get duration(): number;
|
|
47
81
|
get buffer(): AudioBuffer;
|
|
48
|
-
get isPlaying(): boolean;
|
|
49
82
|
get muted(): boolean;
|
|
50
83
|
get startTime(): number;
|
|
51
|
-
setOnStopCallback(callback: () => void): void;
|
|
52
84
|
}
|
|
53
85
|
|
|
54
86
|
type EffectsFunction = (masterGainNode: Volume, destination: ToneAudioNode, isOffline: boolean) => void | (() => void);
|
|
@@ -65,10 +97,14 @@ declare class TonePlayout {
|
|
|
65
97
|
private manualMuteState;
|
|
66
98
|
private effectsCleanup?;
|
|
67
99
|
private onPlaybackCompleteCallback?;
|
|
68
|
-
private
|
|
69
|
-
private
|
|
100
|
+
private _completionEventId;
|
|
101
|
+
private _loopHandler;
|
|
102
|
+
private _loopEnabled;
|
|
103
|
+
private _loopStart;
|
|
104
|
+
private _loopEnd;
|
|
70
105
|
constructor(options?: TonePlayoutOptions);
|
|
71
106
|
private gainToDb;
|
|
107
|
+
private clearCompletionEvent;
|
|
72
108
|
init(): Promise<void>;
|
|
73
109
|
addTrack(trackOptions: ToneTrackOptions): ToneTrack;
|
|
74
110
|
/**
|
|
@@ -85,6 +121,7 @@ declare class TonePlayout {
|
|
|
85
121
|
setSolo(trackId: string, soloed: boolean): void;
|
|
86
122
|
private updateSoloMuting;
|
|
87
123
|
setMute(trackId: string, muted: boolean): void;
|
|
124
|
+
setLoop(enabled: boolean, loopStart: number, loopEnd: number): void;
|
|
88
125
|
getCurrentTime(): number;
|
|
89
126
|
seekTo(time: number): void;
|
|
90
127
|
dispose(): void;
|