import { LyricsEntry } from "../VoiceData/Lyrics/LyricsEntry" ; import { GraphicalLyricWord } from "./GraphicalLyricWord" ; import { GraphicalLabel } from "./GraphicalLabel" ; import { GraphicalStaffEntry } from "./GraphicalStaffEntry" ; import { Label } from "../Label" ; import { PointF2D } from "../../Common/DataObjects/PointF2D" ; import { TextAlignmentEnum } from "../../Common/Enums/TextAlignment" ; /**
 * The graphical counterpart of a [[LyricsEntry]]
 */ export class GraphicalLyricEntry { private lyricsEntry : LyricsEntry ; private graphicalLyricWord : GraphicalLyricWord ; private graphicalLabel : GraphicalLabel ; private graphicalStaffEntry : GraphicalStaffEntry ; constructor ( lyricsEntry , graphicalStaffEntry , lyricsHeight , staffHeight ) { this . lyricsEntry = lyricsEntry ; this . graphicalStaffEntry = graphicalStaffEntry ; const lyricsTextAlignment = graphicalStaffEntry . parentMeasure . parentSourceMeasure . Rules . LyricsAlignmentStandard ; if ( lyricsEntry . Text . length >= 4 && lyricsEntry . Parent . Notes [ 0 ] . Length . Denominator > 4 && lyricsTextAlignment === TextAlignmentEnum . LeftBottom ) { } const label = new Label ( lyricsEntry . Text ) ; this . graphicalLabel = new GraphicalLabel ( label , lyricsHeight , lyricsTextAlignment , this . graphicalStaffEntry . parentMeasure . parentSourceMeasure . Rules , graphicalStaffEntry . PositionAndShape ) ; this . graphicalLabel . PositionAndShape . RelativePosition = new PointF2D ( 0 , staffHeight ) ; if ( lyricsTextAlignment === TextAlignmentEnum . LeftBottom ) { this . graphicalLabel . PositionAndShape . RelativePosition . x -= 1 ; } } public get LyricsEntry ( ) : LyricsEntry { return this . lyricsEntry ; } public get ParentLyricWord ( ) : GraphicalLyricWord { return this . graphicalLyricWord ; } public set ParentLyricWord ( value ) { this . graphicalLyricWord = value ; } public get GraphicalLabel ( ) : GraphicalLabel { return this . graphicalLabel ; } public set GraphicalLabel ( value ) { this . graphicalLabel = value ; } public get StaffEntryParent ( ) : GraphicalStaffEntry { return this . graphicalStaffEntry ; } public set StaffEntryParent ( value ) { this . graphicalStaffEntry = value ; } }