VexFlowInstantaneousDynamicExpression.ts 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. import { GraphicalInstantaneousDynamicExpression } from "../GraphicalInstantaneousDynamicExpression";
  2. import { InstantaneousDynamicExpression, DynamicEnum } from "../../VoiceData/Expressions/InstantaneousDynamicExpression";
  3. import { GraphicalLabel } from "../GraphicalLabel";
  4. import { Label } from "../../Label";
  5. import { TextAlignmentEnum } from "../../../Common/Enums/TextAlignment";
  6. import { FontStyles } from "../../../Common/Enums/FontStyles";
  7. import { StaffLine } from "../StaffLine";
  8. import { GraphicalMeasure } from "../GraphicalMeasure";
  9. export class VexFlowInstantaneousDynamicExpression extends GraphicalInstantaneousDynamicExpression {
  10. constructor(instantaneousDynamicExpression: InstantaneousDynamicExpression, staffLine: StaffLine, measure: GraphicalMeasure) {
  11. super(instantaneousDynamicExpression, staffLine, measure);
  12. this.label = new GraphicalLabel(new Label(this.Expression),
  13. this.rules.ContinuousDynamicTextHeight,
  14. TextAlignmentEnum.CenterCenter,
  15. this.PositionAndShape);
  16. this.label.Label.fontStyle = FontStyles.BoldItalic;
  17. this.label.setLabelPositionAndShapeBorders();
  18. this.PositionAndShape.calculateBoundingBox();
  19. }
  20. get InstantaneousDynamic(): InstantaneousDynamicExpression {
  21. return this.mInstantaneousDynamicExpression;
  22. }
  23. get Expression(): string {
  24. return DynamicEnum[this.mInstantaneousDynamicExpression.DynEnum];
  25. }
  26. }