@waveform-playlist/browser 9.5.2 → 10.0.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.ts +55 -0
- package/dist/index.js +158 -107
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4767 -4412
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -18
- package/LICENSE.md +0 -21
package/dist/index.d.ts
CHANGED
|
@@ -1146,6 +1146,8 @@ declare interface PlaylistStateContextValue {
|
|
|
1146
1146
|
selectedTrackId: string | null;
|
|
1147
1147
|
loopStart: number;
|
|
1148
1148
|
loopEnd: number;
|
|
1149
|
+
/** Whether playback continues past the end of loaded audio */
|
|
1150
|
+
indefinitePlayback: boolean;
|
|
1149
1151
|
}
|
|
1150
1152
|
|
|
1151
1153
|
/**
|
|
@@ -1968,6 +1970,55 @@ export declare const useMediaElementData: () => MediaElementDataContextValue;
|
|
|
1968
1970
|
|
|
1969
1971
|
export declare const useMediaElementState: () => MediaElementStateContextValue;
|
|
1970
1972
|
|
|
1973
|
+
export declare function useOutputMeter(options?: UseOutputMeterOptions): UseOutputMeterReturn;
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Hook for monitoring master output levels
|
|
1977
|
+
*
|
|
1978
|
+
* Connects an AudioWorklet meter processor to the Destination node for
|
|
1979
|
+
* real-time output level monitoring. Computes sample-accurate peak and
|
|
1980
|
+
* RMS via the meter worklet — no transient is missed.
|
|
1981
|
+
*
|
|
1982
|
+
* IMPORTANT: Uses getGlobalContext() from playout to ensure the meter
|
|
1983
|
+
* is created on the same AudioContext as the audio engine. Tone.js's
|
|
1984
|
+
* getContext()/getDestination() return the DEFAULT context, which is
|
|
1985
|
+
* replaced when getGlobalContext() calls setContext() on first audio init.
|
|
1986
|
+
*/
|
|
1987
|
+
export declare interface UseOutputMeterOptions {
|
|
1988
|
+
/**
|
|
1989
|
+
* Number of channels to meter.
|
|
1990
|
+
* Default: 2 (stereo output)
|
|
1991
|
+
*/
|
|
1992
|
+
channelCount?: number;
|
|
1993
|
+
/**
|
|
1994
|
+
* How often to update the levels (in Hz).
|
|
1995
|
+
* Default: 60 (60fps)
|
|
1996
|
+
*/
|
|
1997
|
+
updateRate?: number;
|
|
1998
|
+
/**
|
|
1999
|
+
* Whether audio is currently playing. When this transitions to false,
|
|
2000
|
+
* all levels (current, peak, RMS) and smoothed state are reset to zero.
|
|
2001
|
+
* Without this, the browser's tail-time optimization stops calling the
|
|
2002
|
+
* worklet's process() when no audio flows, leaving the last non-zero
|
|
2003
|
+
* levels frozen in state.
|
|
2004
|
+
* Default: false
|
|
2005
|
+
*/
|
|
2006
|
+
isPlaying?: boolean;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
export declare interface UseOutputMeterReturn {
|
|
2010
|
+
/** Per-channel peak output levels (0-1) */
|
|
2011
|
+
levels: number[];
|
|
2012
|
+
/** Per-channel held peak levels (0-1) */
|
|
2013
|
+
peakLevels: number[];
|
|
2014
|
+
/** Per-channel RMS output levels (0-1) */
|
|
2015
|
+
rmsLevels: number[];
|
|
2016
|
+
/** Reset all held peak levels to 0 */
|
|
2017
|
+
resetPeak: () => void;
|
|
2018
|
+
/** Error from meter setup (worklet load failure, context issues, etc.) */
|
|
2019
|
+
error: Error | null;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
1971
2022
|
export declare const usePlaybackAnimation: () => PlaybackAnimationContextValue;
|
|
1972
2023
|
|
|
1973
2024
|
/**
|
|
@@ -2245,6 +2296,9 @@ declare interface WaveformPlaylistProviderProps {
|
|
|
2245
2296
|
* Use this during progressive loading to avoid rebuilding the engine for
|
|
2246
2297
|
* each track — flip to false when all tracks are ready for a single build. */
|
|
2247
2298
|
deferEngineRebuild?: boolean;
|
|
2299
|
+
/** Disable automatic stop when the cursor reaches the end of the longest
|
|
2300
|
+
* track. Useful for DAW-style recording beyond existing audio. */
|
|
2301
|
+
indefinitePlayback?: boolean;
|
|
2248
2302
|
children: ReactNode;
|
|
2249
2303
|
}
|
|
2250
2304
|
|
|
@@ -2256,6 +2310,7 @@ declare interface WaveformPlaylistTheme {
|
|
|
2256
2310
|
selectedWaveOutlineColor: WaveformColor;
|
|
2257
2311
|
selectedWaveFillColor: WaveformColor;
|
|
2258
2312
|
selectedTrackControlsBackground: string;
|
|
2313
|
+
selectedTrackBackground: string;
|
|
2259
2314
|
timeColor: string;
|
|
2260
2315
|
timescaleBackgroundColor: string;
|
|
2261
2316
|
playheadColor: string;
|