Example #1
0
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			int size = ((int) (( 6 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
			canvas.beginPath();
			canvas.moveTo(((double) (( cx + this.x )) ), ((double) (( cy + this.y )) ));
			canvas.quadraticCurveTo(((double) (( ( cx + this.x ) + ( this.width / 2 ) )) ), ((double) (( cy + this.y )) ), ((double) (( ( cx + this.x ) + this.width )) ), ((double) (( ( cy + this.y ) - size )) ));
			canvas.moveTo(((double) (( cx + this.x )) ), ((double) (( cy + this.y )) ));
			canvas.quadraticCurveTo(((double) (( ( cx + this.x ) + ( this.width / 2 ) )) ), ((double) (( cy + this.y )) ), ((double) (( ( cx + this.x ) + this.width )) ), ((double) (( ( cy + this.y ) + size )) ));
			canvas.stroke();
		}
	}
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			double height = ( 17 * this.renderer.stave.staveGroup.layout.renderer.settings.scale );
			global::alphatab.rendering.RenderingResources res = this.renderer.stave.staveGroup.layout.renderer.renderingResources;
			canvas.setColor(res.mainGlyphColor);
			canvas.beginPath();
			if (( this._crescendo == global::alphatab.rendering.glyphs.CrescendoType.Crescendo )) 
			{
				canvas.moveTo(((double) (( ( cx + this.x ) + this.width )) ), ((double) (( cy + this.y )) ));
				canvas.lineTo(((double) (( cx + this.x )) ), ((double) (( ( cy + this.y ) + ((int) (( height / 2 )) ) )) ));
				canvas.lineTo(((double) (( ( cx + this.x ) + this.width )) ), ( ( cy + this.y ) + height ));
			}
			 else 
			{
				canvas.moveTo(((double) (( cx + this.x )) ), ((double) (( cy + this.y )) ));
				canvas.lineTo(((double) (( ( cx + this.x ) + this.width )) ), ((double) (( ( cy + this.y ) + ((int) (( height / 2 )) ) )) ));
				canvas.lineTo(((double) (( cx + this.x )) ), ( ( cy + this.y ) + height ));
			}
			
			canvas.stroke();
		}
	}
Example #3
0
	public virtual   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			{
				int _g = 0;
				global::haxe.root.Array<object> _g1 = this.staves;
				while (( _g < _g1.length ))
				{
					global::alphatab.rendering.staves.Stave s = ((global::alphatab.rendering.staves.Stave) (_g1[_g]) );
					 ++ _g;
					s.paint(( cx + this.x ), ( cy + this.y ), canvas);
				}
				
			}
			
			global::alphatab.rendering.RenderingResources res = this.layout.renderer.renderingResources;
			if (( this.staves.length > 0 )) 
			{
				if (( ( this._firstStaveInAccolade != default(global::alphatab.rendering.staves.Stave) ) && ( this._lastStaveInAccolade != default(global::alphatab.rendering.staves.Stave) ) )) 
				{
					int firstStart = ( ( ( ( ( cy + this.y ) + this._firstStaveInAccolade.y ) + this._firstStaveInAccolade.staveTop ) + this._firstStaveInAccolade.topSpacing ) + this._firstStaveInAccolade.getTopOverflow() );
					int lastEnd = ( ( ( ( ( cy + this.y ) + this._lastStaveInAccolade.y ) + this._lastStaveInAccolade.topSpacing ) + this._lastStaveInAccolade.getTopOverflow() ) + this._lastStaveInAccolade.staveBottom );
					canvas.setColor(res.barSeperatorColor);
					canvas.beginPath();
					canvas.moveTo(((double) (( ( cx + this.x ) + this._firstStaveInAccolade.x )) ), ((double) (firstStart) ));
					canvas.lineTo(((double) (( ( cx + this.x ) + this._lastStaveInAccolade.x )) ), ((double) (lastEnd) ));
					canvas.stroke();
					int barSize = ((int) (( 3 * this.layout.renderer.settings.scale )) );
					int barOffset = barSize;
					int accoladeStart = ( firstStart - ( barSize * 4 ) );
					int accoladeEnd = ( lastEnd + ( barSize * 4 ) );
					canvas.fillRect(((double) (( ( ( cx + this.x ) - barOffset ) - barSize )) ), ((double) (accoladeStart) ), ((double) (barSize) ), ((double) (( accoladeEnd - accoladeStart )) ));
					int spikeStartX = ( ( ( cx + this.x ) - barOffset ) - barSize );
					int spikeEndX = ( ( cx + this.x ) + ( barSize * 2 ) );
					canvas.beginPath();
					canvas.moveTo(((double) (spikeStartX) ), ((double) (accoladeStart) ));
					canvas.bezierCurveTo(((double) (spikeStartX) ), ((double) (accoladeStart) ), ((double) (this.x) ), ((double) (accoladeStart) ), ((double) (spikeEndX) ), ((double) (( accoladeStart - barSize )) ));
					canvas.bezierCurveTo(((double) (( cx + this.x )) ), ((double) (( accoladeStart + barSize )) ), ((double) (spikeStartX) ), ((double) (( accoladeStart + barSize )) ), ((double) (spikeStartX) ), ((double) (( accoladeStart + barSize )) ));
					canvas.closePath();
					canvas.fill();
					canvas.beginPath();
					canvas.moveTo(((double) (spikeStartX) ), ((double) (accoladeEnd) ));
					canvas.bezierCurveTo(((double) (spikeStartX) ), ((double) (accoladeEnd) ), ((double) (this.x) ), ((double) (accoladeEnd) ), ((double) (spikeEndX) ), ((double) (( accoladeEnd + barSize )) ));
					canvas.bezierCurveTo(((double) (this.x) ), ((double) (( accoladeEnd - barSize )) ), ((double) (spikeStartX) ), ((double) (( accoladeEnd - barSize )) ), ((double) (spikeStartX) ), ((double) (( accoladeEnd - barSize )) ));
					canvas.closePath();
					canvas.fill();
				}
				
			}
			
		}
	}
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			global::alphatab.rendering.RenderingResources res = this.renderer.stave.staveGroup.layout.renderer.renderingResources;
			canvas.setColor(res.barSeperatorColor);
			double blockWidth = ( 4 * this.renderer.stave.staveGroup.layout.renderer.settings.scale );
			int top = ( ( cy + this.y ) + this.renderer.getTopPadding() );
			int bottom = ( ( ( cy + this.y ) + this.renderer.height ) - this.renderer.getBottomPadding() );
			double left = ((double) (( cx + this.x )) );
			int h = ( bottom - top );
			canvas.beginPath();
			canvas.moveTo(left, ((double) (top) ));
			canvas.lineTo(left, ((double) (bottom) ));
			canvas.stroke();
			if (this._isLast) 
			{
				left += ( ( 3 * this.renderer.stave.staveGroup.layout.renderer.settings.scale ) + 0.5 );
				canvas.fillRect(left, ((double) (top) ), blockWidth, ((double) (h) ));
			}
			
		}
	}
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			global::alphatab.rendering.TabBarRenderer tabBarRenderer = ((global::alphatab.rendering.TabBarRenderer) (this.renderer) );
			global::alphatab.rendering.RenderingResources res = this.renderer.stave.staveGroup.layout.renderer.renderingResources;
			double startX = ( ( cx + this.x ) + ( ((double) (this._parent.onNotes.width) ) / 2 ) );
			double endX = default(double);
			if (( ( this._beat.nextBeat == default(global::alphatab.model.Beat) ) || ( this._beat.voice != this._beat.nextBeat.voice ) )) 
			{
				endX = ( ( ( cx + this.x ) + ( ((double) (this._parent.onNotes.width) ) / 2 ) ) + this._parent.postNotes.width );
			}
			 else 
			{
				endX = ((double) (( cx + tabBarRenderer.getBeatX(this._beat.nextBeat) )) );
			}
			
			int startY = ( cy + this.y );
			int textOffset = ((int) (( 3 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
			int sizeY = ((int) (( 60 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
			canvas.setTextAlign(global::alphatab.platform.model.TextAlign.Center);
			if (( this._beat.whammyBarPoints.length >= 2 )) 
			{
				double dx = ( (( endX - startX )) / 60 );
				double dy = ( ((double) (sizeY) ) / 24 );
				canvas.beginPath();
				{
					int _g1 = 0;
					int _g = ( this._beat.whammyBarPoints.length - 1 );
					while (( _g1 < _g ))
					{
						int i = _g1++;
						global::alphatab.model.BendPoint pt1 = ((global::alphatab.model.BendPoint) (this._beat.whammyBarPoints[i]) );
						global::alphatab.model.BendPoint pt2 = ((global::alphatab.model.BendPoint) (this._beat.whammyBarPoints[( i + 1 )]) );
						if (( ( pt1.@value == pt2.@value ) && ( i == ( this._beat.whammyBarPoints.length - 2 ) ) )) 
						{
							continue;
						}
						
						int pt1X = ((int) (( startX + ( dx * pt1.offset ) )) );
						int pt1Y = ((int) (( startY - ( dy * pt1.@value ) )) );
						int pt2X = ((int) (( startX + ( dx * pt2.offset ) )) );
						int pt2Y = ((int) (( startY - ( dy * pt2.@value ) )) );
						canvas.moveTo(((double) (pt1X) ), ((double) (pt1Y) ));
						canvas.lineTo(((double) (pt2X) ), ((double) (pt2Y) ));
						if (( pt2.@value != 0 )) 
						{
							double dv = ( pt2.@value / 4.0 );
							bool up = ( ( pt2.@value - pt1.@value ) >= 0 );
							string s = "";
							if (( dv < 0 )) 
							{
								s = global::haxe.lang.Runtime.concat(s, "-");
							}
							
							if (( ( dv >= 1 ) || ( dv <= -1 ) )) 
							{
								int __temp_stmt605 = default(int);
								{
									double v = global::System.Math.Abs(((double) (dv) ));
									{
										double x = global::System.Math.Floor(((double) (v) ));
										__temp_stmt605 = ((int) (x) );
									}
									
								}
								
								string __temp_stmt604 = global::Std.@string(__temp_stmt605);
								string __temp_stmt603 = global::haxe.lang.Runtime.concat(__temp_stmt604, " ");
								s = global::haxe.lang.Runtime.concat(s, __temp_stmt603);
							}
							
							{
								double x1 = global::System.Math.Floor(((double) (dv) ));
								dv -= ((double) (((int) (x1) )) );
							}
							
							if (( dv == 0.25 )) 
							{
								s = global::haxe.lang.Runtime.concat(s, "1/4");
							}
							 else 
							{
								if (( dv == 0.5 )) 
								{
									s = global::haxe.lang.Runtime.concat(s, "1/2");
								}
								 else 
								{
									if (( dv == 0.75 )) 
									{
										s = global::haxe.lang.Runtime.concat(s, "3/4");
									}
									
								}
								
							}
							
							canvas.setFont(res.graceFont);
							double size = canvas.measureText(s);
							double sy = default(double);
							if (up) 
							{
								sy = ( ( pt2Y - res.graceFont.getSize() ) - textOffset );
							}
							 else 
							{
								sy = ((double) (( pt2Y + textOffset )) );
							}
							
							int sx = pt2X;
							canvas.fillText(s, ((double) (sx) ), sy);
						}
						
					}
					
				}
				
				canvas.stroke();
			}
			
		}
	}
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			global::alphatab.rendering.TabBarRenderer tabBarRenderer = ((global::alphatab.rendering.TabBarRenderer) (this.renderer) );
			global::alphatab.rendering.RenderingResources res = this.renderer.stave.staveGroup.layout.renderer.renderingResources;
			int startY = default(int);
			int __temp_stmt600 = default(int);
			{
				double x = ( tabBarRenderer.getNoteY(this._beat.maxNote()) - ( res.tablatureFont.getSize() / 2 ) );
				__temp_stmt600 = ((int) (x) );
			}
			
			startY = ( ( cy + this.y ) + __temp_stmt600 );
			double endY = ( ( ( cy + this.y ) + tabBarRenderer.getNoteY(this._beat.minNote()) ) + ( res.tablatureFont.getSize() / 2 ) );
			int arrowX = ((int) (( ( cx + this.x ) + ( ((double) (this.width) ) / 2 ) )) );
			double arrowSize = ( 8 * this.renderer.stave.staveGroup.layout.renderer.settings.scale );
			canvas.setColor(res.mainGlyphColor);
			if (( this._beat.brushType != global::alphatab.model.BrushType.None )) 
			{
				if (( ( this._beat.brushType == global::alphatab.model.BrushType.BrushUp ) || ( this._beat.brushType == global::alphatab.model.BrushType.BrushDown ) )) 
				{
					canvas.beginPath();
					canvas.moveTo(((double) (arrowX) ), ((double) (startY) ));
					canvas.lineTo(((double) (arrowX) ), endY);
					canvas.stroke();
				}
				 else 
				{
					int size = ((int) (( 15 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
					int steps = default(int);
					{
						double v = ( global::System.Math.Abs(((double) (( endY - startY )) )) / size );
						{
							double x1 = global::System.Math.Floor(((double) (v) ));
							steps = ((int) (x1) );
						}
						
					}
					
					{
						int _g = 0;
						while (( _g < ((int) (steps) ) ))
						{
							int i = _g++;
							global::alphatab.rendering.glyphs.SvgGlyph arrow = new global::alphatab.rendering.glyphs.SvgGlyph(new global::haxe.lang.Null<int>(((int) (( 3 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) ), true), new global::haxe.lang.Null<int>(0, true), ((global::alphatab.rendering.glyphs.LazySvg) (global::alphatab.rendering.glyphs.MusicFont.WaveVertical) ), ((double) (1) ), ((double) (1) ));
							arrow.renderer = this.renderer;
							arrow.doLayout();
							arrow.paint(( cx + this.x ), ( startY + ( i * size ) ), canvas);
						}
						
					}
					
				}
				
				if (( ( this._beat.brushType == global::alphatab.model.BrushType.BrushUp ) || ( this._beat.brushType == global::alphatab.model.BrushType.ArpeggioUp ) )) 
				{
					canvas.beginPath();
					canvas.moveTo(((double) (arrowX) ), endY);
					canvas.lineTo(((double) (((int) (( arrowX + ( arrowSize / 2 ) )) )) ), ((double) (((int) (( endY - arrowSize )) )) ));
					canvas.lineTo(((double) (((int) (( arrowX - ( arrowSize / 2 ) )) )) ), ((double) (((int) (( endY - arrowSize )) )) ));
					canvas.closePath();
					canvas.fill();
				}
				 else 
				{
					canvas.beginPath();
					canvas.moveTo(((double) (arrowX) ), ((double) (startY) ));
					canvas.lineTo(((double) (((int) (( arrowX + ( arrowSize / 2 ) )) )) ), ((double) (((int) (( startY + arrowSize )) )) ));
					canvas.lineTo(((double) (((int) (( arrowX - ( arrowSize / 2 ) )) )) ), ((double) (((int) (( startY + arrowSize )) )) ));
					canvas.closePath();
					canvas.fill();
				}
				
			}
			
		}
	}
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			if (( this._endings.length > 0 )) 
			{
				global::alphatab.rendering.RenderingResources res = this.stave.staveGroup.layout.renderer.renderingResources;
				canvas.setColor(res.mainGlyphColor);
				canvas.setFont(res.wordsFont);
				canvas.moveTo(((double) (( cx + this.x )) ), ((double) (( ( cy + this.y ) + this.height )) ));
				canvas.lineTo(((double) (( cx + this.x )) ), ((double) (( cy + this.y )) ));
				canvas.lineTo(((double) (( ( cx + this.x ) + this.width )) ), ((double) (( cy + this.y )) ));
				canvas.stroke();
				canvas.fillText(this._endingsString, ((double) (((int) (( ( cx + this.x ) + ( 3 * this.stave.staveGroup.layout.renderer.settings.scale ) )) )) ), ((double) (((int) (( cy + ( this.y * this.stave.staveGroup.layout.renderer.settings.scale ) )) )) ));
			}
			
		}
	}
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			double step = ( 11 * this.renderer.stave.staveGroup.layout.renderer.settings.scale );
			int loops = default(int);
			{
				double v = global::System.Math.Max(((double) (1) ), ((double) (( this.width / step )) ));
				{
					double x = global::System.Math.Floor(((double) (v) ));
					loops = ((int) (x) );
				}
				
			}
			
			global::alphatab.rendering.RenderingResources res = this.renderer.stave.staveGroup.layout.renderer.renderingResources;
			canvas.setColor(res.mainGlyphColor);
			canvas.setFont(res.effectFont);
			canvas.setTextAlign(global::alphatab.platform.model.TextAlign.Left);
			double textWidth = canvas.measureText(this._label);
			canvas.fillText(this._label, ((double) (( cx + this.x )) ), ((double) (( cy + this.y )) ));
			if (this._isExpanded) 
			{
				int lineSpacing = ((int) (( 3 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
				double startX = ( ( ( cx + this.x ) + textWidth ) + lineSpacing );
				int endX = ( ( ( ( cx + this.x ) + this.width ) - lineSpacing ) - lineSpacing );
				int lineY = ( ( cy + this.y ) + ((int) (( 8 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) ) );
				int lineSize = ((int) (( 8 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
				if (( endX > startX )) 
				{
					double lineX = startX;
					while (( lineX < endX ))
					{
						canvas.beginPath();
						canvas.moveTo(lineX, ((double) (lineY) ));
						int __temp_stmt606 = default(int);
						{
							double x1 = global::System.Math.Min(((double) (( lineX + lineSize )) ), ((double) (endX) ));
							__temp_stmt606 = ((int) (x1) );
						}
						
						canvas.lineTo(((double) (__temp_stmt606) ), ((double) (lineY) ));
						lineX += ((double) (( lineSize + lineSpacing )) );
						canvas.stroke();
					}
					
					canvas.beginPath();
					canvas.moveTo(((double) (endX) ), ((double) (( lineY - ((int) (( 6 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) ) )) ));
					canvas.lineTo(((double) (endX) ), ((double) (( lineY + ((int) (( 6 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) ) )) ));
					canvas.stroke();
				}
				
			}
			
		}
	}
	public override   void paintBackground(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			global::alphatab.rendering.RenderingResources res = this.stave.staveGroup.layout.renderer.renderingResources;
			canvas.setColor(res.staveLineColor);
			int lineY = ( ( cy + this.y ) + this.getNumberOverflow() );
			int startY = lineY;
			{
				int _g1 = 0;
				int _g = this._bar.track.tuning.length;
				while (( _g1 < _g ))
				{
					int i = _g1++;
					if (( i > 0 )) 
					{
						lineY += ((int) (( 11 * this.stave.staveGroup.layout.renderer.settings.scale )) );
					}
					
					canvas.beginPath();
					canvas.moveTo(((double) (( cx + this.x )) ), ((double) (lineY) ));
					canvas.lineTo(((double) (( ( cx + this.x ) + this.width )) ), ((double) (lineY) ));
					canvas.stroke();
				}
				
			}
			
		}
	}
	public virtual   void drawInfoGuide(global::alphatab.platform.ICanvas canvas, int cx, int cy, int y, global::alphatab.platform.model.Color c)
	{
		unchecked 
		{
			canvas.setColor(c);
			canvas.beginPath();
			canvas.moveTo(((double) (( cx + this.x )) ), ((double) (( ( cy + this.y ) + y )) ));
			canvas.lineTo(((double) (( ( cx + this.x ) + this.width )) ), ((double) (( ( cy + this.y ) + y )) ));
			canvas.stroke();
		}
	}
	public virtual   void paintFooter(int cx, int cy, global::alphatab.platform.ICanvas canvas, global::alphatab.rendering.utils.BeamingHelper h)
	{
		unchecked 
		{
			global::alphatab.model.Beat beat = ((global::alphatab.model.Beat) (h.beats[0]) );
			if (( beat.duration == global::alphatab.model.Duration.Whole )) 
			{
				return ;
			}
			
			bool isGrace = ( beat.graceType != global::alphatab.model.GraceType.None );
			double scaleMod = default(double);
			if (isGrace) 
			{
				scaleMod = 0.7;
			}
			 else 
			{
				scaleMod = ((double) (1) );
			}
			
			int stemSize = this.getStemSize(h.maxDuration);
			int correction = ((int) (( ( 9 * scaleMod ) / 2 )) );
			int beatLineX = default(int);
			{
				double x = ( h.getBeatLineX(beat) + this.stave.staveGroup.layout.renderer.settings.scale );
				beatLineX = ((int) (x) );
			}
			
			global::alphatab.rendering.utils.BeamDirection direction = h.getDirection();
			int topY = this.getScoreY(this.getNoteLine(beat.maxNote()), new global::haxe.lang.Null<int>(correction, true));
			int bottomY = this.getScoreY(this.getNoteLine(beat.minNote()), new global::haxe.lang.Null<int>(correction, true));
			int beamY = default(int);
			if (( direction == global::alphatab.rendering.utils.BeamDirection.Down )) 
			{
				bottomY += ((int) (( stemSize * scaleMod )) );
				beamY = bottomY;
			}
			 else 
			{
				topY -= ((int) (( stemSize * scaleMod )) );
				beamY = topY;
			}
			
			canvas.setColor(this.stave.staveGroup.layout.renderer.renderingResources.mainGlyphColor);
			canvas.beginPath();
			canvas.moveTo(((double) (((int) (( ( cx + this.x ) + beatLineX )) )) ), ((double) (( ( cy + this.y ) + topY )) ));
			canvas.lineTo(((double) (((int) (( ( cx + this.x ) + beatLineX )) )) ), ((double) (( ( cy + this.y ) + bottomY )) ));
			canvas.stroke();
			if (isGrace) 
			{
				double graceSizeY = ( 15 * this.stave.staveGroup.layout.renderer.settings.scale );
				double graceSizeX = ( 12 * this.stave.staveGroup.layout.renderer.settings.scale );
				canvas.beginPath();
				if (( direction == global::alphatab.rendering.utils.BeamDirection.Down )) 
				{
					canvas.moveTo(((double) (((int) (( ( ( cx + this.x ) + beatLineX ) - ( graceSizeX / 2 ) )) )) ), ( ( ( cy + this.y ) + bottomY ) - graceSizeY ));
					canvas.lineTo(((double) (((int) (( ( ( cx + this.x ) + beatLineX ) + ( graceSizeX / 2 ) )) )) ), ((double) (( ( cy + this.y ) + bottomY )) ));
				}
				 else 
				{
					canvas.moveTo(((double) (((int) (( ( ( cx + this.x ) + beatLineX ) - ( graceSizeX / 2 ) )) )) ), ( ( ( cy + this.y ) + topY ) + graceSizeY ));
					canvas.lineTo(((double) (((int) (( ( ( cx + this.x ) + beatLineX ) + ( graceSizeX / 2 ) )) )) ), ((double) (( ( cy + this.y ) + topY )) ));
				}
				
				canvas.stroke();
			}
			
			int gx = ((int) (beatLineX) );
			global::alphatab.rendering.glyphs.BeamGlyph glyph = new global::alphatab.rendering.glyphs.BeamGlyph(new global::haxe.lang.Null<int>(gx, true), new global::haxe.lang.Null<int>(beamY, true), ((global::alphatab.model.Duration) (beat.duration) ), ((global::alphatab.rendering.utils.BeamDirection) (direction) ), ((bool) (isGrace) ));
			glyph.renderer = this;
			glyph.doLayout();
			glyph.paint(( cx + this.x ), ( cy + this.y ), canvas);
		}
	}
	public virtual   void paintBar(int cx, int cy, global::alphatab.platform.ICanvas canvas, global::alphatab.rendering.utils.BeamingHelper h)
	{
		unchecked 
		{
			int _g1 = 0;
			int _g = h.beats.length;
			while (( _g1 < _g ))
			{
				int i = _g1++;
				global::alphatab.model.Beat beat = ((global::alphatab.model.Beat) (h.beats[i]) );
				int correction = 4;
				int beatLineX = default(int);
				{
					double x = ( h.getBeatLineX(beat) + this.stave.staveGroup.layout.renderer.settings.scale );
					beatLineX = ((int) (x) );
				}
				
				global::alphatab.rendering.utils.BeamDirection direction = h.getDirection();
				int y1 = default(int);
				y1 = ( ( cy + this.y ) + (( (( direction == global::alphatab.rendering.utils.BeamDirection.Up )) ? (this.getScoreY(this.getNoteLine(beat.minNote()), new global::haxe.lang.Null<int>(( correction - 1 ), true))) : (this.getScoreY(this.getNoteLine(beat.maxNote()), new global::haxe.lang.Null<int>(( correction - 1 ), true))) )) );
				int y2 = ( ( cy + this.y ) + this.calculateBeamY(h, beatLineX) );
				canvas.setColor(this.stave.staveGroup.layout.renderer.renderingResources.mainGlyphColor);
				canvas.beginPath();
				canvas.moveTo(((double) (((int) (( ( cx + this.x ) + beatLineX )) )) ), ((double) (y1) ));
				canvas.lineTo(((double) (((int) (( ( cx + this.x ) + beatLineX )) )) ), ((double) (y2) ));
				canvas.stroke();
				int brokenBarOffset = ((int) (( 6 * this.stave.staveGroup.layout.renderer.settings.scale )) );
				int barSpacing = ((int) (( 6 * this.stave.staveGroup.layout.renderer.settings.scale )) );
				int barSize = ((int) (( 3 * this.stave.staveGroup.layout.renderer.settings.scale )) );
				int barCount = ( global::alphatab.model.ModelUtils.getDurationIndex(beat.duration) - 2 );
				int barStart = ( cy + this.y );
				if (( direction == global::alphatab.rendering.utils.BeamDirection.Down )) 
				{
					barSpacing =  - (barSpacing) ;
				}
				
				{
					int _g2 = 0;
					while (( _g2 < ((int) (barCount) ) ))
					{
						int barIndex = _g2++;
						int barStartX = default(int);
						int barEndX = default(int);
						int barStartY = default(int);
						int barEndY = default(int);
						int barY = ( barStart + ( barIndex * barSpacing ) );
						if (( i < ( h.beats.length - 1 ) )) 
						{
							if (this.isFullBarJoin(beat, ((global::alphatab.model.Beat) (h.beats[( i + 1 )]) ), barIndex)) 
							{
								barStartX = beatLineX;
								{
									double x1 = ( h.getBeatLineX(((global::alphatab.model.Beat) (h.beats[( i + 1 )]) )) + this.stave.staveGroup.layout.renderer.settings.scale );
									barEndX = ((int) (x1) );
								}
								
							}
							 else 
							{
								if (( ( i == 0 ) ||  ! (this.isFullBarJoin(((global::alphatab.model.Beat) (h.beats[( i - 1 )]) ), beat, barIndex))  )) 
								{
									barStartX = beatLineX;
									barEndX = ( barStartX + brokenBarOffset );
								}
								 else 
								{
									continue;
								}
								
							}
							
							{
								double x2 = ((double) (( barY + this.calculateBeamY(h, barStartX) )) );
								barStartY = ((int) (x2) );
							}
							
							{
								double x3 = ((double) (( barY + this.calculateBeamY(h, barEndX) )) );
								barEndY = ((int) (x3) );
							}
							
							global::alphatab.rendering.ScoreBarRenderer.paintSingleBar(canvas, ( ( cx + this.x ) + barStartX ), barStartY, ( ( cx + this.x ) + barEndX ), barEndY, barSize);
						}
						 else 
						{
							if (( ( i > 0 ) &&  ! (this.isFullBarJoin(beat, ((global::alphatab.model.Beat) (h.beats[( i - 1 )]) ), barIndex))  )) 
							{
								barStartX = ( beatLineX - brokenBarOffset );
								barEndX = beatLineX;
								{
									double x4 = ((double) (( barY + this.calculateBeamY(h, barStartX) )) );
									barStartY = ((int) (x4) );
								}
								
								{
									double x5 = ((double) (( barY + this.calculateBeamY(h, barEndX) )) );
									barEndY = ((int) (x5) );
								}
								
								global::alphatab.rendering.ScoreBarRenderer.paintSingleBar(canvas, ( ( cx + this.x ) + barStartX ), barStartY, ( ( cx + this.x ) + barEndX ), barEndY, barSize);
							}
							
						}
						
					}
					
				}
				
			}
			
		}
	}
	public virtual   void paintTupletHelper(int cx, int cy, global::alphatab.platform.ICanvas canvas, global::alphatab.rendering.utils.TupletHelper h)
	{
		unchecked 
		{
			global::alphatab.rendering.RenderingResources res = this.stave.staveGroup.layout.renderer.renderingResources;
			global::alphatab.platform.model.TextAlign oldAlign = canvas.getTextAlign();
			canvas.setTextAlign(global::alphatab.platform.model.TextAlign.Center);
			if (( ( h.beats.length == 1 ) ||  ! ((( h.beats.length == h.tuplet )))  )) 
			{
				int _g1 = 0;
				int _g = h.beats.length;
				while (( _g1 < _g ))
				{
					int i = _g1++;
					global::alphatab.model.Beat beat = ((global::alphatab.model.Beat) (h.beats[i]) );
					global::alphatab.rendering.utils.BeamingHelper beamingHelper = ((global::alphatab.rendering.utils.BeamingHelper) (((global::haxe.ds.IntMap<object>) (global::haxe.ds.IntMap<object>.__hx_cast<object>(((global::haxe.ds.IntMap) (this._beamHelperLookup[h.voiceIndex]) ))) ).@get(beat.index).@value) );
					global::alphatab.rendering.utils.BeamDirection direction = beamingHelper.getDirection();
					int tupletX = default(int);
					{
						double x = ( beamingHelper.getBeatLineX(beat) + this.stave.staveGroup.layout.renderer.settings.scale );
						tupletX = ((int) (x) );
					}
					
					int tupletY = ( ( cy + this.y ) + this.calculateBeamY(beamingHelper, tupletX) );
					int offset = default(int);
					if (( direction == global::alphatab.rendering.utils.BeamDirection.Up )) 
					{
						double x1 = ( res.effectFont.getSize() * 1.8 );
						offset = ((int) (x1) );
					}
					 else 
					{
						offset =  - ((((int) (( 3 * this.stave.staveGroup.layout.renderer.settings.scale )) ))) ;
					}
					
					canvas.setFont(res.effectFont);
					canvas.fillText(global::Std.@string(h.tuplet), ((double) (( ( cx + this.x ) + tupletX )) ), ((double) (( tupletY - offset )) ));
				}
				
			}
			 else 
			{
				global::alphatab.model.Beat firstBeat = ((global::alphatab.model.Beat) (h.beats[0]) );
				global::alphatab.model.Beat lastBeat = ((global::alphatab.model.Beat) (h.beats[( h.beats.length - 1 )]) );
				global::alphatab.rendering.utils.BeamingHelper beamingHelper1 = ((global::alphatab.rendering.utils.BeamingHelper) (((global::haxe.ds.IntMap<object>) (global::haxe.ds.IntMap<object>.__hx_cast<object>(((global::haxe.ds.IntMap) (this._beamHelperLookup[h.voiceIndex]) ))) ).@get(firstBeat.index).@value) );
				global::alphatab.rendering.utils.BeamDirection direction1 = beamingHelper1.getDirection();
				int startX = default(int);
				{
					double x2 = ( beamingHelper1.getBeatLineX(firstBeat) + this.stave.staveGroup.layout.renderer.settings.scale );
					startX = ((int) (x2) );
				}
				
				int endX = default(int);
				{
					double x3 = ( beamingHelper1.getBeatLineX(lastBeat) + this.stave.staveGroup.layout.renderer.settings.scale );
					endX = ((int) (x3) );
				}
				
				canvas.setFont(res.effectFont);
				string s = global::Std.@string(h.tuplet);
				double sw = canvas.measureText(s);
				int sp = ((int) (( 3 * this.stave.staveGroup.layout.renderer.settings.scale )) );
				int middleX = ( (( startX + endX )) / 2 );
				int offset1X = ((int) (( ( middleX - ( sw / 2 ) ) - sp )) );
				int offset2X = ((int) (( ( middleX + ( sw / 2 ) ) + sp )) );
				int startY = this.calculateBeamY(beamingHelper1, startX);
				int offset1Y = this.calculateBeamY(beamingHelper1, offset1X);
				int middleY = this.calculateBeamY(beamingHelper1, middleX);
				int offset2Y = this.calculateBeamY(beamingHelper1, offset2X);
				int endY = this.calculateBeamY(beamingHelper1, endX);
				int offset1 = ((int) (( 10 * this.stave.staveGroup.layout.renderer.settings.scale )) );
				int size = ((int) (( 5 * this.stave.staveGroup.layout.renderer.settings.scale )) );
				if (( direction1 == global::alphatab.rendering.utils.BeamDirection.Down )) 
				{
					offset1 *= -1;
					size *= -1;
				}
				
				canvas.beginPath();
				canvas.moveTo(((double) (( ( cx + this.x ) + startX )) ), ((double) (( ( ( cy + this.y ) + startY ) - offset1 )) ));
				canvas.lineTo(((double) (( ( cx + this.x ) + startX )) ), ((double) (( ( ( ( cy + this.y ) + startY ) - offset1 ) - size )) ));
				canvas.lineTo(((double) (( ( cx + this.x ) + offset1X )) ), ((double) (( ( ( ( cy + this.y ) + offset1Y ) - offset1 ) - size )) ));
				canvas.stroke();
				canvas.beginPath();
				canvas.moveTo(((double) (( ( cx + this.x ) + offset2X )) ), ((double) (( ( ( ( cy + this.y ) + offset2Y ) - offset1 ) - size )) ));
				canvas.lineTo(((double) (( ( cx + this.x ) + endX )) ), ((double) (( ( ( ( cy + this.y ) + endY ) - offset1 ) - size )) ));
				canvas.lineTo(((double) (( ( cx + this.x ) + endX )) ), ((double) (( ( ( cy + this.y ) + endY ) - offset1 )) ));
				canvas.stroke();
				canvas.fillText(s, ((double) (( ( cx + this.x ) + middleX )) ), ( ( ( ( ( cy + this.y ) + middleY ) - offset1 ) - size ) - res.effectFont.getSize() ));
			}
			
			canvas.setTextAlign(oldAlign);
		}
	}
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			global::alphatab.rendering.RenderingResources res = this.renderer.stave.staveGroup.layout.renderer.renderingResources;
			canvas.setColor(res.mainGlyphColor);
			double blockWidth = ( 4 * this.renderer.stave.staveGroup.layout.renderer.settings.scale );
			int top = ( ( cy + this.y ) + this.renderer.getTopPadding() );
			int bottom = ( ( ( cy + this.y ) + this.renderer.height ) - this.renderer.getBottomPadding() );
			double left = ((double) (( cx + this.x )) );
			int h = ( bottom - top );
			double circleSize = ( 1.5 * this.renderer.stave.staveGroup.layout.renderer.settings.scale );
			double middle = ( ((double) ((( top + bottom ))) ) / 2 );
			int dotOffset = 3;
			canvas.beginPath();
			canvas.circle(left, ( middle - ( circleSize * dotOffset ) ), circleSize);
			canvas.circle(left, ( middle + ( circleSize * dotOffset ) ), circleSize);
			canvas.fill();
			left += ( 4 * this.renderer.stave.staveGroup.layout.renderer.settings.scale );
			canvas.beginPath();
			canvas.moveTo(left, ((double) (top) ));
			canvas.lineTo(left, ((double) (bottom) ));
			canvas.stroke();
			left += ( ( 3 * this.renderer.stave.staveGroup.layout.renderer.settings.scale ) + 0.5 );
			canvas.fillRect(left, ((double) (top) ), blockWidth, ((double) (h) ));
		}
	}
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			global::alphatab.rendering.ScoreBarRenderer r = ((global::alphatab.rendering.ScoreBarRenderer) (this.renderer) );
			int sizeX = ((int) (( 12 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
			int offsetX = ((int) (this.renderer.stave.staveGroup.layout.renderer.settings.scale) );
			int startX = default(int);
			int startY = default(int);
			int endX = default(int);
			int endY = default(int);
			{
				global::alphatab.model.SlideType _g = this._type;
				switch (global::haxe.root.Type.enumIndex(_g))
				{
					case 1:case 2:
					{
						startX = ( ( cx + r.getNoteX(this._startNote, new global::haxe.lang.Null<bool>(true, true)) ) + offsetX );
						startY = ( ( cy + r.getNoteY(this._startNote) ) + 4 );
						if (( this._startNote.slideTarget != default(global::alphatab.model.Note) )) 
						{
							endX = ( ( cx + r.getNoteX(this._startNote.slideTarget, new global::haxe.lang.Null<bool>(false, true)) ) - offsetX );
							endY = ( ( cy + r.getNoteY(this._startNote.slideTarget) ) + 4 );
						}
						 else 
						{
							endX = ( ( ( cx + this._parent.x ) + this._parent.postNotes.x ) + this._parent.postNotes.width );
							endY = startY;
						}
						
						break;
					}
					
					
					case 3:
					{
						endX = ( ( cx + r.getNoteX(this._startNote, new global::haxe.lang.Null<bool>(false, true)) ) - offsetX );
						endY = ( ( cy + r.getNoteY(this._startNote) ) + 4 );
						startX = ( endX - sizeX );
						startY = ( ( cy + r.getNoteY(this._startNote) ) + 9 );
						break;
					}
					
					
					case 4:
					{
						endX = ( ( cx + r.getNoteX(this._startNote, new global::haxe.lang.Null<bool>(false, true)) ) - offsetX );
						endY = ( ( cy + r.getNoteY(this._startNote) ) + 4 );
						startX = ( endX - sizeX );
						startY = ( cy + r.getNoteY(this._startNote) );
						break;
					}
					
					
					case 5:
					{
						startX = ( ( cx + r.getNoteX(this._startNote, new global::haxe.lang.Null<bool>(true, true)) ) + offsetX );
						startY = ( ( cy + r.getNoteY(this._startNote) ) + 4 );
						endX = ( startX + sizeX );
						endY = ( cy + r.getNoteY(this._startNote) );
						break;
					}
					
					
					case 6:
					{
						startX = ( ( cx + r.getNoteX(this._startNote, new global::haxe.lang.Null<bool>(true, true)) ) + offsetX );
						startY = ( ( cy + r.getNoteY(this._startNote) ) + 4 );
						endX = ( startX + sizeX );
						endY = ( ( cy + r.getNoteY(this._startNote) ) + 9 );
						break;
					}
					
					
					default:
					{
						return ;
					}
					
				}
				
			}
			
			canvas.setColor(this.renderer.stave.staveGroup.layout.renderer.renderingResources.mainGlyphColor);
			canvas.beginPath();
			canvas.moveTo(((double) (startX) ), ((double) (startY) ));
			canvas.lineTo(((double) (endX) ), ((double) (endY) ));
			canvas.stroke();
		}
	}
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			global::alphatab.rendering.ScoreBarRenderer scoreRenderer = ((global::alphatab.rendering.ScoreBarRenderer) (this.renderer) );
			int effectY = default(int);
			if (( this.beamingHelper.getDirection() == global::alphatab.rendering.utils.BeamDirection.Up )) 
			{
				effectY = scoreRenderer.getScoreY(((int) (global::haxe.lang.Runtime.getField_f(this.maxNote, "line", 1202919412, true)) ), new global::haxe.lang.Null<int>(13, true));
			}
			 else 
			{
				effectY = scoreRenderer.getScoreY(((int) (global::haxe.lang.Runtime.getField_f(this.minNote, "line", 1202919412, true)) ), new global::haxe.lang.Null<int>(-9, true));
			}
			
			int effectSpacing = default(int);
			if (( this.beamingHelper.getDirection() == global::alphatab.rendering.utils.BeamDirection.Up )) 
			{
				effectSpacing = ((int) (( 7 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
			}
			 else 
			{
				effectSpacing = ((int) (( -7 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
			}
			
			{
				object __temp_iterator448 = this.beatEffects.iterator();
				while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator448, "hasNext", 407283053, default(global::haxe.root.Array))) ))
				{
					global::alphatab.rendering.Glyph g = ((global::alphatab.rendering.Glyph) (global::haxe.lang.Runtime.callField(__temp_iterator448, "next", 1224901875, default(global::haxe.root.Array))) );
					g.y = effectY;
					g.x = ( this.width / 2 );
					g.paint(( cx + this.x ), ( cy + this.y ), canvas);
					effectY += effectSpacing;
				}
				
			}
			
			canvas.setColor(this.renderer.stave.staveGroup.layout.renderer.renderingResources.staveLineColor);
			int linePadding = ((int) (( 3 * this.renderer.stave.staveGroup.layout.renderer.settings.scale )) );
			if (this.hasTopOverflow()) 
			{
				int l = -1;
				while (( global::haxe.lang.Runtime.compare(l, ((int) (global::haxe.lang.Runtime.getField_f(this.minNote, "line", 1202919412, true)) )) >= 0 ))
				{
					int lY = ( ( cy + this.y ) + scoreRenderer.getScoreY(( l + 1 ), new global::haxe.lang.Null<int>(-1, true)) );
					canvas.beginPath();
					canvas.moveTo(((double) (( ( cx + this.x ) - linePadding )) ), ((double) (lY) ));
					canvas.lineTo(((double) (( ( ( cx + this.x ) + this.width ) + linePadding )) ), ((double) (lY) ));
					canvas.stroke();
					l -= 2;
				}
				
			}
			
			if (this.hasBottomOverflow()) 
			{
				int l1 = 11;
				while (( global::haxe.lang.Runtime.compare(l1, ((int) (global::haxe.lang.Runtime.getField_f(this.maxNote, "line", 1202919412, true)) )) <= 0 ))
				{
					int lY1 = ( ( cy + this.y ) + scoreRenderer.getScoreY(( l1 + 1 ), new global::haxe.lang.Null<int>(-1, true)) );
					canvas.beginPath();
					canvas.moveTo(((double) (( ( cx + this.x ) - linePadding )) ), ((double) (lY1) ));
					canvas.lineTo(((double) (( ( ( cx + this.x ) + this.width ) + linePadding )) ), ((double) (lY1) ));
					canvas.stroke();
					l1 += 2;
				}
				
			}
			
			if (( this._tremoloPicking != default(global::alphatab.rendering.Glyph) )) 
			{
				this._tremoloPicking.paint(( cx + this.x ), ( cy + this.y ), canvas);
			}
			
			{
				int _g = 0;
				global::haxe.root.Array<object> _g1 = this._infos;
				while (( _g < _g1.length ))
				{
					object g1 = _g1[_g];
					 ++ _g;
					((global::alphatab.rendering.Glyph) (global::haxe.lang.Runtime.getField(g1, "glyph", 369425836, true)) ).renderer = this.renderer;
					((global::alphatab.rendering.Glyph) (global::haxe.lang.Runtime.getField(g1, "glyph", 369425836, true)) ).paint(( cx + this.x ), ( cy + this.y ), canvas);
				}
				
			}
			
		}
	}
Example #17
0
	public override   void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
	{
		unchecked 
		{
			global::alphatab.rendering.TabBarRenderer r = ((global::alphatab.rendering.TabBarRenderer) (this.renderer) );
			global::alphatab.rendering.RenderingResources res = this.renderer.stave.staveGroup.layout.renderer.renderingResources;
			double dX = ( ((double) (this.width) ) / 60 );
			int maxValue = 0;
			{
				int _g1 = 0;
				int _g = this._note.bendPoints.length;
				while (( _g1 < _g ))
				{
					int i = _g1++;
					if (( ((global::alphatab.model.BendPoint) (this._note.bendPoints[i]) ).@value > maxValue )) 
					{
						maxValue = ((global::alphatab.model.BendPoint) (this._note.bendPoints[i]) ).@value;
					}
					
				}
				
			}
			
			double dY = ( ((double) (this._height) ) / maxValue );
			int xx = ( cx + this.x );
			int yy = ( ( cy + this.y ) + r.getNoteY(this._note) );
			canvas.beginPath();
			{
				int _g11 = 0;
				int _g2 = ( this._note.bendPoints.length - 1 );
				while (( _g11 < _g2 ))
				{
					int i1 = _g11++;
					global::alphatab.model.BendPoint firstPt = ((global::alphatab.model.BendPoint) (this._note.bendPoints[i1]) );
					global::alphatab.model.BendPoint secondPt = ((global::alphatab.model.BendPoint) (this._note.bendPoints[( i1 + 1 )]) );
					if (( ( firstPt.@value == secondPt.@value ) && ( i1 == ( this._note.bendPoints.length - 2 ) ) )) 
					{
						continue;
					}
					
					double x1 = ( xx + ( dX * firstPt.offset ) );
					double y1 = ( yy - ( dY * firstPt.@value ) );
					double x2 = ( xx + ( dX * secondPt.offset ) );
					double y2 = ( yy - ( dY * secondPt.@value ) );
					if (( firstPt.@value == secondPt.@value )) 
					{
						canvas.moveTo(x1, y1);
						canvas.lineTo(x2, y2);
						canvas.stroke();
					}
					 else 
					{
						double hx = ( x1 + (( x2 - x1 )) );
						double hy = ( yy - ( dY * firstPt.@value ) );
						canvas.moveTo(x1, y1);
						canvas.bezierCurveTo(hx, hy, x2, y2, x2, y2);
						canvas.stroke();
					}
					
					double arrowSize = ( 6 * this.renderer.stave.staveGroup.layout.renderer.settings.scale );
					if (( secondPt.@value > firstPt.@value )) 
					{
						canvas.beginPath();
						canvas.moveTo(x2, y2);
						canvas.lineTo(( x2 - ( arrowSize * 0.5 ) ), ( y2 + arrowSize ));
						canvas.lineTo(( x2 + ( arrowSize * 0.5 ) ), ( y2 + arrowSize ));
						canvas.closePath();
						canvas.fill();
					}
					 else 
					{
						if (( secondPt.@value != firstPt.@value )) 
						{
							canvas.beginPath();
							canvas.moveTo(x2, y2);
							canvas.lineTo(( x2 - ( arrowSize * 0.5 ) ), ( y2 - arrowSize ));
							canvas.lineTo(( x2 + ( arrowSize * 0.5 ) ), ( y2 - arrowSize ));
							canvas.closePath();
							canvas.fill();
						}
						
					}
					
					canvas.stroke();
					if (( secondPt.@value != 0 )) 
					{
						double dV = ((double) (( secondPt.@value - firstPt.@value )) );
						bool up = ( dV > 0 );
						dV = global::System.Math.Abs(((double) (dV) ));
						string s = "";
						if (( dV == 4 )) 
						{
							s = "full";
							dV -= ((double) (4) );
						}
						 else 
						{
							if (( dV > 4 )) 
							{
								int __temp_stmt594 = default(int);
								{
									double x = global::System.Math.Floor(((double) (( dV / 4 )) ));
									__temp_stmt594 = ((int) (x) );
								}
								
								string __temp_stmt593 = global::Std.@string(__temp_stmt594);
								string __temp_stmt592 = global::haxe.lang.Runtime.concat(__temp_stmt593, " ");
								s = global::haxe.lang.Runtime.concat(s, __temp_stmt592);
								{
									double x3 = global::System.Math.Floor(((double) (dV) ));
									dV -= ((double) (((int) (x3) )) );
								}
								
							}
							
						}
						
						if (( dV > 0 )) 
						{
							s = global::haxe.lang.Runtime.concat(s, global::haxe.lang.Runtime.concat(global::Std.@string(dV), "/4"));
						}
						
						if ( ! (string.Equals(s, "")) ) 
						{
							if ( ! (up) ) 
							{
								s = global::haxe.lang.Runtime.concat("-", s);
							}
							
							canvas.setFont(res.tablatureFont);
							double size = canvas.measureText(s);
							double y = default(double);
							if (up) 
							{
								y = ( ( y2 - res.tablatureFont.getSize() ) - ( 2 * this.renderer.stave.staveGroup.layout.renderer.settings.scale ) );
							}
							 else 
							{
								y = ( y2 + ( 2 * this.renderer.stave.staveGroup.layout.renderer.settings.scale ) );
							}
							
							double x4 = ( x2 - ( size / 2 ) );
							canvas.fillText(s, x4, y);
						}
						
					}
					
				}
				
			}
			
		}
	}