123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- import { GraphicalStaffEntry } from "./GraphicalStaffEntry";
- import { StaffLine } from "./StaffLine";
- import { GraphicalMusicSheet } from "./GraphicalMusicSheet";
- import { EngravingRules } from "./EngravingRules";
- import { Tie } from "../VoiceData/Tie";
- import { Fraction } from "../../Common/DataObjects/fraction";
- import { Note } from "../VoiceData/Note";
- import { StaffMeasure } from "./StaffMeasure";
- import { ClefInstruction } from "../VoiceData/Instructions/ClefInstruction";
- import { LyricWord } from "../VoiceData/Lyrics/LyricsWord";
- import { SourceMeasure } from "../VoiceData/SourceMeasure";
- import { GraphicalMusicPage } from "./GraphicalMusicPage";
- import { GraphicalNote } from "./GraphicalNote";
- import { Beam } from "../VoiceData/Beam";
- import { OctaveEnum } from "../VoiceData/Expressions/ContinuousExpressions/octaveShift";
- import { LyricsEntry } from "../VoiceData/Lyrics/LyricsEntry";
- import { VoiceEntry } from "../VoiceData/VoiceEntry";
- import { OrnamentContainer } from "../VoiceData/OrnamentContainer";
- import { ArticulationEnum } from "../VoiceData/VoiceEntry";
- import { Tuplet } from "../VoiceData/Tuplet";
- import { MusicSystem } from "./MusicSystem";
- import { GraphicalTie } from "./GraphicalTie";
- import { RepetitionInstruction } from "../VoiceData/Instructions/RepetitionInstruction";
- import { MultiExpression } from "../VoiceData/Expressions/multiExpression";
- import { StaffEntryLink } from "../VoiceData/StaffEntryLink";
- import { MultiTempoExpression } from "../VoiceData/Expressions/multiTempoExpression";
- import { Repetition } from "../MusicSource/Repetition";
- import { PointF2D } from "../../Common/DataObjects/PointF2D";
- import { SourceStaffEntry } from "../VoiceData/SourceStaffEntry";
- import { BoundingBox } from "./BoundingBox";
- import { IGraphicalSymbolFactory } from "../Interfaces/IGraphicalSymbolFactory";
- import { ITextMeasurer } from "../Interfaces/ITextMeasurer";
- import { ITransposeCalculator } from "../Interfaces/ITransposeCalculator";
- import { OctaveShiftParams } from "./OctaveShiftParams";
- import { AccidentalCalculator } from "./AccidentalCalculator";
- import Dictionary from "typescript-collections/dist/lib/Dictionary";
- export declare abstract class MusicSheetCalculator {
- static transposeCalculator: ITransposeCalculator;
- protected static textMeasurer: ITextMeasurer;
- protected staffEntriesWithGraphicalTies: GraphicalStaffEntry[];
- protected staffEntriesWithOrnaments: GraphicalStaffEntry[];
- protected staffEntriesWithChordSymbols: GraphicalStaffEntry[];
- protected staffLinesWithLyricWords: StaffLine[];
- protected staffLinesWithGraphicalExpressions: StaffLine[];
- protected graphicalMusicSheet: GraphicalMusicSheet;
- protected rules: EngravingRules;
- protected symbolFactory: IGraphicalSymbolFactory;
- constructor(symbolFactory: IGraphicalSymbolFactory);
- static TextMeasurer: ITextMeasurer;
- protected leadSheet: boolean;
- private static addTieToTieTimestampsDict(tieTimestampListDict, note);
- private static setMeasuresMinStaffEntriesWidth(measures, minimumStaffEntriesWidth);
- initialize(graphicalMusicSheet: GraphicalMusicSheet): void;
- prepareGraphicalMusicSheet(): void;
- calculate(): void;
- calculateXLayout(graphicalMusicSheet: GraphicalMusicSheet, maxInstrNameLabelLength: number): void;
- protected calculateMeasureXLayout(measures: StaffMeasure[]): number;
- protected calculateSystemYLayout(): void;
- protected initStaffMeasuresCreation(): void;
- protected handleBeam(graphicalNote: GraphicalNote, beam: Beam, openBeams: Beam[]): void;
- protected createGraphicalTieNote(beams: Beam[], activeClef: ClefInstruction, octaveShiftValue: OctaveEnum, graphicalStaffEntry: GraphicalStaffEntry, duration: Fraction, numberOfDots: number, openTie: Tie, isLastTieNote: boolean): void;
- protected handleVoiceEntryLyrics(lyricsEntries: Dictionary<number, LyricsEntry>, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry, openLyricWords: LyricWord[]): void;
- protected handleVoiceEntryOrnaments(ornamentContainer: OrnamentContainer, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void;
- protected handleVoiceEntryArticulations(articulations: ArticulationEnum[], voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void;
- protected handleTuplet(graphicalNote: GraphicalNote, tuplet: Tuplet, openTuplets: Tuplet[]): void;
- protected layoutVoiceEntry(voiceEntry: VoiceEntry, graphicalNotes: GraphicalNote[], graphicalStaffEntry: GraphicalStaffEntry, hasPitchedNote: boolean, isGraceStaffEntry: boolean): void;
- protected layoutStaffEntry(graphicalStaffEntry: GraphicalStaffEntry): void;
- protected handleTie(tie: Tie, startGraphicalStaffEntry: GraphicalStaffEntry, staffIndex: number, measureIndex: number): void;
- protected updateStaffLineBorders(staffLine: StaffLine): void;
- protected calculateMeasureNumberPlacement(musicSystem: MusicSystem): void;
- protected layoutGraphicalTie(tie: GraphicalTie, tieIsAtSystemBreak: boolean): void;
- protected calculateSingleStaffLineLyricsPosition(staffLine: StaffLine, lyricVersesNumber: number[]): void;
- protected calculateSingleOctaveShift(sourceMeasure: SourceMeasure, multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void;
- protected calculateWordRepetitionInstruction(repetitionInstruction: RepetitionInstruction, measureIndex: number): void;
- protected calculateMoodAndUnknownExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void;
- protected clearRecreatedObjects(): void;
- protected handleStaffEntryLink(graphicalStaffEntry: GraphicalStaffEntry, staffEntryLinks: StaffEntryLink[]): void;
- protected calculateMusicSystems(): void;
- protected updateSkyBottomLine(staffLine: StaffLine): void;
- protected calculateSkyBottomLine(staffLine: StaffLine): void;
- protected calculateMarkedAreas(): void;
- protected calculateComments(): void;
- protected optimizeStaffLineDynamicExpressionsPositions(): void;
- protected calculateChordSymbols(): void;
- protected layoutMeasureWithWholeRest(rest: GraphicalNote, gse: GraphicalStaffEntry, measure: StaffMeasure): void;
- protected layoutBeams(staffEntry: GraphicalStaffEntry): void;
- protected layoutArticulationMarks(articulations: ArticulationEnum[], voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void;
- protected layoutOrnament(ornaments: OrnamentContainer, voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry): void;
- protected calculateRestNotePlacementWithinGraphicalBeam(graphicalStaffEntry: GraphicalStaffEntry, restNote: GraphicalNote, previousNote: GraphicalNote, nextStaffEntry: GraphicalStaffEntry, nextNote: GraphicalNote): void;
- protected calculateTupletNumbers(): void;
- protected calculateSlurs(): void;
- protected calculateDynamicExpressionsForSingleMultiExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void;
- protected calcGraphicalRepetitionEndingsRecursively(repetition: Repetition): void;
- protected layoutSingleRepetitionEnding(start: StaffMeasure, end: StaffMeasure, numberText: string, offset: number, leftOpen: boolean, rightOpen: boolean): void;
- protected calculateTempoExpressionsForSingleMultiTempoExpression(sourceMeasure: SourceMeasure, multiTempoExpression: MultiTempoExpression, measureIndex: number): void;
- protected clearSystemsAndMeasures(): void;
- protected handleVoiceEntry(voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry, accidentalCalculator: AccidentalCalculator, openLyricWords: LyricWord[], tieTimestampListDict: Dictionary<Tie, Fraction[]>, activeClef: ClefInstruction, openTuplets: Tuplet[], openBeams: Beam[], octaveShiftValue: OctaveEnum, grace?: boolean, linkedNotes?: Note[], sourceStaffEntry?: SourceStaffEntry): OctaveEnum;
- protected handleVoiceEntryGraceNotes(graceEntries: VoiceEntry[], graphicalGraceEntries: GraphicalStaffEntry[], graphicalStaffEntry: GraphicalStaffEntry, accidentalCalculator: AccidentalCalculator, activeClef: ClefInstruction, octaveShiftValue: OctaveEnum, lyricWords: LyricWord[], tieTimestampListDict: Dictionary<Tie, Fraction[]>, tuplets: Tuplet[], beams: Beam[]): void;
- protected handleOpenTies(measure: StaffMeasure, beams: Beam[], tieTimestampListDict: Dictionary<Tie, Fraction[]>, activeClef: ClefInstruction, octaveShiftParams: OctaveShiftParams): void;
- protected resetYPositionForLeadSheet(psi: BoundingBox): void;
- protected layoutVoiceEntries(graphicalStaffEntry: GraphicalStaffEntry): void;
- protected maxInstrNameLabelLength(): number;
- protected calculateSheetLabelBoundingBoxes(): void;
- protected checkMeasuresForWholeRestNotes(): void;
- protected optimizeRestNotePlacement(graphicalStaffEntry: GraphicalStaffEntry, measure: StaffMeasure): void;
- protected getRelativePositionInStaffLineFromTimestamp(timestamp: Fraction, verticalIndex: number, staffLine: StaffLine, multiStaffInstrument: boolean, firstVisibleMeasureRelativeX?: number): PointF2D;
- protected getRelativeXPositionFromTimestamp(timestamp: Fraction): number;
- protected calculatePageLabels(page: GraphicalMusicPage): void;
- protected createGraphicalTies(): void;
- private createAccidentalCalculators();
- private calculateVerticalContainersList();
- private setIndecesToVerticalGraphicalContainers();
- private createGraphicalMeasuresForSourceMeasure(sourceMeasure, accidentalCalculators, openLyricWords, tieTimestampListDictList, openOctaveShifts, activeClefs);
- private createGraphicalMeasure(sourceMeasure, tieTimestampListDict, openTuplets, openBeams, accidentalCalculator, activeClefs, openOctaveShifts, openLyricWords, staffIndex, staffEntryLinks);
- private checkVoiceEntriesForTechnicalInstructions(voiceEntry, graphicalStaffEntry);
- private checkNoteForAccidental(graphicalNote, accidentalCalculator, activeClef, octaveEnum, grace?);
- private createStaffEntryForTieNote(measure, absoluteTimestamp, openTie);
- private updateSkyBottomLines();
- private handleStaffEntries();
- private calculateSkyBottomLines();
- private calculateBeams();
- private calculateStaffEntryArticulationMarks();
- private calculateOrnaments();
- private optimizeRestPlacement();
- private calculateTwoRestNotesPlacementWithCollisionDetection(graphicalStaffEntry);
- private calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(graphicalStaffEntry);
- private calculateTieCurves();
- private calculateLyricsPosition();
- private calculateDynamicExpressions();
- private calculateOctaveShifts();
- private getFirstLeftNotNullStaffEntryFromContainer(horizontalIndex, verticalIndex, multiStaffInstrument);
- private getFirstRightNotNullStaffEntryFromContainer(horizontalIndex, verticalIndex, multiStaffInstrument);
- private calculateWordRepetitionInstructions();
- private calculateRepetitionEndings();
- private calculateTempoExpressions();
- private calculateMoodAndUnknownExpressions();
- }
|