MusicSystem.d.ts 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import { StaffLine } from "./StaffLine";
  2. import { Instrument } from "../Instrument";
  3. import { Fraction } from "../../Common/DataObjects/fraction";
  4. import { InstrumentalGroup } from "../InstrumentalGroup";
  5. import { GraphicalMusicPage } from "./GraphicalMusicPage";
  6. import { GraphicalLabel } from "./GraphicalLabel";
  7. import { StaffMeasure } from "./StaffMeasure";
  8. import { GraphicalObject } from "./GraphicalObject";
  9. import { EngravingRules } from "./EngravingRules";
  10. import { PointF2D } from "../../Common/DataObjects/PointF2D";
  11. import { SystemLinesEnum } from "./SystemLinesEnum";
  12. import Dictionary from "typescript-collections/dist/lib/Dictionary";
  13. import { GraphicalComment } from "./GraphicalComment";
  14. import { GraphicalMarkedArea } from "./GraphicalMarkedArea";
  15. import { SystemLine } from "./SystemLine";
  16. import { SystemLinePosition } from "./SystemLinePosition";
  17. export declare abstract class MusicSystem extends GraphicalObject {
  18. needsToBeRedrawn: boolean;
  19. protected parent: GraphicalMusicPage;
  20. protected id: number;
  21. protected staffLines: StaffLine[];
  22. protected graphicalMeasures: StaffMeasure[][];
  23. protected labels: Dictionary<GraphicalLabel, Instrument>;
  24. protected measureNumberLabels: GraphicalLabel[];
  25. protected maxLabelLength: number;
  26. protected objectsToRedraw: [Object[], Object][];
  27. protected instrumentBrackets: GraphicalObject[];
  28. protected groupBrackets: GraphicalObject[];
  29. protected graphicalMarkedAreas: GraphicalMarkedArea[];
  30. protected graphicalComments: GraphicalComment[];
  31. protected systemLines: SystemLine[];
  32. protected rules: EngravingRules;
  33. constructor(parent: GraphicalMusicPage, id: number);
  34. Parent: GraphicalMusicPage;
  35. StaffLines: StaffLine[];
  36. GraphicalMeasures: StaffMeasure[][];
  37. MeasureNumberLabels: GraphicalLabel[];
  38. Labels: GraphicalLabel[];
  39. ObjectsToRedraw: [Object[], Object][];
  40. InstrumentBrackets: GraphicalObject[];
  41. GroupBrackets: GraphicalObject[];
  42. GraphicalMarkedAreas: GraphicalMarkedArea[];
  43. GraphicalComments: GraphicalComment[];
  44. SystemLines: SystemLine[];
  45. Id: number;
  46. /**
  47. * This method creates the left vertical Line connecting all staves of the MusicSystem.
  48. * @param lineWidth
  49. * @param systemLabelsRightMargin
  50. */
  51. createSystemLeftLine(lineWidth: number, systemLabelsRightMargin: number): void;
  52. /**
  53. * This method creates the vertical Lines after the End of all StaffLine's Measures
  54. * @param xPosition
  55. * @param lineWidth
  56. * @param lineType
  57. * @param linePosition indicates if the line belongs to start or end of measure
  58. * @param measureIndex the measure index within the staffline
  59. * @param measure
  60. */
  61. createVerticalLineForMeasure(xPosition: number, lineWidth: number, lineType: SystemLinesEnum, linePosition: SystemLinePosition, measureIndex: number, measure: StaffMeasure): void;
  62. setYPositionsToVerticalLineObjectsAndCreateLines(rules: EngravingRules): void;
  63. calculateBorders(rules: EngravingRules): void;
  64. alignBeginInstructions(): void;
  65. GetLeftBorderAbsoluteXPosition(): number;
  66. GetRightBorderAbsoluteXPosition(): number;
  67. AddStaffMeasures(graphicalMeasures: StaffMeasure[]): void;
  68. GetSystemsFirstTimeStamp(): Fraction;
  69. GetSystemsLastTimeStamp(): Fraction;
  70. createInstrumentBrackets(instruments: Instrument[], staffHeight: number): void;
  71. createGroupBrackets(instrumentGroups: InstrumentalGroup[], staffHeight: number, recursionDepth: number): void;
  72. createMusicSystemLabel(instrumentLabelTextHeight: number, systemLabelsRightMargin: number, labelMarginBorderFactor: number): void;
  73. setMusicSystemLabelsYPosition(): void;
  74. checkStaffEntriesForStaffEntryLink(): boolean;
  75. getBottomStaffLine(topStaffLine: StaffLine): StaffLine;
  76. /**
  77. * Here the system line is generated, which acts as the container of graphical lines and dots that will be finally rendered.
  78. * It holds al the logical parameters of the system line.
  79. * @param xPosition The x position within the system
  80. * @param lineWidth The total x width
  81. * @param lineType The line type enum
  82. * @param linePosition indicates if the line belongs to start or end of measure
  83. * @param musicSystem
  84. * @param topMeasure
  85. * @param bottomMeasure
  86. */
  87. protected createSystemLine(xPosition: number, lineWidth: number, lineType: SystemLinesEnum, linePosition: SystemLinePosition, musicSystem: MusicSystem, topMeasure: StaffMeasure, bottomMeasure?: StaffMeasure): SystemLine;
  88. protected createLinesForSystemLine(systemLine: SystemLine): void;
  89. protected calcInstrumentsBracketsWidth(): number;
  90. protected createInstrumentBracket(rightUpper: PointF2D, rightLower: PointF2D): void;
  91. protected createGroupBracket(rightUpper: PointF2D, rightLower: PointF2D, staffHeight: number, recursionDepth: number): void;
  92. private findFirstVisibleInstrumentInInstrumentalGroup(instrumentalGroup);
  93. private findLastVisibleInstrumentInInstrumentalGroup(instrumentalGroup);
  94. private updateMusicSystemStaffLineXPosition(systemLabelsRightMargin);
  95. }