UNPKG

wave-roll

Version:

JavaScript Library for Comparative MIDI Piano-Roll Visualization

139 lines 3.94 kB
/** * AudioPlayer V2 - Wrapper around UnifiedAudioController * * This class maintains compatibility with the existing AudioPlayer interface * while using the new synchronized UnifiedAudioController internally. */ export declare class AudioPlayer { private unifiedController; notes: any[]; options: any; pianoRoll: any; midiManager: any; state: any; originalTempo: number; isInitialized: boolean; initPromise: Promise<void> | null; samplerManager: any; wavPlayerManager: any; transportSyncManager: any; loopManager: any; playbackController: any; audioSettingsController: any; fileAudioController: any; autoPauseController: any; visualUpdateCallback: ((update: any) => void) | null; operationState: any; isHandlingLoop: boolean; constructor(notes: any[], options: any, pianoRoll: any); /** * Create state proxy for compatibility */ private createStateProxy; /** * Create legacy manager proxies for compatibility */ private createLegacyManagers; /** * Initialize - delegate to unified controller */ initialize(): Promise<void>; private performInitialization; /** * Start playbook */ play(): Promise<void>; /** * Pause playback */ pause(): void; /** * Restart playback */ restart(): void; /** * Seek to specific time */ seek(time: number): void; /** * Set tempo */ setTempo(bpm: number): void; /** * Set master volume */ setVolume(volume: number): void; /** * Set playback rate */ setPlaybackRate(rate: number): void; /** * Update baseline/original tempo used as 100% reference. */ setOriginalTempo(bpm: number): void; /** * Set loop points (A-B) with optional position preservation. * - Passing null,null clears loop and (optionally) preserves position. * - Passing null,B sets [0,B) as loop window. * - Passing A,null stores A only (does NOT activate loop by policy). * - Passing A,B activates AB loop; when preservePosition=false, jumps to A. */ setLoopPoints(start: number | null, end: number | null, preservePosition?: boolean): void; /** * Toggle or explicitly set repeat mode. * - When enabled is provided: true → on, false → off. * - Without argument: toggle current state. * If AB markers are present and enabled=true, subsequent setLoopPoints will switch to 'ab'. */ toggleRepeat(enabled?: boolean): void; /** * Set file mute */ setFileMute(fileId: string, muted: boolean): void; /** * Set file pan */ setFilePan(fileId: string, pan: number): void; /** * Set file volume */ setFileVolume(fileId: string, volume: number): void; /** * Set WAV volume */ setWavVolume(playerId: string, volume: number): void; /** Determine if the given id belongs to WAV registry */ private isWavFileId; /** * Get current state */ getState(): any; /** * Set visual update callback */ setOnVisualUpdate(callback: (update: any) => void): void; /** * Refresh audio players (compatibility) */ refreshAudioPlayers(): void; cleanup(): void; setupTransportCallbacks(): void; removeTransportCallbacks(): void; updateAllUI(): void; handleFileSettingsChange(): void; handlePlaybackEnd(): void; maybeAutoPauseIfSilent(): void; handleTransportStop: () => void; handleTransportPause: () => void; handleTransportLoop: () => void; /** * Destroy and cleanup */ destroy(): void; } /** * Create a new audio player instance */ export declare function createAudioPlayer(notes: any[], options: any, pianoRoll: any): AudioPlayer; export { AudioPlayer as AudioPlayerContainer }; //# sourceMappingURL=audio-player.d.ts.map