Exemplo n.º 1
0
 public static void __hx_ctor_alphatab_model_Tuning(global::alphatab.model.Tuning __temp_me87, string name, global::haxe.root.Array <int> tuning, bool isStandard)
 {
     unchecked
     {
         __temp_me87.name       = name;
         __temp_me87.tuning     = tuning;
         __temp_me87.isStandard = isStandard;
     }
 }
Exemplo n.º 2
0
        public static global::alphatab.model.Tuning findTuning(global::haxe.root.Array <int> strings)
        {
            unchecked
            {
                global::haxe.root.Array <object> tunings = global::alphatab.model.Tuning.getPresetsFor(strings.length);
                {
                    int _g = 0;
                    while ((_g < tunings.length))
                    {
                        global::alphatab.model.Tuning tuning = ((global::alphatab.model.Tuning)(tunings[_g]));
                        ++_g;
                        bool @equals = true;
                        {
                            int _g2 = 0;
                            int _g1 = strings.length;
                            while ((_g2 < _g1))
                            {
                                int i = _g2++;
                                if ((strings[i] != tuning.tuning[i]))
                                {
                                    @equals = false;
                                    break;
                                }
                            }
                        }

                        if (@equals)
                        {
                            return(tuning);
                        }
                    }
                }

                return(default(global::alphatab.model.Tuning));
            }
        }
Exemplo n.º 3
0
        public virtual int paintScoreInfo(int x, int y)
        {
            unchecked
            {
                int flags = default(int);
                if (this.renderer.settings.layout.@get <bool>("hideInfo", false))
                {
                    flags = 0;
                }
                else
                {
                    flags = 511;
                }

                global::alphatab.model.Score score = this.renderer._get_score();
                double scale = this.renderer.settings.scale;
                global::alphatab.platform.ICanvas             canvas = this.renderer.canvas;
                global::alphatab.rendering.RenderingResources res    = this.renderer.renderingResources;
                canvas.setColor(new global::alphatab.platform.model.Color(((int)(0)), ((int)(0)), ((int)(0)), ((global::haxe.lang.Null <int>)(default(global::haxe.lang.Null <int>)))));
                canvas.setTextAlign(global::alphatab.platform.model.TextAlign.Center);
                double tX   = default(double);
                double size = default(double);
                string str  = "";
                if ((!(this.isNullOrEmpty(score.title)) && (((flags & 1)) != 0)))
                {
                    this.drawCentered(score.title, res.titleFont, y);
                    {
                        double x1 = global::System.Math.Floor(((double)((35 * scale))));
                        y += ((int)(x1));
                    }
                }

                if ((!(this.isNullOrEmpty(score.subTitle)) && (((flags & 2)) != 0)))
                {
                    this.drawCentered(score.subTitle, res.subTitleFont, y);
                    {
                        double x2 = global::System.Math.Floor(((double)((20 * scale))));
                        y += ((int)(x2));
                    }
                }

                if ((!(this.isNullOrEmpty(score.artist)) && (((flags & 4)) != 0)))
                {
                    this.drawCentered(score.artist, res.subTitleFont, y);
                    {
                        double x3 = global::System.Math.Floor(((double)((20 * scale))));
                        y += ((int)(x3));
                    }
                }

                if ((!(this.isNullOrEmpty(score.album)) && (((flags & 8)) != 0)))
                {
                    this.drawCentered(score.album, res.subTitleFont, y);
                    {
                        double x4 = global::System.Math.Floor(((double)((20 * scale))));
                        y += ((int)(x4));
                    }
                }

                if (((!(this.isNullOrEmpty(score.music)) && string.Equals(score.music, score.words)) && (((flags & 64)) != 0)))
                {
                    this.drawCentered(global::haxe.lang.Runtime.concat("Music and Words by ", score.words), res.wordsFont, y);
                    {
                        double x5 = global::System.Math.Floor(((double)((20 * scale))));
                        y += ((int)(x5));
                    }
                }
                else
                {
                    canvas.setFont(res.wordsFont);
                    if ((!(this.isNullOrEmpty(score.music)) && (((flags & 32)) != 0)))
                    {
                        canvas.setTextAlign(global::alphatab.platform.model.TextAlign.Right);
                        canvas.fillText(global::haxe.lang.Runtime.concat("Music by ", score.music), ((double)((this.width - global::alphatab.rendering.layout.PageViewLayout.PagePadding[2]))), ((double)(y)));
                    }

                    if ((!(this.isNullOrEmpty(score.words)) && (((flags & 16)) != 0)))
                    {
                        canvas.setTextAlign(global::alphatab.platform.model.TextAlign.Left);
                        canvas.fillText(global::haxe.lang.Runtime.concat("Words by ", score.music), ((double)(x)), ((double)(y)));
                    }

                    {
                        double x6 = global::System.Math.Floor(((double)((20 * scale))));
                        y += ((int)(x6));
                    }
                }

                {
                    double x7 = global::System.Math.Floor(((double)((20 * scale))));
                    y += ((int)(x7));
                }

                if (!(this.renderer.track.isPercussion))
                {
                    canvas.setTextAlign(global::alphatab.platform.model.TextAlign.Left);
                    global::alphatab.model.Tuning tuning = global::alphatab.model.Tuning.findTuning(this.renderer.track.tuning);
                    if ((tuning != default(global::alphatab.model.Tuning)))
                    {
                        canvas.setFont(res.effectFont);
                        canvas.fillText(tuning.name, ((double)(x)), ((double)(y)));
                        {
                            double x8 = global::System.Math.Floor(((double)((15 * scale))));
                            y += ((int)(x8));
                        }

                        if (!(tuning.isStandard))
                        {
                            int stringsPerColumn = default(int);
                            {
                                double x9 = global::System.Math.Ceiling(((double)((((double)(this.renderer.track.tuning.length)) / 2))));
                                stringsPerColumn = ((int)(x9));
                            }

                            int currentX = x;
                            int currentY = y;
                            {
                                int _g1 = 0;
                                int _g  = this.renderer.track.tuning.length;
                                while ((_g1 < _g))
                                {
                                    int i = _g1++;
                                    str = global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("(", global::Std.@string((i + 1))), ") = "), global::alphatab.model.Tuning.getTextForTuning(this.renderer.track.tuning[i], false));
                                    canvas.fillText(str, ((double)(currentX)), ((double)(currentY)));
                                    {
                                        double x10 = global::System.Math.Floor(((double)((15 * scale))));
                                        currentY += ((int)(x10));
                                    }

                                    if ((i == (stringsPerColumn - 1)))
                                    {
                                        currentY = y;
                                        {
                                            double x11 = global::System.Math.Floor(((double)((43 * scale))));
                                            currentX += ((int)(x11));
                                        }
                                    }
                                }
                            }

                            int __temp_stmt479 = default(int);
                            {
                                double x12 = global::System.Math.Floor(((double)((15 * scale))));
                                __temp_stmt479 = ((int)(x12));
                            }

                            y += (stringsPerColumn * __temp_stmt479);
                        }
                    }
                }

                {
                    double x13 = global::System.Math.Floor(((double)((25 * scale))));
                    y += ((int)(x13));
                }

                return(y);
            }
        }
Exemplo n.º 4
0
        public virtual int doScoreInfoLayout(int y)
        {
            unchecked
            {
                int flags = default(int);
                if (this.renderer.settings.layout.@get <bool>("hideInfo", false))
                {
                    flags = 0;
                }
                else
                {
                    flags = 511;
                }

                global::alphatab.model.Score score = this.renderer._get_score();
                double scale = this.renderer.settings.scale;
                if ((!(this.isNullOrEmpty(score.title)) && (((flags & 1)) != 0)))
                {
                    {
                        double x = global::System.Math.Floor(((double)((35 * scale))));
                        y += ((int)(x));
                    }
                }

                if ((!(this.isNullOrEmpty(score.subTitle)) && (((flags & 2)) != 0)))
                {
                    {
                        double x1 = global::System.Math.Floor(((double)((20 * scale))));
                        y += ((int)(x1));
                    }
                }

                if ((!(this.isNullOrEmpty(score.artist)) && (((flags & 4)) != 0)))
                {
                    {
                        double x2 = global::System.Math.Floor(((double)((20 * scale))));
                        y += ((int)(x2));
                    }
                }

                if ((!(this.isNullOrEmpty(score.album)) && (((flags & 8)) != 0)))
                {
                    {
                        double x3 = global::System.Math.Floor(((double)((20 * scale))));
                        y += ((int)(x3));
                    }
                }

                if (((!(this.isNullOrEmpty(score.music)) && string.Equals(score.music, score.words)) && (((flags & 64)) != 0)))
                {
                    {
                        double x4 = global::System.Math.Floor(((double)((20 * scale))));
                        y += ((int)(x4));
                    }
                }
                else
                {
                    if ((!(this.isNullOrEmpty(score.music)) && (((flags & 32)) != 0)))
                    {
                        {
                            double x5 = global::System.Math.Floor(((double)((20 * scale))));
                            y += ((int)(x5));
                        }
                    }

                    if ((!(this.isNullOrEmpty(score.words)) && (((flags & 16)) != 0)))
                    {
                        {
                            double x6 = global::System.Math.Floor(((double)((20 * scale))));
                            y += ((int)(x6));
                        }
                    }
                }

                {
                    double x7 = global::System.Math.Floor(((double)((20 * scale))));
                    y += ((int)(x7));
                }

                if (!(this.renderer.track.isPercussion))
                {
                    global::alphatab.model.Tuning tuning = global::alphatab.model.Tuning.findTuning(this.renderer.track.tuning);
                    if ((tuning != default(global::alphatab.model.Tuning)))
                    {
                        {
                            double x8 = global::System.Math.Floor(((double)((15 * scale))));
                            y += ((int)(x8));
                        }

                        if (!(tuning.isStandard))
                        {
                            int stringsPerColumn = default(int);
                            {
                                double x9 = global::System.Math.Ceiling(((double)((((double)(this.renderer.track.tuning.length)) / 2))));
                                stringsPerColumn = ((int)(x9));
                            }

                            int __temp_stmt478 = default(int);
                            {
                                double x10 = global::System.Math.Floor(((double)((15 * scale))));
                                __temp_stmt478 = ((int)(x10));
                            }

                            y += (stringsPerColumn * __temp_stmt478);
                        }

                        {
                            double x11 = global::System.Math.Floor(((double)((15 * scale))));
                            y += ((int)(x11));
                        }
                    }
                }

                {
                    double x12 = global::System.Math.Floor(((double)((40 * scale))));
                    y += ((int)(x12));
                }

                return(y);
            }
        }