예제 #1
0
        public virtual void applySizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
        {
            unchecked
            {
                int size = default(int);
                int diff = default(int);
                size            = sizes.getPreNoteSize(this.beat.start);
                diff            = (size - this.preNotes.width);
                this.preNotes.x = 0;
                if ((diff > 0))
                {
                    this.preNotes.applyGlyphSpacing(diff);
                }

                size           = sizes.getOnNoteSize(this.beat.start);
                diff           = (size - this.onNotes.width);
                this.onNotes.x = (this.preNotes.x + this.preNotes.width);
                if ((diff > 0))
                {
                    this.onNotes.applyGlyphSpacing(diff);
                }

                size             = sizes.getPostNoteSize(this.beat.start);
                diff             = (size - this.postNotes.width);
                this.postNotes.x = (this.onNotes.x + this.onNotes.width);
                if ((diff > 0))
                {
                    this.postNotes.applyGlyphSpacing(diff);
                }

                this.width = this.calculateWidth();
            }
        }
예제 #2
0
        public virtual void applySizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
        {
            unchecked
            {
                this.width = 0;
                {
                    int _g1 = 0;
                    int _g  = this.beatGlyphs.length;
                    while ((_g1 < _g))
                    {
                        int i = _g1++;
                        if ((i == 0))
                        {
                            ((global::alphatab.rendering.glyphs.BeatContainerGlyph)(this.beatGlyphs[i])).x = 0;
                        }
                        else
                        {
                            ((global::alphatab.rendering.glyphs.BeatContainerGlyph)(this.beatGlyphs[i])).x = (((global::alphatab.rendering.glyphs.BeatContainerGlyph)(this.beatGlyphs[(i - 1)])).x + ((global::alphatab.rendering.glyphs.BeatContainerGlyph)(this.beatGlyphs[(i - 1)])).width);
                        }

                        ((global::alphatab.rendering.glyphs.BeatContainerGlyph)(this.beatGlyphs[i])).applySizes(sizes);
                    }
                }

                if ((this.beatGlyphs.length > 0))
                {
                    this.width = (((global::alphatab.rendering.glyphs.BeatContainerGlyph)(this.beatGlyphs[(this.beatGlyphs.length - 1)])).x + ((global::alphatab.rendering.glyphs.BeatContainerGlyph)(this.beatGlyphs[(this.beatGlyphs.length - 1)])).width);
                }
            }
        }
예제 #3
0
 public virtual void applySizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
 {
     unchecked
     {
         {
         }
     }
 }
예제 #4
0
 public override void applySizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
 {
     unchecked
     {
         base.applySizes(sizes);
         this.width = sizes.fullWidth;
     }
 }
예제 #5
0
 public static void __hx_ctor_alphatab_rendering_staves_BarSizeInfo(global::alphatab.rendering.staves.BarSizeInfo __temp_me264)
 {
     unchecked
     {
         __temp_me264.sizes         = new global::haxe.ds.StringMap <int>();
         __temp_me264.preNoteSizes  = new global::haxe.ds.IntMap <int>();
         __temp_me264.onNoteSizes   = new global::haxe.ds.IntMap <int>();
         __temp_me264.postNoteSizes = new global::haxe.ds.IntMap <int>();
         __temp_me264.fullWidth     = 0;
     }
 }
예제 #6
0
 public virtual void registerMaxSizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
 {
     unchecked
     {
         int _g = 0;
         global::haxe.root.Array <object> _g1 = this.beatGlyphs;
         while ((_g < _g1.length))
         {
             global::alphatab.rendering.glyphs.BeatContainerGlyph b = ((global::alphatab.rendering.glyphs.BeatContainerGlyph)(_g1[_g]));
             ++_g;
             b.registerMaxSizes(sizes);
         }
     }
 }
예제 #7
0
        public override void registerMaxSizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
        {
            unchecked
            {
                int preSize = this.getBeatGlyphsStart();
                if ((sizes.getSize("Pre").@value < preSize))
                {
                    sizes.setSize("Pre", preSize);
                }

                {
                    int _g = 0;
                    global::haxe.root.Array <object> _g1 = this._voiceContainers;
                    while ((_g < _g1.length))
                    {
                        global::alphatab.rendering.glyphs.VoiceContainerGlyph c = ((global::alphatab.rendering.glyphs.VoiceContainerGlyph)(_g1[_g]));
                        ++_g;
                        c.registerMaxSizes(sizes);
                    }
                }

                int postSize = default(int);
                if ((this._postBeatGlyphs.length == 0))
                {
                    postSize = 0;
                }
                else
                {
                    postSize = (((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).x + ((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).width);
                }

                if ((sizes.getSize("Post").@value < postSize))
                {
                    sizes.setSize("Post", postSize);
                }

                if ((sizes.fullWidth < this.width))
                {
                    sizes.fullWidth = this.width;
                }
            }
        }
예제 #8
0
        public virtual void registerMaxSizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
        {
            unchecked
            {
                if ((sizes.getPreNoteSize(this.beat.start) < this.preNotes.width))
                {
                    sizes.preNoteSizes.@set(this.beat.start, this.preNotes.width);
                }

                if ((sizes.getOnNoteSize(this.beat.start) < this.onNotes.width))
                {
                    sizes.onNoteSizes.@set(this.beat.start, this.onNotes.width);
                }

                if ((sizes.getPostNoteSize(this.beat.start) < this.postNotes.width))
                {
                    sizes.postNoteSizes.@set(this.beat.start, this.postNotes.width);
                }
            }
        }
예제 #9
0
        public virtual void addBar(global::alphatab.model.Bar bar)
        {
            unchecked
            {
                this.bars.push(bar);
                global::alphatab.rendering.staves.BarSizeInfo maxSizes = new global::alphatab.rendering.staves.BarSizeInfo();
                {
                    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.addBar(bar);
                        ((global::alphatab.rendering.BarRendererBase)(s.barRenderers[(s.barRenderers.length - 1)])).registerMaxSizes(maxSizes);
                    }
                }

                int realWidth = 0;
                {
                    int _g2 = 0;
                    global::haxe.root.Array <object> _g11 = this.staves;
                    while ((_g2 < _g11.length))
                    {
                        global::alphatab.rendering.staves.Stave s1 = ((global::alphatab.rendering.staves.Stave)(_g11[_g2]));
                        ++_g2;
                        ((global::alphatab.rendering.BarRendererBase)(s1.barRenderers[(s1.barRenderers.length - 1)])).applySizes(maxSizes);
                        if ((((global::alphatab.rendering.BarRendererBase)(s1.barRenderers[(s1.barRenderers.length - 1)])).width > realWidth))
                        {
                            realWidth = ((global::alphatab.rendering.BarRendererBase)(s1.barRenderers[(s1.barRenderers.length - 1)])).width;
                        }
                    }
                }

                this.width += realWidth;
            }
        }
예제 #10
0
		public virtual   void addBar(global::alphatab.model.Bar bar)
		{
			unchecked 
			{
				this.bars.push(bar);
				global::alphatab.rendering.staves.BarSizeInfo maxSizes = new global::alphatab.rendering.staves.BarSizeInfo();
				{
					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.addBar(bar);
						((global::alphatab.rendering.BarRendererBase) (s.barRenderers[( s.barRenderers.length - 1 )]) ).registerMaxSizes(maxSizes);
					}
					
				}
				
				int realWidth = 0;
				{
					int _g2 = 0;
					global::haxe.root.Array<object> _g11 = this.staves;
					while (( _g2 < _g11.length ))
					{
						global::alphatab.rendering.staves.Stave s1 = ((global::alphatab.rendering.staves.Stave) (_g11[_g2]) );
						 ++ _g2;
						((global::alphatab.rendering.BarRendererBase) (s1.barRenderers[( s1.barRenderers.length - 1 )]) ).applySizes(maxSizes);
						if (( ((global::alphatab.rendering.BarRendererBase) (s1.barRenderers[( s1.barRenderers.length - 1 )]) ).width > realWidth )) 
						{
							realWidth = ((global::alphatab.rendering.BarRendererBase) (s1.barRenderers[( s1.barRenderers.length - 1 )]) ).width;
						}
						
					}
					
				}
				
				this.width += realWidth;
			}
		}
예제 #11
0
        public override void applySizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
        {
            unchecked
            {
                global::haxe.lang.Null <int> preSize = sizes.getSize("Pre");
                int preSizeDiff = (preSize.@value - this.getBeatGlyphsStart());
                if ((preSizeDiff > 0))
                {
                    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)(preSizeDiff)), ((global::haxe.lang.Null <bool>)(default(global::haxe.lang.Null <bool>)))));
                }

                {
                    int _g = 0;
                    global::haxe.root.Array <object> _g1 = this._voiceContainers;
                    while ((_g < _g1.length))
                    {
                        global::alphatab.rendering.glyphs.VoiceContainerGlyph c = ((global::alphatab.rendering.glyphs.VoiceContainerGlyph)(_g1[_g]));
                        ++_g;
                        c.applySizes(sizes);
                    }
                }

                global::haxe.lang.Null <int> postSize = sizes.getSize("Post");
                int postSizeDiff = default(int);
                if ((this._postBeatGlyphs.length == 0))
                {
                    postSizeDiff = 0;
                }
                else
                {
                    postSizeDiff = (postSize.@value - ((((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).x + ((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).width)));
                }

                if ((postSizeDiff > 0))
                {
                    this._postBeatGlyphs.insert(0, new global::alphatab.rendering.glyphs.SpacingGlyph(new global::haxe.lang.Null <int>(0, true), new global::haxe.lang.Null <int>(0, true), ((int)(postSizeDiff)), ((global::haxe.lang.Null <bool>)(default(global::haxe.lang.Null <bool>)))));
                    {
                        int _g11 = 0;
                        int _g2  = this._postBeatGlyphs.length;
                        while ((_g11 < _g2))
                        {
                            int i = _g11++;
                            global::alphatab.rendering.Glyph g = ((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[i]));
                            if ((i == 0))
                            {
                                g.x = 0;
                            }
                            else
                            {
                                g.x = (((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).x + ((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).width);
                            }

                            g.index    = i;
                            g.renderer = this;
                        }
                    }
                }

                this.updateWidth();
            }
        }