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; [email protected] = [email protected]; return point; } }
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 = [email protected]("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 ); [email protected] = ((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)[email protected], 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)[email protected], 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)[email protected], 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 ); [email protected] = ((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 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 = [email protected]("name"); switch (name) { case "String": { [email protected] = ( global::Std.parseInt(this.getValue(this.findChildElement(c, "String")))[email protected] + 1 ); break; } case "Fret": { note.fret = global::Std.parseInt(this.getValue(this.findChildElement(c, "Fret")))[email protected]; break; } case "Tapped": { [email protected](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")))[email protected]; 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 ); [email protected] = ((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)[email protected], 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)[email protected], 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)[email protected], 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 ); [email protected] = ((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 (( (( [email protected] & 1 )) != 0 )) { note.slideType = global::alphatab.model.SlideType.Shift; } if (( (( [email protected] & 2 )) != 0 )) { note.slideType = global::alphatab.model.SlideType.Legato; } if (( (( [email protected] & 4 )) != 0 )) { note.slideType = global::alphatab.model.SlideType.OutDown; } if (( (( [email protected] & 8 )) != 0 )) { note.slideType = global::alphatab.model.SlideType.OutUp; } if (( (( [email protected] & 16 )) != 0 )) { note.slideType = global::alphatab.model.SlideType.IntoFromBelow; } if (( (( [email protected] & 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 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) ) ); [email protected] = ((int) (x) ); } bool __temp_expr504 = ( this._data.readByte() != 0 ); note.bendPoints.push(point); } } } }