import { StaffLine } from "./StaffLine" ; import { InstantaneousDynamicExpression } from "../VoiceData/Expressions/InstantaneousDynamicExpression" ; import { GraphicalMeasure } from "./GraphicalMeasure" ; import { AbstractGraphicalExpression } from "./AbstractGraphicalExpression" ; import { SkyBottomLineCalculator } from "./SkyBottomLineCalculator" ; import { PlacementEnum } from "../VoiceData/Expressions/AbstractExpression" ; import log from "loglevel" ; export class GraphicalInstantaneousDynamicExpression extends AbstractGraphicalExpression { protected mInstantaneousDynamicExpression : InstantaneousDynamicExpression ; protected mMeasure : GraphicalMeasure ; constructor ( instantaneousDynamic , staffLine , measure ) { super ( staffLine , instantaneousDynamic , measure . parentSourceMeasure ) ; this . mInstantaneousDynamicExpression = instantaneousDynamic ; this . mMeasure = measure ; } public updateSkyBottomLine ( ) { const skyBottomLineCalculator = this . parentStaffLine . SkyBottomLineCalculator ; const left = this . PositionAndShape . RelativePosition . x + this . PositionAndShape . BorderMarginLeft ; const right = this . PositionAndShape . RelativePosition . x + this . PositionAndShape . BorderMarginRight ; let yValue = 0 ; switch ( this . Placement ) { case PlacementEnum . Above : yValue = this . PositionAndShape . RelativePosition . y + this . PositionAndShape . BorderMarginTop ; skyBottomLineCalculator . updateSkyLineInRange ( left , right , yValue ) ; break ; case PlacementEnum . Below : yValue = this . PositionAndShape . RelativePosition . y + this . PositionAndShape . BorderMarginBottom ; skyBottomLineCalculator . updateBottomLineInRange ( left , right , yValue ) ; break ; default : log . error ( "Placement for GraphicalInstantaneousDynamicExpression is unknown" ) ; } } }