UNPKG

wave-roll

Version:

JavaScript Library for Comparative MIDI Piano-Roll Visualization

43 lines 1.36 kB
/** * Auto-Pause Controller * Handles automatic pausing when all audio sources are muted or at zero volume */ import { AudioPlayerState } from "../player-types"; export interface AutoPauseControllerDeps { state: AudioPlayerState; onAutoPause?: () => void; onAutoResume?: () => void; checkAllMuted: () => boolean; checkAllZeroVolume: () => boolean; } export declare class AutoPauseController { private deps; /** Whether we paused automatically because all sources became silent */ private _autoPausedBySilence; /** Until when we should ignore auto-pause checks after an auto-resume (ms timestamp) */ private _silencePauseGuardUntilMs; constructor(deps: AutoPauseControllerDeps); /** * Check if we should auto-pause due to all sources being silent * Returns true if auto-pause was triggered */ maybeAutoPause(): boolean; /** * Check if we should auto-resume after being auto-paused * Returns true if auto-resume should occur */ maybeAutoResume(): boolean; /** * Reset auto-pause state */ reset(): void; /** * Get current auto-pause state */ isAutoPaused(): boolean; /** * Manually set auto-pause state (for external control) */ setAutoPaused(paused: boolean): void; } //# sourceMappingURL=auto-pause-controller.d.ts.map