orpheus-osmd
Version:
An open source JavaScript engine for displaying MusicXML based on VexFlow.
59 lines (58 loc) • 2.06 kB
TypeScript
import { GraphicalMusicSheet } from "../MusicalScore/Graphical/GraphicalMusicSheet";
import { Instrument } from "../MusicalScore/Instrument";
import { MusicPartManager } from "../MusicalScore/MusicParts/MusicPartManager";
import { MusicPartManagerIterator } from "../MusicalScore/MusicParts/MusicPartManagerIterator";
import { Note } from "../MusicalScore/VoiceData/Note";
import { VoiceEntry } from "../MusicalScore/VoiceData/VoiceEntry";
import { OpenSheetMusicDisplay } from "./OpenSheetMusicDisplay";
/**
* A cursor which can iterate through the music sheet.
*/
export declare class Cursor {
constructor(container: HTMLElement, openSheetMusicDisplay: OpenSheetMusicDisplay);
private container1;
private openSheetMusicDisplay;
private manager;
private iterator;
private graphic;
private hidden;
private cursorElement;
private xArr;
private yArr;
private heightArr;
private timer;
/** Initialize the cursor. Necessary before using functions like show() and next(). */
init(manager: MusicPartManager, graphic: GraphicalMusicSheet): void;
test(): void;
/**
* Make the cursor visible
*/
show(): void;
resetIterator(): void;
private getStaffEntryFromVoiceEntry;
update(): void;
/**
* Hide the cursor
*/
hide(): void;
/**
* Go to next entry
*/
next(): void;
display(): void;
pause(): void;
calculateXYH(x: number, y: number, h: number): number[];
draw_canvas(): void;
highLightEorror(x: number[], y: number[], h: number[], width: number): void;
save(): void;
/**
* reset cursor to start
*/
reset(): void;
private updateStyle;
get Iterator(): MusicPartManagerIterator;
get Hidden(): boolean;
/** returns voices under the current Cursor position. Without instrument argument, all voices are returned. */
VoicesUnderCursor(instrument?: Instrument): VoiceEntry[];
NotesUnderCursor(instrument?: Instrument): Note[];
}