public virtual double getSvgScale(global::alphatab.model.Duration duration, global::alphatab.rendering.utils.BeamDirection direction, bool isGrace) { unchecked { double scale = default(double); if (isGrace) { scale = 0.7; } else { scale = ((double)(1)); } if ((direction == global::alphatab.rendering.utils.BeamDirection.Up)) { return(scale); } else { return(-1 * scale); } } }
public virtual global::alphatab.rendering.glyphs.LazySvg getRestSvg(global::alphatab.model.Duration duration, global::alphatab.rendering.utils.BeamDirection direction, bool isGrace) { unchecked { if (isGrace) { return(global::alphatab.rendering.glyphs.MusicFont.FooterUpEighth); } switch (global::haxe.root.Type.enumIndex(duration)) { case 3: { return(global::alphatab.rendering.glyphs.MusicFont.FooterUpEighth); } case 4: { return(global::alphatab.rendering.glyphs.MusicFont.FooterUpSixteenth); } case 5: { return(global::alphatab.rendering.glyphs.MusicFont.FooterUpThirtySecond); } case 6: { return(global::alphatab.rendering.glyphs.MusicFont.FooterUpSixtyFourth); } default: { return(default(global::alphatab.rendering.glyphs.LazySvg)); } } } }
public BeamGlyph(global::haxe.lang.Null <int> x, global::haxe.lang.Null <int> y, global::alphatab.model.Duration duration, global::alphatab.rendering.utils.BeamDirection direction, bool isGrace) : base(global::haxe.lang.EmptyObject.EMPTY) { unchecked { global::alphatab.rendering.glyphs.BeamGlyph.__hx_ctor_alphatab_rendering_glyphs_BeamGlyph(this, x, y, duration, direction, isGrace); } }
public static void __hx_ctor_alphatab_rendering_glyphs_BeamGlyph(global::alphatab.rendering.glyphs.BeamGlyph __temp_me129, global::haxe.lang.Null <int> x, global::haxe.lang.Null <int> y, global::alphatab.model.Duration duration, global::alphatab.rendering.utils.BeamDirection direction, bool isGrace) { unchecked { int __temp_y128 = ((global::haxe.lang.Runtime.eq((y).toDynamic(), (default(global::haxe.lang.Null <int>)).toDynamic())) ? (((int)(0))) : (y.@value)); int __temp_x127 = ((global::haxe.lang.Runtime.eq((x).toDynamic(), (default(global::haxe.lang.Null <int>)).toDynamic())) ? (((int)(0))) : (x.@value)); global::alphatab.rendering.glyphs.SvgGlyph.__hx_ctor_alphatab_rendering_glyphs_SvgGlyph(__temp_me129, new global::haxe.lang.Null <int>(__temp_x127, true), new global::haxe.lang.Null <int>(__temp_y128, true), __temp_me129.getRestSvg(duration, direction, isGrace), ((isGrace) ? (0.7) : (((double)(1)))), __temp_me129.getSvgScale(duration, direction, isGrace)); } }
public virtual int calculateBeamY(int stemSize, int xCorrection, int xPosition, double scale, global::haxe.lang.Function yPosition) { unchecked { global::alphatab.rendering.utils.BeamDirection direction = this.getDirection(); if ((this.beats.length == 1)) { if ((this.getDirection() == global::alphatab.rendering.utils.BeamDirection.Up)) { return(((int)(yPosition.__hx_invoke1_f(default(double), this.maxNote))) - stemSize); } else { return(((int)(yPosition.__hx_invoke1_f(default(double), this.minNote))) + stemSize); } } int maxDistance = ((int)((10 * scale))); if ((((direction == global::alphatab.rendering.utils.BeamDirection.Down) && (this.minNote != this.firstMinNote)) && (this.minNote != this.lastMinNote))) { return(((int)(yPosition.__hx_invoke1_f(default(double), this.minNote))) + stemSize); } else { if ((((direction == global::alphatab.rendering.utils.BeamDirection.Up) && (this.maxNote != this.firstMaxNote)) && (this.maxNote != this.lastMaxNote))) { return(((int)(yPosition.__hx_invoke1_f(default(double), this.maxNote))) - stemSize); } } int startX = (this.getBeatLineX(this.firstMinNote.beat) + xCorrection); int startY = default(int); if ((direction == global::alphatab.rendering.utils.BeamDirection.Up)) { startY = (((int)(yPosition.__hx_invoke1_f(default(double), this.firstMaxNote))) - stemSize); } else { startY = (((int)(yPosition.__hx_invoke1_f(default(double), this.firstMinNote))) + stemSize); } int endX = (this.getBeatLineX(this.lastMaxNote.beat) + xCorrection); int endY = default(int); if ((direction == global::alphatab.rendering.utils.BeamDirection.Up)) { endY = (((int)(yPosition.__hx_invoke1_f(default(double), this.lastMaxNote))) - stemSize); } else { endY = (((int)(yPosition.__hx_invoke1_f(default(double), this.lastMinNote))) + stemSize); } if ((((direction == global::alphatab.rendering.utils.BeamDirection.Down) && (startY > endY)) && ((startY - endY) > maxDistance))) { endY = (startY - maxDistance); } if ((((direction == global::alphatab.rendering.utils.BeamDirection.Down) && (endY > startY)) && ((endY - startY) > maxDistance))) { startY = (endY - maxDistance); } if ((((direction == global::alphatab.rendering.utils.BeamDirection.Up) && (startY < endY)) && ((endY - startY) > maxDistance))) { endY = (startY + maxDistance); } if ((((direction == global::alphatab.rendering.utils.BeamDirection.Up) && (endY < startY)) && ((startY - endY) > maxDistance))) { startY = (endY + maxDistance); } return((int)((((((double)(((endY - startY)))) / ((endX - startX))) * ((xPosition - startX))) + startY))); } }