GraphicalLyricEntry.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import {LyricsEntry} from "../VoiceData/Lyrics/LyricsEntry";
  2. import {GraphicalLyricWord} from "./GraphicalLyricWord";
  3. import {GraphicalLabel} from "./GraphicalLabel";
  4. import {GraphicalStaffEntry} from "./GraphicalStaffEntry";
  5. import {Label} from "../Label";
  6. import {TextAlignment} from "../../Common/Enums/TextAlignment";
  7. import {PointF2D} from "../../Common/DataObjects/PointF2D";
  8. export class GraphicalLyricEntry {
  9. private lyricsEntry: LyricsEntry;
  10. private graphicalLyricWord: GraphicalLyricWord;
  11. private graphicalLabel: GraphicalLabel;
  12. private graphicalStaffEntry: GraphicalStaffEntry;
  13. constructor(lyricsEntry: LyricsEntry, graphicalStaffEntry: GraphicalStaffEntry, lyricsHeight: number, staffHeight: number) {
  14. this.lyricsEntry = lyricsEntry;
  15. this.graphicalStaffEntry = graphicalStaffEntry;
  16. this.graphicalLabel = new GraphicalLabel(
  17. new Label(lyricsEntry.Text),
  18. lyricsHeight,
  19. TextAlignment.CenterBottom,
  20. graphicalStaffEntry.PositionAndShape
  21. );
  22. this.graphicalLabel.PositionAndShape.RelativePosition = new PointF2D(0.0, staffHeight);
  23. }
  24. public get GetLyricsEntry(): LyricsEntry {
  25. return this.lyricsEntry;
  26. }
  27. public get ParentLyricWord(): GraphicalLyricWord {
  28. return this.graphicalLyricWord;
  29. }
  30. public set ParentLyricWord(value: GraphicalLyricWord) {
  31. this.graphicalLyricWord = value;
  32. }
  33. public get GraphicalLabel(): GraphicalLabel {
  34. return this.graphicalLabel;
  35. }
  36. public set GraphicalLabel(value: GraphicalLabel) {
  37. this.graphicalLabel = value;
  38. }
  39. public get StaffEntryParent(): GraphicalStaffEntry {
  40. return this.graphicalStaffEntry;
  41. }
  42. public set StaffEntryParent(value: GraphicalStaffEntry) {
  43. this.graphicalStaffEntry = value;
  44. }
  45. }