Exemple #1
0
        public virtual global::alphatab.model.Beat clone()
        {
            unchecked
            {
                global::alphatab.model.Beat beat = new global::alphatab.model.Beat();
                {
                    int _g = 0;
                    global::haxe.root.Array <object> _g1 = this.whammyBarPoints;
                    while ((_g < _g1.length))
                    {
                        global::alphatab.model.BendPoint b = ((global::alphatab.model.BendPoint)(_g1[_g]));
                        ++_g;
                        beat.whammyBarPoints.push(b.clone());
                    }
                }

                {
                    int _g2 = 0;
                    global::haxe.root.Array <object> _g11 = this.notes;
                    while ((_g2 < _g11.length))
                    {
                        global::alphatab.model.Note n = ((global::alphatab.model.Note)(_g11[_g2]));
                        ++_g2;
                        beat.addNote(n.clone());
                    }
                }

                beat.chordId      = this.chordId;
                beat.brushType    = this.brushType;
                beat.vibrato      = this.vibrato;
                beat.graceType    = this.graceType;
                beat.pickStroke   = this.pickStroke;
                beat.duration     = this.duration;
                beat.tremoloSpeed = new global::haxe.lang.Null <global::alphatab.model.Duration>(this.tremoloSpeed.@value, true);
                beat.text         = this.text;
                beat.fadeIn       = this.fadeIn;
                beat.tap          = this.tap;
                beat.slap         = this.slap;
                beat.pop          = this.pop;
                {
                    int _g3 = 0;
                    global::haxe.root.Array <object> _g12 = this.automations;
                    while ((_g3 < _g12.length))
                    {
                        global::alphatab.model.Automation a = ((global::alphatab.model.Automation)(_g12[_g3]));
                        ++_g3;
                        beat.automations.push(a.clone());
                    }
                }

                beat.start             = this.start;
                beat.tupletDenominator = this.tupletDenominator;
                beat.tupletNumerator   = this.tupletNumerator;
                beat.dynamicValue      = this.dynamicValue;
                beat.crescendo         = this.crescendo;
                return(beat);
            }
        }
		public virtual   global::alphatab.model.BendPoint clone()
		{
			unchecked 
			{
				global::alphatab.model.BendPoint point = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
				point.offset = this.offset;
				point.@value = this.@value;
				return point;
			}
		}
Exemple #3
0
 public virtual global::alphatab.model.BendPoint clone()
 {
     unchecked
     {
         global::alphatab.model.BendPoint point = new global::alphatab.model.BendPoint(((global::haxe.lang.Null <int>)(default(global::haxe.lang.Null <int>))), ((global::haxe.lang.Null <int>)(default(global::haxe.lang.Null <int>))));
         point.offset = this.offset;
         point.@value = this.@value;
         return(point);
     }
 }
Exemple #4
0
 public static void __hx_ctor_alphatab_model_BendPoint(global::alphatab.model.BendPoint __temp_me77, global::haxe.lang.Null <int> offset, global::haxe.lang.Null <int> @value)
 {
     unchecked
     {
         int __temp_value76  = ((global::haxe.lang.Runtime.eq((@value).toDynamic(), (default(global::haxe.lang.Null <int>)).toDynamic())) ? (((int)(0))) : (@value.@value));
         int __temp_offset75 = ((global::haxe.lang.Runtime.eq((offset).toDynamic(), (default(global::haxe.lang.Null <int>)).toDynamic())) ? (((int)(0))) : (offset.@value));
         __temp_me77.offset = __temp_offset75;
         __temp_me77.@value = __temp_value76;
     }
 }
Exemple #5
0
        public virtual global::alphatab.model.Note clone()
        {
            unchecked
            {
                global::alphatab.model.Note n = new global::alphatab.model.Note();
                {
                    int _g = 0;
                    global::haxe.root.Array <object> _g1 = this.bendPoints;
                    while ((_g < _g1.length))
                    {
                        global::alphatab.model.BendPoint p = ((global::alphatab.model.BendPoint)(_g1[_g]));
                        ++_g;
                        n.bendPoints.push(p.clone());
                    }
                }

                n.dynamicValue            = this.dynamicValue;
                n.accentuated             = this.accentuated;
                n.fret                    = this.fret;
                n.isGhost                 = this.isGhost;
                n.@string                 = this.@string;
                n.isHammerPullDestination = this.isHammerPullDestination;
                n.isHammerPullOrigin      = this.isHammerPullOrigin;
                n.harmonicValue           = this.harmonicValue;
                n.harmonicType            = this.harmonicType;
                n.isLetRing               = this.isLetRing;
                n.isPalmMute              = this.isPalmMute;
                n.isDead                  = this.isDead;
                n.slideType               = this.slideType;
                n.vibrato                 = this.vibrato;
                n.isStaccato              = this.isStaccato;
                n.isTieOrigin             = this.isTieOrigin;
                n.isTieDestination        = this.isTieDestination;
                n.leftHandFinger          = this.leftHandFinger;
                n.rightHandFinger         = this.rightHandFinger;
                n.isFingering             = n.isFingering;
                n.swapAccidentals         = this.swapAccidentals;
                n.trillValue              = this.trillValue;
                n.trillSpeed              = this.trillSpeed;
                n.durationPercent         = this.durationPercent;
                return(n);
            }
        }
		public virtual   void parseNoteProperties(global::haxe.root.Xml node, global::alphatab.model.Note note, string noteId)
		{
			unchecked 
			{
				bool isBended = false;
				global::alphatab.model.BendPoint bendOrigin = default(global::alphatab.model.BendPoint);
				global::haxe.lang.Null<int> bendMiddleValue = default(global::haxe.lang.Null<int>);
				global::haxe.lang.Null<int> bendMiddleOffset1 = default(global::haxe.lang.Null<int>);
				global::haxe.lang.Null<int> bendMiddleOffset2 = default(global::haxe.lang.Null<int>);
				global::alphatab.model.BendPoint bendDestination = default(global::alphatab.model.BendPoint);
				{
					object __temp_iterator438 = node.iterator();
					while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator438, "hasNext", 407283053, default(global::haxe.root.Array))) ))
					{
						global::haxe.root.Xml c = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator438, "next", 1224901875, default(global::haxe.root.Array))) );
						if (( c.nodeType == global::haxe.root.Xml.Element )) 
						{
							string _g = c._get_nodeName();
							switch (_g)
							{
								case "Property":
								{
									string name = c.@get("name");
									switch (name)
									{
										case "String":
										{
											note.@string = ( global::Std.parseInt(this.getValue(this.findChildElement(c, "String"))).@value + 1 );
											break;
										}
										
										
										case "Fret":
										{
											note.fret = global::Std.parseInt(this.getValue(this.findChildElement(c, "Fret"))).@value;
											break;
										}
										
										
										case "Tapped":
										{
											this._tappedNotes.@set(noteId, true);
											break;
										}
										
										
										case "HarmonicType":
										{
											global::haxe.root.Xml htype = this.findChildElement(c, "HType");
											if (( htype != default(global::haxe.root.Xml) )) 
											{
												string _g1 = this.getValue(htype);
												switch (_g1)
												{
													case "NoHarmonic":
													{
														note.harmonicType = global::alphatab.model.HarmonicType.None;
														break;
													}
													
													
													case "Natural":
													{
														note.harmonicType = global::alphatab.model.HarmonicType.Natural;
														break;
													}
													
													
													case "Artificial":
													{
														note.harmonicType = global::alphatab.model.HarmonicType.Artificial;
														break;
													}
													
													
													case "Pinch":
													{
														note.harmonicType = global::alphatab.model.HarmonicType.Pinch;
														break;
													}
													
													
													case "Tap":
													{
														note.harmonicType = global::alphatab.model.HarmonicType.Tap;
														break;
													}
													
													
													case "Semi":
													{
														note.harmonicType = global::alphatab.model.HarmonicType.Semi;
														break;
													}
													
													
													case "Feedback":
													{
														note.harmonicType = global::alphatab.model.HarmonicType.Feedback;
														break;
													}
													
													
												}
												
											}
											
											break;
										}
										
										
										case "HarmonicFret":
										{
											global::haxe.root.Xml hfret = this.findChildElement(c, "HFret");
											if (( hfret != default(global::haxe.root.Xml) )) 
											{
												note.harmonicValue = global::Std.parseFloat(this.getValue(hfret));
											}
											
											break;
										}
										
										
										case "PalmMuted":
										{
											if (( this.findChildElement(c, "Enable") != default(global::haxe.root.Xml) )) 
											{
												note.isPalmMute = true;
											}
											
											break;
										}
										
										
										case "Octave":
										{
											note.octave = global::Std.parseInt(this.getValue(this.findChildElement(c, "Number"))).@value;
											break;
										}
										
										
										case "Bended":
										{
											isBended = true;
											break;
										}
										
										
										case "BendOriginValue":
										{
											if (( bendOrigin == default(global::alphatab.model.BendPoint) )) 
											{
												bendOrigin = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
											}
											
											{
												double x = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.04 );
												bendOrigin.@value = ((int) (x) );
											}
											
											break;
										}
										
										
										case "BendOriginOffset":
										{
											if (( bendOrigin == default(global::alphatab.model.BendPoint) )) 
											{
												bendOrigin = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
											}
											
											{
												double x1 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.6 );
												bendOrigin.offset = ((int) (x1) );
											}
											
											break;
										}
										
										
										case "BendMiddleValue":
										{
											double x2 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.04 );
											bendMiddleValue = new global::haxe.lang.Null<int>(new global::haxe.lang.Null<int>(((int) (x2) ), true).@value, true);
											break;
										}
										
										
										case "BendMiddleOffset1":
										{
											double x3 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.6 );
											bendMiddleOffset1 = new global::haxe.lang.Null<int>(new global::haxe.lang.Null<int>(((int) (x3) ), true).@value, true);
											break;
										}
										
										
										case "BendMiddleOffset2":
										{
											double x4 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.6 );
											bendMiddleOffset2 = new global::haxe.lang.Null<int>(new global::haxe.lang.Null<int>(((int) (x4) ), true).@value, true);
											break;
										}
										
										
										case "BendDestinationValue":
										{
											if (( bendDestination == default(global::alphatab.model.BendPoint) )) 
											{
												bendDestination = new global::alphatab.model.BendPoint(new global::haxe.lang.Null<int>(60, true), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
											}
											
											{
												double x5 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.04 );
												bendDestination.@value = ((int) (x5) );
											}
											
											break;
										}
										
										
										case "BendDestinationOffset":
										{
											if (( bendDestination == default(global::alphatab.model.BendPoint) )) 
											{
												bendDestination = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
											}
											
											{
												double x6 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.6 );
												bendDestination.offset = ((int) (x6) );
											}
											
											break;
										}
										
										
										case "HopoOrigin":
										{
											if (( this.findChildElement(c, "Enable") != default(global::haxe.root.Xml) )) 
											{
												note.isHammerPullOrigin = true;
											}
											
											break;
										}
										
										
										case "HopoDestination":
										{
											{
											}
											
											break;
										}
										
										
										case "Slide":
										{
											global::haxe.lang.Null<int> slideFlags = global::Std.parseInt(this.getValue(this.findChildElement(c, "Flags")));
											if (( (( slideFlags.@value & 1 )) != 0 )) 
											{
												note.slideType = global::alphatab.model.SlideType.Shift;
											}
											
											if (( (( slideFlags.@value & 2 )) != 0 )) 
											{
												note.slideType = global::alphatab.model.SlideType.Legato;
											}
											
											if (( (( slideFlags.@value & 4 )) != 0 )) 
											{
												note.slideType = global::alphatab.model.SlideType.OutDown;
											}
											
											if (( (( slideFlags.@value & 8 )) != 0 )) 
											{
												note.slideType = global::alphatab.model.SlideType.OutUp;
											}
											
											if (( (( slideFlags.@value & 16 )) != 0 )) 
											{
												note.slideType = global::alphatab.model.SlideType.IntoFromBelow;
											}
											
											if (( (( slideFlags.@value & 32 )) != 0 )) 
											{
												note.slideType = global::alphatab.model.SlideType.IntoFromAbove;
											}
											
											break;
										}
										
										
									}
									
									break;
								}
								
								
							}
							
						}
						
					}
					
				}
				
				if (isBended) 
				{
					if (( bendOrigin == default(global::alphatab.model.BendPoint) )) 
					{
						bendOrigin = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
					}
					
					if (( bendDestination == default(global::alphatab.model.BendPoint) )) 
					{
						bendDestination = new global::alphatab.model.BendPoint(new global::haxe.lang.Null<int>(60, true), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
					}
					
					global::haxe.root.Array<object> bend = new global::haxe.root.Array<object>();
					bend.push(bendOrigin);
					if (( ( ! (global::haxe.lang.Runtime.eq((bendMiddleOffset1).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) && ( ! (global::haxe.lang.Runtime.eq((bendMiddleValue).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) )) 
					{
						bend.push(new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (bendMiddleOffset1) ), ((global::haxe.lang.Null<int>) (bendMiddleValue) )));
					}
					
					if (( ( ! (global::haxe.lang.Runtime.eq((bendMiddleOffset2).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) && ( ! (global::haxe.lang.Runtime.eq((bendMiddleValue).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) )) 
					{
						bend.push(new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (bendMiddleOffset2) ), ((global::haxe.lang.Null<int>) (bendMiddleValue) )));
					}
					
					if (( ( global::haxe.lang.Runtime.eq((bendMiddleOffset1).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic()) && global::haxe.lang.Runtime.eq((bendMiddleOffset2).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic()) ) && ( ! (global::haxe.lang.Runtime.eq((bendMiddleValue).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) )) 
					{
						bend.push(new global::alphatab.model.BendPoint(new global::haxe.lang.Null<int>(30, true), ((global::haxe.lang.Null<int>) (bendMiddleValue) )));
					}
					
					bend.push(bendDestination);
					note.bendPoints = bend;
				}
				
			}
		}
		public virtual   void parseBeatProperties(global::haxe.root.Xml node, global::alphatab.model.Beat beat)
		{
			unchecked 
			{
				bool isWhammy = false;
				global::alphatab.model.BendPoint whammyOrigin = default(global::alphatab.model.BendPoint);
				global::haxe.lang.Null<int> whammyMiddleValue = default(global::haxe.lang.Null<int>);
				global::haxe.lang.Null<int> whammyMiddleOffset1 = default(global::haxe.lang.Null<int>);
				global::haxe.lang.Null<int> whammyMiddleOffset2 = default(global::haxe.lang.Null<int>);
				global::alphatab.model.BendPoint whammyDestination = default(global::alphatab.model.BendPoint);
				{
					object __temp_iterator435 = node.iterator();
					while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator435, "hasNext", 407283053, default(global::haxe.root.Array))) ))
					{
						global::haxe.root.Xml c = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator435, "next", 1224901875, default(global::haxe.root.Array))) );
						if (( c.nodeType == global::haxe.root.Xml.Element )) 
						{
							string _g = c._get_nodeName();
							switch (_g)
							{
								case "Property":
								{
									string name = c.@get("name");
									switch (name)
									{
										case "Brush":
										{
											if (string.Equals(this.getValue(this.findChildElement(c, "Direction")), "Up")) 
											{
												beat.brushType = global::alphatab.model.BrushType.BrushUp;
											}
											 else 
											{
												beat.brushType = global::alphatab.model.BrushType.BrushDown;
											}
											
											break;
										}
										
										
										case "PickStroke":
										{
											if (string.Equals(this.getValue(this.findChildElement(c, "Direction")), "Up")) 
											{
												beat.pickStroke = global::alphatab.model.PickStrokeType.Up;
											}
											 else 
											{
												beat.pickStroke = global::alphatab.model.PickStrokeType.Down;
											}
											
											break;
										}
										
										
										case "Slapped":
										{
											if (( this.findChildElement(c, "Enable") != default(global::haxe.root.Xml) )) 
											{
												beat.slap = true;
											}
											
											break;
										}
										
										
										case "Popped":
										{
											if (( this.findChildElement(c, "Enable") != default(global::haxe.root.Xml) )) 
											{
												beat.pop = true;
											}
											
											break;
										}
										
										
										case "VibratoWTremBar":
										{
											string _g1 = this.getValue(this.findChildElement(c, "Strength"));
											switch (_g1)
											{
												case "Wide":
												{
													beat.vibrato = global::alphatab.model.VibratoType.Wide;
													break;
												}
												
												
												case "Slight":
												{
													beat.vibrato = global::alphatab.model.VibratoType.Slight;
													break;
												}
												
												
											}
											
											break;
										}
										
										
										case "WhammyBar":
										{
											isWhammy = true;
											break;
										}
										
										
										case "WhammyBarExtend":
										{
											{
											}
											
											break;
										}
										
										
										case "WhammyBarOriginValue":
										{
											if (( whammyOrigin == default(global::alphatab.model.BendPoint) )) 
											{
												whammyOrigin = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
											}
											
											{
												double x = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.04 );
												whammyOrigin.@value = ((int) (x) );
											}
											
											break;
										}
										
										
										case "WhammyBarOriginOffset":
										{
											if (( whammyOrigin == default(global::alphatab.model.BendPoint) )) 
											{
												whammyOrigin = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
											}
											
											{
												double x1 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.6 );
												whammyOrigin.offset = ((int) (x1) );
											}
											
											break;
										}
										
										
										case "WhammyBarMiddleValue":
										{
											double x2 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.04 );
											whammyMiddleValue = new global::haxe.lang.Null<int>(new global::haxe.lang.Null<int>(((int) (x2) ), true).@value, true);
											break;
										}
										
										
										case "WhammyBarMiddleOffset1":
										{
											double x3 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.6 );
											whammyMiddleOffset1 = new global::haxe.lang.Null<int>(new global::haxe.lang.Null<int>(((int) (x3) ), true).@value, true);
											break;
										}
										
										
										case "WhammyBarMiddleOffset2":
										{
											double x4 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.6 );
											whammyMiddleOffset2 = new global::haxe.lang.Null<int>(new global::haxe.lang.Null<int>(((int) (x4) ), true).@value, true);
											break;
										}
										
										
										case "WhammyBarDestinationValue":
										{
											if (( whammyDestination == default(global::alphatab.model.BendPoint) )) 
											{
												whammyDestination = new global::alphatab.model.BendPoint(new global::haxe.lang.Null<int>(60, true), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
											}
											
											{
												double x5 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.04 );
												whammyDestination.@value = ((int) (x5) );
											}
											
											break;
										}
										
										
										case "WhammyBarDestinationOffset":
										{
											if (( whammyDestination == default(global::alphatab.model.BendPoint) )) 
											{
												whammyDestination = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
											}
											
											{
												double x6 = ( global::Std.parseFloat(this.getValue(this.findChildElement(c, "Float"))) * 0.6 );
												whammyDestination.offset = ((int) (x6) );
											}
											
											break;
										}
										
										
									}
									
									break;
								}
								
								
							}
							
						}
						
					}
					
				}
				
				if (isWhammy) 
				{
					if (( whammyOrigin == default(global::alphatab.model.BendPoint) )) 
					{
						whammyOrigin = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
					}
					
					if (( whammyDestination == default(global::alphatab.model.BendPoint) )) 
					{
						whammyDestination = new global::alphatab.model.BendPoint(new global::haxe.lang.Null<int>(60, true), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
					}
					
					global::haxe.root.Array<object> whammy = new global::haxe.root.Array<object>();
					whammy.push(whammyOrigin);
					if (( ( ! (global::haxe.lang.Runtime.eq((whammyMiddleOffset1).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) && ( ! (global::haxe.lang.Runtime.eq((whammyMiddleValue).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) )) 
					{
						whammy.push(new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (whammyMiddleOffset1) ), ((global::haxe.lang.Null<int>) (whammyMiddleValue) )));
					}
					
					if (( ( ! (global::haxe.lang.Runtime.eq((whammyMiddleOffset2).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) && ( ! (global::haxe.lang.Runtime.eq((whammyMiddleValue).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) )) 
					{
						whammy.push(new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (whammyMiddleOffset2) ), ((global::haxe.lang.Null<int>) (whammyMiddleValue) )));
					}
					
					if (( ( global::haxe.lang.Runtime.eq((whammyMiddleOffset1).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic()) && global::haxe.lang.Runtime.eq((whammyMiddleOffset2).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic()) ) && ( ! (global::haxe.lang.Runtime.eq((whammyMiddleValue).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ) )) 
					{
						whammy.push(new global::alphatab.model.BendPoint(new global::haxe.lang.Null<int>(30, true), ((global::haxe.lang.Null<int>) (whammyMiddleValue) )));
					}
					
					whammy.push(whammyDestination);
					beat.whammyBarPoints = whammy;
				}
				
			}
		}
		public virtual   void readBend(global::alphatab.model.Note note)
		{
			unchecked 
			{
				this._data.readByte();
				this.readInt32();
				int pointCount = this.readInt32();
				if (( pointCount > 0 )) 
				{
					int _g = 0;
					while (( _g < ((int) (pointCount) ) ))
					{
						int i = _g++;
						global::alphatab.model.BendPoint point = new global::alphatab.model.BendPoint(((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ), ((global::haxe.lang.Null<int>) (default(global::haxe.lang.Null<int>)) ));
						point.offset = this.readInt32();
						{
							double x = ( this.readInt32() / ((double) (25) ) );
							point.@value = ((int) (x) );
						}
						
						bool __temp_expr504 = ( this._data.readByte() != 0 );
						note.bendPoints.push(point);
					}
					
				}
				
			}
		}
Exemple #9
0
        public override void paint(int cx, int cy, global::alphatab.platform.ICanvas canvas)
        {
            unchecked
            {
                global::alphatab.rendering.TabBarRenderer     r   = ((global::alphatab.rendering.TabBarRenderer)(this.renderer));
                global::alphatab.rendering.RenderingResources res = this.renderer.stave.staveGroup.layout.renderer.renderingResources;
                double dX       = (((double)(this.width)) / 60);
                int    maxValue = 0;
                {
                    int _g1 = 0;
                    int _g  = this._note.bendPoints.length;
                    while ((_g1 < _g))
                    {
                        int i = _g1++;
                        if ((((global::alphatab.model.BendPoint)(this._note.bendPoints[i])).@value > maxValue))
                        {
                            maxValue = ((global::alphatab.model.BendPoint)(this._note.bendPoints[i])).@value;
                        }
                    }
                }

                double dY = (((double)(this._height)) / maxValue);
                int    xx = (cx + this.x);
                int    yy = ((cy + this.y) + r.getNoteY(this._note));
                canvas.beginPath();
                {
                    int _g11 = 0;
                    int _g2  = (this._note.bendPoints.length - 1);
                    while ((_g11 < _g2))
                    {
                        int i1 = _g11++;
                        global::alphatab.model.BendPoint firstPt  = ((global::alphatab.model.BendPoint)(this._note.bendPoints[i1]));
                        global::alphatab.model.BendPoint secondPt = ((global::alphatab.model.BendPoint)(this._note.bendPoints[(i1 + 1)]));
                        if (((firstPt.@value == secondPt.@value) && (i1 == (this._note.bendPoints.length - 2))))
                        {
                            continue;
                        }

                        double x1 = (xx + (dX * firstPt.offset));
                        double y1 = (yy - (dY * firstPt.@value));
                        double x2 = (xx + (dX * secondPt.offset));
                        double y2 = (yy - (dY * secondPt.@value));
                        if ((firstPt.@value == secondPt.@value))
                        {
                            canvas.moveTo(x1, y1);
                            canvas.lineTo(x2, y2);
                            canvas.stroke();
                        }
                        else
                        {
                            double hx = (x1 + ((x2 - x1)));
                            double hy = (yy - (dY * firstPt.@value));
                            canvas.moveTo(x1, y1);
                            canvas.bezierCurveTo(hx, hy, x2, y2, x2, y2);
                            canvas.stroke();
                        }

                        double arrowSize = (6 * this.renderer.stave.staveGroup.layout.renderer.settings.scale);
                        if ((secondPt.@value > firstPt.@value))
                        {
                            canvas.beginPath();
                            canvas.moveTo(x2, y2);
                            canvas.lineTo((x2 - (arrowSize * 0.5)), (y2 + arrowSize));
                            canvas.lineTo((x2 + (arrowSize * 0.5)), (y2 + arrowSize));
                            canvas.closePath();
                            canvas.fill();
                        }
                        else
                        {
                            if ((secondPt.@value != firstPt.@value))
                            {
                                canvas.beginPath();
                                canvas.moveTo(x2, y2);
                                canvas.lineTo((x2 - (arrowSize * 0.5)), (y2 - arrowSize));
                                canvas.lineTo((x2 + (arrowSize * 0.5)), (y2 - arrowSize));
                                canvas.closePath();
                                canvas.fill();
                            }
                        }

                        canvas.stroke();
                        if ((secondPt.@value != 0))
                        {
                            double dV = ((double)((secondPt.@value - firstPt.@value)));
                            bool   up = (dV > 0);
                            dV = global::System.Math.Abs(((double)(dV)));
                            string s = "";
                            if ((dV == 4))
                            {
                                s   = "full";
                                dV -= ((double)(4));
                            }
                            else
                            {
                                if ((dV > 4))
                                {
                                    int __temp_stmt594 = default(int);
                                    {
                                        double x = global::System.Math.Floor(((double)((dV / 4))));
                                        __temp_stmt594 = ((int)(x));
                                    }

                                    string __temp_stmt593 = global::Std.@string(__temp_stmt594);
                                    string __temp_stmt592 = global::haxe.lang.Runtime.concat(__temp_stmt593, " ");
                                    s = global::haxe.lang.Runtime.concat(s, __temp_stmt592);
                                    {
                                        double x3 = global::System.Math.Floor(((double)(dV)));
                                        dV -= ((double)(((int)(x3))));
                                    }
                                }
                            }

                            if ((dV > 0))
                            {
                                s = global::haxe.lang.Runtime.concat(s, global::haxe.lang.Runtime.concat(global::Std.@string(dV), "/4"));
                            }

                            if (!(string.Equals(s, "")))
                            {
                                if (!(up))
                                {
                                    s = global::haxe.lang.Runtime.concat("-", s);
                                }

                                canvas.setFont(res.tablatureFont);
                                double size = canvas.measureText(s);
                                double y    = default(double);
                                if (up)
                                {
                                    y = ((y2 - res.tablatureFont.getSize()) - (2 * this.renderer.stave.staveGroup.layout.renderer.settings.scale));
                                }
                                else
                                {
                                    y = (y2 + (2 * this.renderer.stave.staveGroup.layout.renderer.settings.scale));
                                }

                                double x4 = (x2 - (size / 2));
                                canvas.fillText(s, x4, y);
                            }
                        }
                    }
                }
            }
        }
Exemple #10
0
        public override void doLayout()
        {
            unchecked
            {
                base.doLayout();
                int minY  = 0;
                int maxY  = 0;
                int sizeY = ((int)((60 * this.renderer.stave.staveGroup.layout.renderer.settings.scale)));
                if ((this._beat.whammyBarPoints.length >= 2))
                {
                    double dy = (((double)(sizeY)) / 24);
                    {
                        int _g1 = 0;
                        int _g  = this._beat.whammyBarPoints.length;
                        while ((_g1 < _g))
                        {
                            int i = _g1++;
                            global::alphatab.model.BendPoint pt = ((global::alphatab.model.BendPoint)(this._beat.whammyBarPoints[i]));
                            int ptY = ((int)((0 - (dy * pt.@value))));
                            if ((ptY > maxY))
                            {
                                maxY = ptY;
                            }

                            if ((ptY < minY))
                            {
                                minY = ptY;
                            }
                        }
                    }
                }

                global::alphatab.rendering.TabBarRenderer tabBarRenderer = ((global::alphatab.rendering.TabBarRenderer)(this.renderer));
                global::alphatab.model.Track track = this.renderer.stave.staveGroup.layout.renderer.track;
                int tabTop    = tabBarRenderer.getTabY(0, new global::haxe.lang.Null <int>(-2, true));
                int tabBottom = tabBarRenderer.getTabY(track.tuning.length, new global::haxe.lang.Null <int>(-2, true));
                int absMinY   = ((this.y + minY) + tabTop);
                int absMaxY   = ((this.y + maxY) - tabBottom);
                if ((absMinY < 0))
                {
                    int __temp_stmt601 = default(int);
                    {
                        double x = global::System.Math.Abs(((double)(absMinY)));
                        __temp_stmt601 = ((int)(x));
                    }

                    tabBarRenderer.registerOverflowTop(__temp_stmt601);
                }

                if ((absMaxY > 0))
                {
                    int __temp_stmt602 = default(int);
                    {
                        double x1 = global::System.Math.Abs(((double)(absMaxY)));
                        __temp_stmt602 = ((int)(x1));
                    }

                    tabBarRenderer.registerOverflowBottom(__temp_stmt602);
                }

                int height = tabBarRenderer.height;
            }
        }
Exemple #11
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;
                double startX = ((cx + this.x) + (((double)(this._parent.onNotes.width)) / 2));
                double endX   = default(double);
                if (((this._beat.nextBeat == default(global::alphatab.model.Beat)) || (this._beat.voice != this._beat.nextBeat.voice)))
                {
                    endX = (((cx + this.x) + (((double)(this._parent.onNotes.width)) / 2)) + this._parent.postNotes.width);
                }
                else
                {
                    endX = ((double)((cx + tabBarRenderer.getBeatX(this._beat.nextBeat))));
                }

                int startY     = (cy + this.y);
                int textOffset = ((int)((3 * this.renderer.stave.staveGroup.layout.renderer.settings.scale)));
                int sizeY      = ((int)((60 * this.renderer.stave.staveGroup.layout.renderer.settings.scale)));
                canvas.setTextAlign(global::alphatab.platform.model.TextAlign.Center);
                if ((this._beat.whammyBarPoints.length >= 2))
                {
                    double dx = (((endX - startX)) / 60);
                    double dy = (((double)(sizeY)) / 24);
                    canvas.beginPath();
                    {
                        int _g1 = 0;
                        int _g  = (this._beat.whammyBarPoints.length - 1);
                        while ((_g1 < _g))
                        {
                            int i = _g1++;
                            global::alphatab.model.BendPoint pt1 = ((global::alphatab.model.BendPoint)(this._beat.whammyBarPoints[i]));
                            global::alphatab.model.BendPoint pt2 = ((global::alphatab.model.BendPoint)(this._beat.whammyBarPoints[(i + 1)]));
                            if (((pt1.@value == pt2.@value) && (i == (this._beat.whammyBarPoints.length - 2))))
                            {
                                continue;
                            }

                            int pt1X = ((int)((startX + (dx * pt1.offset))));
                            int pt1Y = ((int)((startY - (dy * pt1.@value))));
                            int pt2X = ((int)((startX + (dx * pt2.offset))));
                            int pt2Y = ((int)((startY - (dy * pt2.@value))));
                            canvas.moveTo(((double)(pt1X)), ((double)(pt1Y)));
                            canvas.lineTo(((double)(pt2X)), ((double)(pt2Y)));
                            if ((pt2.@value != 0))
                            {
                                double dv = (pt2.@value / 4.0);
                                bool   up = ((pt2.@value - pt1.@value) >= 0);
                                string s  = "";
                                if ((dv < 0))
                                {
                                    s = global::haxe.lang.Runtime.concat(s, "-");
                                }

                                if (((dv >= 1) || (dv <= -1)))
                                {
                                    int __temp_stmt605 = default(int);
                                    {
                                        double v = global::System.Math.Abs(((double)(dv)));
                                        {
                                            double x = global::System.Math.Floor(((double)(v)));
                                            __temp_stmt605 = ((int)(x));
                                        }
                                    }

                                    string __temp_stmt604 = global::Std.@string(__temp_stmt605);
                                    string __temp_stmt603 = global::haxe.lang.Runtime.concat(__temp_stmt604, " ");
                                    s = global::haxe.lang.Runtime.concat(s, __temp_stmt603);
                                }

                                {
                                    double x1 = global::System.Math.Floor(((double)(dv)));
                                    dv -= ((double)(((int)(x1))));
                                }

                                if ((dv == 0.25))
                                {
                                    s = global::haxe.lang.Runtime.concat(s, "1/4");
                                }
                                else
                                {
                                    if ((dv == 0.5))
                                    {
                                        s = global::haxe.lang.Runtime.concat(s, "1/2");
                                    }
                                    else
                                    {
                                        if ((dv == 0.75))
                                        {
                                            s = global::haxe.lang.Runtime.concat(s, "3/4");
                                        }
                                    }
                                }

                                canvas.setFont(res.graceFont);
                                double size = canvas.measureText(s);
                                double sy   = default(double);
                                if (up)
                                {
                                    sy = ((pt2Y - res.graceFont.getSize()) - textOffset);
                                }
                                else
                                {
                                    sy = ((double)((pt2Y + textOffset)));
                                }

                                int sx = pt2X;
                                canvas.fillText(s, ((double)(sx)), sy);
                            }
                        }
                    }

                    canvas.stroke();
                }
            }
        }