Esempio n. 1
0
        public virtual void updateWidth()
        {
            unchecked
            {
                this.width = this.getPostBeatGlyphsStart();
                if ((this._postBeatGlyphs.length > 0))
                {
                    this.width += (((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).x + ((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).width);
                }

                {
                    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;
                        if (((this._biggestVoiceContainer == default(global::alphatab.rendering.glyphs.VoiceContainerGlyph)) || (c.width > this._biggestVoiceContainer.width)))
                        {
                            this._biggestVoiceContainer = c;
                        }
                    }
                }
            }
        }
 public static void __hx_ctor_alphatab_rendering_glyphs_VoiceContainerGlyph(global::alphatab.rendering.glyphs.VoiceContainerGlyph __temp_me229, global::haxe.lang.Null <int> x, global::haxe.lang.Null <int> y, int voiceIndex)
 {
     unchecked
     {
         int __temp_y228 = ((global::haxe.lang.Runtime.eq((y).toDynamic(), (default(global::haxe.lang.Null <int>)).toDynamic())) ? (((int)(0))) : (y.@value));
         int __temp_x227 = ((global::haxe.lang.Runtime.eq((x).toDynamic(), (default(global::haxe.lang.Null <int>)).toDynamic())) ? (((int)(0))) : (x.@value));
         global::alphatab.rendering.glyphs.GlyphGroup.__hx_ctor_alphatab_rendering_glyphs_GlyphGroup(__temp_me229, new global::haxe.lang.Null <int>(__temp_x227, true), new global::haxe.lang.Null <int>(__temp_y228, true), default(global::haxe.root.Array <object>));
         __temp_me229.beatGlyphs = new global::haxe.root.Array <object>();
         __temp_me229.voiceIndex = voiceIndex;
     }
 }
Esempio n. 3
0
 public override void finalizeRenderer(global::alphatab.rendering.layout.ScoreLayout layout)
 {
     unchecked
     {
         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.finalizeGlyph(layout);
         }
     }
 }
Esempio n. 4
0
        public virtual global::alphatab.rendering.glyphs.VoiceContainerGlyph getOrCreateVoiceContainer(int voiceIndex)
        {
            unchecked
            {
                global::alphatab.rendering.glyphs.VoiceContainerGlyph c = default(global::alphatab.rendering.glyphs.VoiceContainerGlyph);
                if ((voiceIndex >= this._voiceContainers.length))
                {
                    c          = new global::alphatab.rendering.glyphs.VoiceContainerGlyph(new global::haxe.lang.Null <int>(0, true), new global::haxe.lang.Null <int>(0, true), ((int)(voiceIndex)));
                    c.renderer = this;
                    this._voiceContainers[voiceIndex] = c;
                }
                else
                {
                    c = ((global::alphatab.rendering.glyphs.VoiceContainerGlyph)(this._voiceContainers[voiceIndex]));
                }

                return(c);
            }
        }
Esempio n. 5
0
        public override void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
        {
            unchecked
            {
                this.paintBackground(cx, cy, canvas);
                int glyphStartX = this.getPreBeatGlyphStart();
                {
                    int _g = 0;
                    global::haxe.root.Array <object> _g1 = this._preBeatGlyphs;
                    while ((_g < _g1.length))
                    {
                        global::alphatab.rendering.Glyph g = ((global::alphatab.rendering.Glyph)(_g1[_g]));
                        ++_g;
                        g.paint(((cx + this.x) + glyphStartX), (cy + this.y), canvas);
                    }
                }

                glyphStartX = this.getBeatGlyphsStart();
                {
                    int _g2 = 0;
                    global::haxe.root.Array <object> _g11 = this._voiceContainers;
                    while ((_g2 < _g11.length))
                    {
                        global::alphatab.rendering.glyphs.VoiceContainerGlyph c = ((global::alphatab.rendering.glyphs.VoiceContainerGlyph)(_g11[_g2]));
                        ++_g2;
                        c.paint(((cx + this.x) + glyphStartX), (cy + this.y), canvas);
                    }
                }

                glyphStartX = this.getPostBeatGlyphsStart();
                {
                    int _g3 = 0;
                    global::haxe.root.Array <object> _g12 = this._postBeatGlyphs;
                    while ((_g3 < _g12.length))
                    {
                        global::alphatab.rendering.Glyph g1 = ((global::alphatab.rendering.Glyph)(_g12[_g3]));
                        ++_g3;
                        g1.paint(((cx + this.x) + glyphStartX), (cy + this.y), canvas);
                    }
                }
            }
        }
Esempio n. 6
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;
                }
            }
        }
Esempio n. 7
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked
            {
                switch (hash)
                {
                case 572707279:
                {
                    this._biggestVoiceContainer = ((global::alphatab.rendering.glyphs.VoiceContainerGlyph)(@value));
                    return(@value);
                }


                case 1420285052:
                {
                    this._postBeatGlyphs = ((global::haxe.root.Array <object>)(global::haxe.root.Array <object> .__hx_cast <object>(((global::haxe.root.Array)(@value)))));
                    return(@value);
                }


                case 486630117:
                {
                    this._voiceContainers = ((global::haxe.root.Array <object>)(global::haxe.root.Array <object> .__hx_cast <object>(((global::haxe.root.Array)(@value)))));
                    return(@value);
                }


                case 347982241:
                {
                    this._preBeatGlyphs = ((global::haxe.root.Array <object>)(global::haxe.root.Array <object> .__hx_cast <object>(((global::haxe.root.Array)(@value)))));
                    return(@value);
                }


                default:
                {
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
        }
Esempio n. 8
0
        public override void doLayout()
        {
            unchecked
            {
                this.createPreBeatGlyphs();
                this.createBeatGlyphs();
                this.createPostBeatGlyphs();
                {
                    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.doLayout();
                    }
                }

                this.updateWidth();
            }
        }
Esempio n. 9
0
        public override void applyBarSpacing(int spacing)
        {
            unchecked
            {
                this.width += spacing;
                {
                    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;
                        int toApply = spacing;
                        if ((this._biggestVoiceContainer != default(global::alphatab.rendering.glyphs.VoiceContainerGlyph)))
                        {
                            toApply += (this._biggestVoiceContainer.width - c.width);
                        }

                        c.applyGlyphSpacing(toApply);
                    }
                }
            }
        }
Esempio n. 10
0
        public virtual int getPostBeatGlyphsStart()
        {
            unchecked
            {
                int start  = this.getBeatGlyphsStart();
                int offset = 0;
                {
                    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;
                        if ((c.width > offset))
                        {
                            offset = c.width;
                        }
                    }
                }

                return(start + offset);
            }
        }
		public virtual   void updateWidth()
		{
			unchecked 
			{
				this.width = this.getPostBeatGlyphsStart();
				if (( this._postBeatGlyphs.length > 0 )) 
				{
					this.width += ( ((global::alphatab.rendering.Glyph) (this._postBeatGlyphs[( this._postBeatGlyphs.length - 1 )]) ).x + ((global::alphatab.rendering.Glyph) (this._postBeatGlyphs[( this._postBeatGlyphs.length - 1 )]) ).width );
				}
				
				{
					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;
						if (( ( this._biggestVoiceContainer == default(global::alphatab.rendering.glyphs.VoiceContainerGlyph) ) || ( c.width > this._biggestVoiceContainer.width ) )) 
						{
							this._biggestVoiceContainer = c;
						}
						
					}
					
				}
				
			}
		}
		public override   object __hx_setField(string field, int hash, object @value, bool handleProperties)
		{
			unchecked 
			{
				switch (hash)
				{
					case 572707279:
					{
						this._biggestVoiceContainer = ((global::alphatab.rendering.glyphs.VoiceContainerGlyph) (@value) );
						return @value;
					}
					
					
					case 1420285052:
					{
						this._postBeatGlyphs = ((global::haxe.root.Array<object>) (global::haxe.root.Array<object>.__hx_cast<object>(((global::haxe.root.Array) (@value) ))) );
						return @value;
					}
					
					
					case 486630117:
					{
						this._voiceContainers = ((global::haxe.root.Array<object>) (global::haxe.root.Array<object>.__hx_cast<object>(((global::haxe.root.Array) (@value) ))) );
						return @value;
					}
					
					
					case 347982241:
					{
						this._preBeatGlyphs = ((global::haxe.root.Array<object>) (global::haxe.root.Array<object>.__hx_cast<object>(((global::haxe.root.Array) (@value) ))) );
						return @value;
					}
					
					
					default:
					{
						return base.__hx_setField(field, hash, @value, handleProperties);
					}
					
				}
				
			}
		}
		public virtual   global::alphatab.rendering.glyphs.VoiceContainerGlyph getOrCreateVoiceContainer(int voiceIndex)
		{
			unchecked 
			{
				global::alphatab.rendering.glyphs.VoiceContainerGlyph c = default(global::alphatab.rendering.glyphs.VoiceContainerGlyph);
				if (( voiceIndex >= this._voiceContainers.length )) 
				{
					c = new global::alphatab.rendering.glyphs.VoiceContainerGlyph(new global::haxe.lang.Null<int>(0, true), new global::haxe.lang.Null<int>(0, true), ((int) (voiceIndex) ));
					c.renderer = this;
					this._voiceContainers[voiceIndex] = c;
				}
				 else 
				{
					c = ((global::alphatab.rendering.glyphs.VoiceContainerGlyph) (this._voiceContainers[voiceIndex]) );
				}
				
				return c;
			}
		}
Esempio n. 14
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();
            }
        }