-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclip-player.d.ts
More file actions
40 lines (40 loc) · 1.87 KB
/
clip-player.d.ts
File metadata and controls
40 lines (40 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { type ITransportEvent } from "./event-types.ts";
import { NoteProcessor } from "./note-processor.ts";
import { type TUniqueIdentifier } from "./uuid.ts";
import type { IClip, IClipEvent } from "./clip.ts";
interface IClipAndPlaybackData<TEventData> {
clip: IClip<TEventData>;
noteProcessor: NoteProcessor;
eventsForActiveRange: IClipEvent<TEventData>[];
}
type TClipPlayerCallback<TEventData> = (audioContextTime: number, transportTime: number, clipId: TUniqueIdentifier, event: IClipEvent<TEventData>) => void;
export declare class ClipPlayer<TEventData> {
private clipsWithPlaybackData;
private callback;
private lastTransportPlaybackEvent;
private schedulingWindowLeadingEdgeInTransportBeats;
private schedulingWindowTrailingEdgeInTransportBeats;
private shouldWrapCorrespondingEndEventsAroundActiveRange;
constructor(callback: TClipPlayerCallback<TEventData>, shouldWrapEndEventsInActiveRange?: boolean);
addClip(c: IClip<TEventData>): void;
getAllClips(): Map<string, IClipAndPlaybackData<TEventData>>;
removeClip(id: string): void;
removeAllClips(): void;
updateClip(c: IClip<TEventData>): void;
getClip(id: string): IClip<TEventData> | undefined;
scheduleEndEventsForAllCurrentlyPlayingClips(): void;
private scheduleEndEventsForCurrentlyPlayingNotesInClip;
private scheduleEndEventsForClipUpdate;
private scheduleEndEventsForNotes;
onTransportEvent(e: ITransportEvent): void;
private transportBeatTimeToUnrolledClipBeatTime;
transportBeatTimeToClipBeatTime(clip: IClip<TEventData>, transportBeatTime: number): number;
private clipBeatTimeToTransportBeatTime;
private getEventsForActiveRange;
private handleClipPlayback;
private scheduleEventForPlayback;
private getLoopStartEndBeatTimes;
private isClipEventInActiveRange;
private isTransportBeatTimeInSchedulingWindow;
}
export {};