示例#1
0
        public override void createPreBeatGlyphs()
        {
            unchecked
            {
                global::alphatab.model.MasterBar __temp_stmt567 = default(global::alphatab.model.MasterBar);
                {
                    global::alphatab.model.Bar _this = this._bar;
                    __temp_stmt567 = ((global::alphatab.model.MasterBar)(_this.track.score.masterBars[_this.index]));
                }

                if (__temp_stmt567.isRepeatStart)
                {
                    this.addPreBeatGlyph(new global::alphatab.rendering.glyphs.RepeatOpenGlyph(new global::haxe.lang.Null <int>(0, true), new global::haxe.lang.Null <int>(0, true), ((double)(1.5)), ((int)(3))));
                }

                if ((this.index == 0))
                {
                    this.addPreBeatGlyph(new global::alphatab.rendering.glyphs.TabClefGlyph());
                }

                this.addPreBeatGlyph(new global::alphatab.rendering.glyphs.BarNumberGlyph(new global::haxe.lang.Null <int>(0, true), new global::haxe.lang.Null <int>(this.getTabY(-1, new global::haxe.lang.Null <int>(-3, true)), true), ((int)((this._bar.index + 1))), new global::haxe.lang.Null <bool>(!(this.stave.isFirstInAccolade), true)));
                if (this._bar.isEmpty())
                {
                    this.addPreBeatGlyph(new global::alphatab.rendering.glyphs.SpacingGlyph(new global::haxe.lang.Null <int>(0, true), new global::haxe.lang.Null <int>(0, true), ((int)((30 * this.stave.staveGroup.layout.renderer.settings.scale))), new global::haxe.lang.Null <bool>(false, true)));
                }
            }
        }
示例#2
0
        public override void doLayout()
        {
            unchecked
            {
                if ((this.renderer.settings.staves.length == 0))
                {
                    return;
                }

                int startIndex = this.renderer.settings.layout.@get <int>("start", 1);
                startIndex--;
                {
                    double x = default(double);
                    {
                        double b = global::System.Math.Max(((double)(0)), ((double)(startIndex)));
                        x = global::System.Math.Min(((double)((this.renderer.track.bars.length - 1))), ((double)(b)));
                    }

                    startIndex = ((int)(x));
                }

                int currentBarIndex = startIndex;
                int endBarIndex     = this.renderer.settings.layout.@get <int>("count", this.renderer.track.bars.length);
                endBarIndex = ((startIndex + endBarIndex) - 1);
                {
                    double x1 = default(double);
                    {
                        double b1 = global::System.Math.Max(((double)(0)), ((double)(endBarIndex)));
                        x1 = global::System.Math.Min(((double)((this.renderer.track.bars.length - 1))), ((double)(b1)));
                    }

                    endBarIndex = ((int)(x1));
                }

                int x2 = global::alphatab.rendering.layout.HorizontalScreenLayout.PagePadding[0];
                int y  = global::alphatab.rendering.layout.HorizontalScreenLayout.PagePadding[1];
                this._group = this.createEmptyStaveGroup();
                while ((currentBarIndex <= endBarIndex))
                {
                    global::alphatab.model.Bar bar = ((global::alphatab.model.Bar)(this.renderer.track.bars[currentBarIndex]));
                    this._group.addBar(bar);
                    currentBarIndex++;
                }

                this._group.x = x2;
                this._group.y = y;
                this._group.finalizeGroup(this);
                y          += (this._group.calculateHeight() + ((int)((20 * this.renderer.settings.scale))));
                this.height = (y + global::alphatab.rendering.layout.HorizontalScreenLayout.PagePadding[3]);
                this.width  = ((this._group.x + this._group.width) + global::alphatab.rendering.layout.HorizontalScreenLayout.PagePadding[2]);
            }
        }
示例#3
0
        public virtual global::alphatab.rendering.staves.StaveGroup createStaveGroup(int currentBarIndex, int endIndex)
        {
            unchecked
            {
                global::alphatab.rendering.staves.StaveGroup @group = this.createEmptyStaveGroup();
                int barsPerRow = this.renderer.settings.layout.@get <int>("barsPerRow", -1);
                int maxWidth   = this.getMaxWidth();
                int end        = (endIndex + 1);
                {
                    int _g = currentBarIndex;
                    while ((_g < ((int)(end))))
                    {
                        int i = _g++;
                        global::alphatab.model.Bar bar = ((global::alphatab.model.Bar)(this.renderer.track.bars[i]));
                        @group.addBar(bar);
                        bool groupIsFull = false;
                        if (((barsPerRow == -1) && (((@group.width >= maxWidth) && (@group.bars.length != 0)))))
                        {
                            groupIsFull = true;
                        }
                        else
                        {
                            if ((@group.bars.length == (barsPerRow + 1)))
                            {
                                groupIsFull = true;
                            }
                        }

                        if (groupIsFull)
                        {
                            @group.revertLastBar();
                            @group.isFull = true;
                            return(@group);
                        }

                        @group.x = 0;
                    }
                }

                return(@group);
            }
        }
示例#4
0
		public virtual   void parseBar(global::haxe.root.Xml node)
		{
			unchecked 
			{
				global::alphatab.model.Bar bar = new global::alphatab.model.Bar();
				string barId = node.@get("id");
				{
					object __temp_iterator430 = node.iterator();
					while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator430, "hasNext", 407283053, default(global::haxe.root.Array))) ))
					{
						global::haxe.root.Xml c = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator430, "next", 1224901875, default(global::haxe.root.Array))) );
						if (( c.nodeType == global::haxe.root.Xml.Element )) 
						{
							string _g = c._get_nodeName();
							switch (_g)
							{
								case "Voices":
								{
									this._voicesOfBar.@set(barId, global::haxe.lang.StringExt.split(this.getValue(c), " "));
									break;
								}
								
								
								case "Clef":
								{
									string _g1 = this.getValue(c);
									switch (_g1)
									{
										case "Neutral":
										{
											bar.clef = global::alphatab.model.Clef.Neutral;
											break;
										}
										
										
										case "G2":
										{
											bar.clef = global::alphatab.model.Clef.G2;
											break;
										}
										
										
										case "F4":
										{
											bar.clef = global::alphatab.model.Clef.F4;
											break;
										}
										
										
										case "C4":
										{
											bar.clef = global::alphatab.model.Clef.C4;
											break;
										}
										
										
										case "C3":
										{
											bar.clef = global::alphatab.model.Clef.C3;
											break;
										}
										
										
									}
									
									break;
								}
								
								
							}
							
						}
						
					}
					
				}
				
				this._barsById.@set(barId, bar);
			}
		}
		public virtual   void readBar(global::alphatab.model.Track track)
		{
			unchecked 
			{
				global::alphatab.model.Bar newBar = new global::alphatab.model.Bar();
				if (track.isPercussion) 
				{
					newBar.clef = global::alphatab.model.Clef.Neutral;
				}
				
				track.addBar(newBar);
				int voiceCount = 1;
				if (( this._versionNumber >= 500 )) 
				{
					this._data.readByte();
					voiceCount = 2;
				}
				
				{
					int _g = 0;
					while (( _g < ((int) (voiceCount) ) ))
					{
						int v = _g++;
						this.readVoice(track, newBar);
					}
					
				}
				
			}
		}
		public virtual   void bar()
		{
			unchecked 
			{
				global::alphatab.model.MasterBar master = new global::alphatab.model.MasterBar();
				this._score.addMasterBar(master);
				global::alphatab.model.Bar bar = new global::alphatab.model.Bar();
				this._track.addBar(bar);
				if (( master.index > 0 )) 
				{
					master.keySignature = master.previousMasterBar.keySignature;
					master.timeSignatureDenominator = master.previousMasterBar.timeSignatureDenominator;
					master.timeSignatureNumerator = master.previousMasterBar.timeSignatureNumerator;
					bar.clef = bar.previousBar.clef;
				}
				
				this.barMeta(bar);
				global::alphatab.model.Voice voice = new global::alphatab.model.Voice();
				bar.addVoice(voice);
				while (( ( this._sy != global::alphatab.importer.AlphaTexSymbols.Pipe ) && ( this._sy != global::alphatab.importer.AlphaTexSymbols.Eof ) ))
				{
					this.beat(voice);
				}
				
			}
		}
示例#7
0
		public override   object __hx_setField(string field, int hash, object @value, bool handleProperties)
		{
			unchecked 
			{
				switch (hash)
				{
					case 1565120129:
					{
						this.voices = ((global::haxe.root.Array<object>) (global::haxe.root.Array<object>.__hx_cast<object>(((global::haxe.root.Array) (@value) ))) );
						return @value;
					}
					
					
					case 371166859:
					{
						this.track = ((global::alphatab.model.Track) (@value) );
						return @value;
					}
					
					
					case 1103260490:
					{
						this.clef = ((global::alphatab.model.Clef) (@value) );
						return @value;
					}
					
					
					case 855239132:
					{
						this.previousBar = ((global::alphatab.model.Bar) (@value) );
						return @value;
					}
					
					
					case 624508576:
					{
						this.nextBar = ((global::alphatab.model.Bar) (@value) );
						return @value;
					}
					
					
					case 1041537810:
					{
						this.index = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					default:
					{
						return base.__hx_setField(field, hash, @value, handleProperties);
					}
					
				}
				
			}
		}
示例#8
0
		public override   object __hx_setField(string field, int hash, object @value, bool handleProperties)
		{
			unchecked 
			{
				switch (hash)
				{
					case 810640957:
					{
						this.beats = ((global::haxe.root.Array<object>) (global::haxe.root.Array<object>.__hx_cast<object>(((global::haxe.root.Array) (@value) ))) );
						return @value;
					}
					
					
					case 4895187:
					{
						this.bar = ((global::alphatab.model.Bar) (@value) );
						return @value;
					}
					
					
					case 1041537810:
					{
						this.index = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					default:
					{
						return base.__hx_setField(field, hash, @value, handleProperties);
					}
					
				}
				
			}
		}
		public override   object __hx_setField(string field, int hash, object @value, bool handleProperties)
		{
			unchecked 
			{
				switch (hash)
				{
					case 1058404052:
					{
						this._bar = ((global::alphatab.model.Bar) (@value) );
						return @value;
					}
					
					
					case 1079503181:
					{
						this.bottomOverflow = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 698229495:
					{
						this.topOverflow = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 207609411:
					{
						this.isEmpty = ((bool) (@value) );
						return @value;
					}
					
					
					case 1041537810:
					{
						this.index = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 38537191:
					{
						this.height = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 1247983110:
					{
						this.width = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 121:
					{
						this.y = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 120:
					{
						this.x = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 67860431:
					{
						this.stave = ((global::alphatab.rendering.staves.Stave) (@value) );
						return @value;
					}
					
					
					default:
					{
						return base.__hx_setField(field, hash, @value, handleProperties);
					}
					
				}
				
			}
		}
示例#10
0
 public static void __hx_ctor_alphatab_rendering_TabBarRenderer(global::alphatab.rendering.TabBarRenderer __temp_me104, global::alphatab.model.Bar bar)
 {
     unchecked
     {
         global::alphatab.rendering.GroupedBarRenderer.__hx_ctor_alphatab_rendering_GroupedBarRenderer(__temp_me104, bar);
     }
 }