UNPKG

wave-roll

Version:

JavaScript Library for Comparative MIDI Piano-Roll Visualization

38 lines 1.29 kB
import type { AudioPlayerContainer } from "@/lib/core/audio/audio-player"; import type { AudioController } from "@/core/playback"; import type { VisualizationEngine } from "@/core/visualization/visualization-engine"; export type AnyAudioPlayer = AudioPlayerContainer | AudioController | VisualizationEngine; export interface SetupPlayButtonOptions { playBtn: HTMLElement; audioPlayer: AnyAudioPlayer | null | undefined; /** * Optional WavPlayerManager for buffer status checking */ wavPlayerManager?: { areAllBuffersReady(): boolean; } | null; /** * Executed before attempting audioPlayer.play(). Useful for Tone.start() etc. */ prePlay?: () => Promise<void> | void; /** * Executed after a successful play() call. */ postPlay?: () => void; /** * Executed after a pause() call. */ postPause?: () => void; /** * Optional colors */ playingColor?: string; idleColor?: string; loadingColor?: string; } /** * Attach play / pause behaviour to a button element and return an * `updatePlayButton` function that syncs the UI with current player state. */ export declare function setupPlayButton(opts: SetupPlayButtonOptions): () => void; //# sourceMappingURL=play-button.d.ts.map