GraphicalMusicSheet.d.ts 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import { MusicSheet } from "../MusicSheet";
  2. import { SourceMeasure } from "../VoiceData/SourceMeasure";
  3. import { StaffMeasure } from "./StaffMeasure";
  4. import { GraphicalMusicPage } from "./GraphicalMusicPage";
  5. import { VerticalGraphicalStaffEntryContainer } from "./VerticalGraphicalStaffEntryContainer";
  6. import { GraphicalLabel } from "./GraphicalLabel";
  7. import { GraphicalLine } from "./GraphicalLine";
  8. import { MusicSystem } from "./MusicSystem";
  9. import { GraphicalStaffEntry } from "./GraphicalStaffEntry";
  10. import { SourceStaffEntry } from "../VoiceData/SourceStaffEntry";
  11. import { PointF2D } from "../../Common/DataObjects/PointF2D";
  12. import { ClefInstruction } from "../VoiceData/Instructions/ClefInstruction";
  13. import { KeyInstruction } from "../VoiceData/Instructions/KeyInstruction";
  14. import { Fraction } from "../../Common/DataObjects/fraction";
  15. import { GraphicalNote } from "./GraphicalNote";
  16. import { Note } from "../VoiceData/Note";
  17. import { MusicSheetCalculator } from "./MusicSheetCalculator";
  18. import Dictionary from "typescript-collections/dist/lib/Dictionary";
  19. import { SelectionStartSymbol } from "./SelectionStartSymbol";
  20. import { SelectionEndSymbol } from "./SelectionEndSymbol";
  21. import { OutlineAndFillStyleEnum } from "./DrawingEnums";
  22. export declare class GraphicalMusicSheet {
  23. constructor(musicSheet: MusicSheet, calculator: MusicSheetCalculator);
  24. sourceToGraphicalMeasureLinks: Dictionary<SourceMeasure, StaffMeasure[]>;
  25. private musicSheet;
  26. private calculator;
  27. private musicPages;
  28. private measureList;
  29. private verticalGraphicalStaffEntryContainers;
  30. private title;
  31. private subtitle;
  32. private composer;
  33. private lyricist;
  34. private cursors;
  35. private selectionStartSymbol;
  36. private selectionEndSymbol;
  37. private minAllowedSystemWidth;
  38. private numberOfStaves;
  39. private leadSheet;
  40. ParentMusicSheet: MusicSheet;
  41. GetCalculator: MusicSheetCalculator;
  42. MusicPages: GraphicalMusicPage[];
  43. MeasureList: StaffMeasure[][];
  44. VerticalGraphicalStaffEntryContainers: VerticalGraphicalStaffEntryContainer[];
  45. Title: GraphicalLabel;
  46. Subtitle: GraphicalLabel;
  47. Composer: GraphicalLabel;
  48. Lyricist: GraphicalLabel;
  49. Cursors: GraphicalLine[];
  50. SelectionStartSymbol: SelectionStartSymbol;
  51. SelectionEndSymbol: SelectionEndSymbol;
  52. MinAllowedSystemWidth: number;
  53. NumberOfStaves: number;
  54. LeadSheet: boolean;
  55. static transformRelativeToAbsolutePosition(graphicalMusicSheet: GraphicalMusicSheet): void;
  56. Initialize(): void;
  57. reCalculate(): void;
  58. prepare(): void;
  59. EnforceRedrawOfMusicSystems(): void;
  60. getClickedObject<T>(positionOnMusicSheet: PointF2D): T;
  61. findGraphicalStaffEntryFromMeasureList(staffIndex: number, measureIndex: number, sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry;
  62. findNextGraphicalStaffEntry(staffIndex: number, measureIndex: number, graphicalStaffEntry: GraphicalStaffEntry): GraphicalStaffEntry;
  63. getFirstVisibleMeasuresListFromIndeces(start: number, end: number): StaffMeasure[];
  64. orderMeasuresByStaffLine(measures: StaffMeasure[]): StaffMeasure[][];
  65. initializeActiveClefs(): ClefInstruction[];
  66. GetMainKey(): KeyInstruction;
  67. getOrCreateVerticalContainer(timestamp: Fraction): VerticalGraphicalStaffEntryContainer;
  68. GetVerticalContainerFromTimestamp(timestamp: Fraction, startIndex?: number): VerticalGraphicalStaffEntryContainer;
  69. GetInterpolatedIndexInVerticalContainers(musicTimestamp: Fraction): number;
  70. getVisibleStavesIndecesFromSourceMeasure(visibleMeasures: StaffMeasure[]): number[];
  71. getGraphicalMeasureFromSourceMeasureAndIndex(sourceMeasure: SourceMeasure, index: number): StaffMeasure;
  72. getMeasureIndex(graphicalMeasure: StaffMeasure, measureIndex: number, inListIndex: number): boolean;
  73. GetNearesNote(clickPosition: PointF2D, maxClickDist: PointF2D): GraphicalNote;
  74. GetClickableLabel(clickPosition: PointF2D): GraphicalLabel;
  75. GetNearestStaffEntry(clickPosition: PointF2D): GraphicalStaffEntry;
  76. GetPossibleCommentAnchor(clickPosition: PointF2D): SourceStaffEntry;
  77. getClickedObjectOfType<T>(positionOnMusicSheet: PointF2D): T;
  78. tryGetTimestampFromPosition(positionOnMusicSheet: PointF2D): Fraction;
  79. tryGetClickableLabel(positionOnMusicSheet: PointF2D): GraphicalLabel;
  80. tryGetTimeStampFromPosition(positionOnMusicSheet: PointF2D): Fraction;
  81. getStaffEntry(index: number): GraphicalStaffEntry;
  82. GetPreviousVisibleContainerIndex(index: number): number;
  83. GetNextVisibleContainerIndex(index: number): number;
  84. findClosestLeftStaffEntry(fractionalIndex: number, searchOnlyVisibleEntries: boolean): GraphicalStaffEntry;
  85. findClosestRightStaffEntry(fractionalIndex: number, returnOnlyVisibleEntries: boolean): GraphicalStaffEntry;
  86. calculateCursorLineAtTimestamp(musicTimestamp: Fraction, styleEnum: OutlineAndFillStyleEnum): GraphicalLine;
  87. calculateXPositionFromTimestamp(timeStamp: Fraction): [number, MusicSystem];
  88. GetNumberOfVisibleInstruments(): number;
  89. GetNumberOfFollowedInstruments(): number;
  90. GetGraphicalFromSourceMeasure(sourceMeasure: SourceMeasure): StaffMeasure[];
  91. GetGraphicalFromSourceStaffEntry(sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry;
  92. GetGraphicalNoteFromSourceNote(note: Note, containingGse: GraphicalStaffEntry): GraphicalNote;
  93. private CalculateDistance(pt1, pt2);
  94. private getLongestStaffEntryDuration(index);
  95. }
  96. export declare class SystemImageProperties {
  97. positionInPixels: PointF2D;
  98. systemImageId: number;
  99. system: MusicSystem;
  100. }