コード例 #1
0
		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();
					}
					
				}
				
			}
		}
コード例 #2
0
        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();
                    }
                }
            }
        }