public virtual void parseDiagramItem(global::alphatab.model.Track track, global::haxe.root.Xml node) { unchecked { global::alphatab.model.Chord chord = new global::alphatab.model.Chord(); string chordId = node.@get("id"); chord.name = node.@get("name"); track.chords.@set(chordId, chord); } }
public virtual void parseTrackProperty(global::alphatab.model.Track track, global::haxe.root.Xml node) { unchecked { string propertyName = node.@get("name"); switch (propertyName) { case "Tuning": { global::haxe.root.Array<object> tuningParts = global::haxe.lang.StringExt.split(this.getValue(this.findChildElement(node, "Pitches")), " "); { int _g = 0; while (( _g < tuningParts.length )) { string s = global::haxe.lang.Runtime.toString(tuningParts[_g]); ++ _g; track.tuning.push(global::Std.parseInt(s).@value); } } track.tuning.reverse(); break; } case "DiagramCollection": { this.parseDiagramCollection(track, node); break; } case "CapoFret": { track.capo = global::Std.parseInt(this.getValue(this.findChildElement(node, "Fret"))).@value; break; } } } }
public virtual void parseRhythm(global::haxe.root.Xml node) { unchecked { global::alphatab.importer.GpxRhythm rhythm = new global::alphatab.importer.GpxRhythm(); string rhythmId = node.@get("id"); { object __temp_iterator440 = node.iterator(); while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator440, "hasNext", 407283053, default(global::haxe.root.Array))) )) { global::haxe.root.Xml c = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator440, "next", 1224901875, default(global::haxe.root.Array))) ); if (( c.nodeType == global::haxe.root.Xml.Element )) { string _g = c._get_nodeName(); switch (_g) { case "NoteValue": { string _g1 = this.getValue(c); switch (_g1) { case "Whole": { rhythm.@value = global::alphatab.model.Duration.Whole; break; } case "Half": { rhythm.@value = global::alphatab.model.Duration.Half; break; } case "Quarter": { rhythm.@value = global::alphatab.model.Duration.Quarter; break; } case "Eighth": { rhythm.@value = global::alphatab.model.Duration.Eighth; break; } case "16th": { rhythm.@value = global::alphatab.model.Duration.Sixteenth; break; } case "32nd": { rhythm.@value = global::alphatab.model.Duration.ThirtySecond; break; } case "64th": { rhythm.@value = global::alphatab.model.Duration.SixtyFourth; break; } } break; } case "PrimaryTuplet": { rhythm.tupletNumerator = global::Std.parseInt(c.@get("num")).@value; rhythm.tupletDenominator = global::Std.parseInt(c.@get("den")).@value; break; } case "AugmentationDot": { rhythm.dots = global::Std.parseInt(c.@get("count")).@value; break; } } } } } this._rhythmById.@set(rhythmId, rhythm); } }
public virtual void parseTrack(global::haxe.root.Xml node) { unchecked { global::alphatab.model.Track track = new global::alphatab.model.Track(); string trackId = node.@get("id"); { object __temp_iterator424 = node.iterator(); while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator424, "hasNext", 407283053, default(global::haxe.root.Array))) )) { global::haxe.root.Xml c = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator424, "next", 1224901875, default(global::haxe.root.Array))) ); if (( c.nodeType == global::haxe.root.Xml.Element )) { string _g = c._get_nodeName(); switch (_g) { case "Name": { track.name = this.getValue(c); break; } case "ShortName": { track.shortName = this.getValue(c); break; } case "Properties": { this.parseTrackProperties(track, c); break; } case "GeneralMidi": { this.parseGeneralMidi(track, c); break; } case "PlaybackState": { string state = this.getValue(c); track.playbackInfo.isSolo = string.Equals(state, "Solo"); track.playbackInfo.isMute = string.Equals(state, "Mute"); break; } } } } } this._tracksById.@set(trackId, track); } }
public virtual void parseNote(global::haxe.root.Xml node) { unchecked { global::alphatab.model.Note note = new global::alphatab.model.Note(); string noteId = node.@get("id"); { object __temp_iterator437 = node.iterator(); while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator437, "hasNext", 407283053, default(global::haxe.root.Array))) )) { global::haxe.root.Xml c = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator437, "next", 1224901875, default(global::haxe.root.Array))) ); if (( c.nodeType == global::haxe.root.Xml.Element )) { string _g = c._get_nodeName(); switch (_g) { case "Properties": { this.parseNoteProperties(c, note, noteId); break; } case "AntiAccent": { if (string.Equals(this.getValue(c).ToLower(), "normal")) { note.isGhost = true; } break; } case "LetRing": { note.isLetRing = true; break; } case "Trill": { note.trillValue = global::Std.parseInt(this.getValue(c)).@value; note.trillSpeed = global::alphatab.model.Duration.Sixteenth; break; } case "Accent": { global::haxe.lang.Null<int> accentFlags = global::Std.parseInt(this.getValue(c)); if (( (( accentFlags.@value & 1 )) != 0 )) { note.isStaccato = true; } if (( (( accentFlags.@value & 4 )) != 0 )) { note.accentuated = global::alphatab.model.AccentuationType.Heavy; } if (( (( accentFlags.@value & 8 )) != 0 )) { note.accentuated = global::alphatab.model.AccentuationType.Normal; } break; } case "Tie": { if (string.Equals(c.@get("origin").ToLower(), "true")) { note.isTieOrigin = true; } if (string.Equals(c.@get("destination").ToLower(), "true")) { note.isTieDestination = true; } break; } case "Vibrato": { string _g1 = this.getValue(c); switch (_g1) { case "Slight": { note.vibrato = global::alphatab.model.VibratoType.Slight; break; } case "Wide": { note.vibrato = global::alphatab.model.VibratoType.Wide; break; } } break; } } } } } this._noteById.@set(noteId, note); } }
public virtual void parseBeat(global::haxe.root.Xml node) { unchecked { global::alphatab.model.Beat beat = new global::alphatab.model.Beat(); string beatId = node.@get("id"); { object __temp_iterator434 = node.iterator(); while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator434, "hasNext", 407283053, default(global::haxe.root.Array))) )) { global::haxe.root.Xml c = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator434, "next", 1224901875, default(global::haxe.root.Array))) ); if (( c.nodeType == global::haxe.root.Xml.Element )) { string _g = c._get_nodeName(); switch (_g) { case "Notes": { this._notesOfBeat.@set(beatId, global::haxe.lang.StringExt.split(this.getValue(c), " ")); break; } case "Rhythm": { this._rhythmOfBeat.@set(beatId, c.@get("ref")); break; } case "Fadding": { if (string.Equals(this.getValue(c), "FadeIn")) { beat.fadeIn = true; } break; } case "Tremolo": { string _g1 = this.getValue(c); switch (_g1) { case "1/2": { beat.tremoloSpeed = new global::haxe.lang.Null<global::alphatab.model.Duration>(new global::haxe.lang.Null<global::alphatab.model.Duration>(global::alphatab.model.Duration.Eighth, true).@value, true); break; } case "1/4": { beat.tremoloSpeed = new global::haxe.lang.Null<global::alphatab.model.Duration>(new global::haxe.lang.Null<global::alphatab.model.Duration>(global::alphatab.model.Duration.Sixteenth, true).@value, true); break; } case "1/8": { beat.tremoloSpeed = new global::haxe.lang.Null<global::alphatab.model.Duration>(new global::haxe.lang.Null<global::alphatab.model.Duration>(global::alphatab.model.Duration.ThirtySecond, true).@value, true); break; } } break; } case "Chord": { beat.chordId = this.getValue(c); break; } case "Hairpin": { string _g11 = this.getValue(c); switch (_g11) { case "Crescendo": { beat.crescendo = global::alphatab.rendering.glyphs.CrescendoType.Crescendo; break; } case "Decrescendo": { beat.crescendo = global::alphatab.rendering.glyphs.CrescendoType.Decrescendo; break; } } break; } case "Arpeggio": { if (string.Equals(this.getValue(c), "Up")) { beat.brushType = global::alphatab.model.BrushType.ArpeggioUp; } else { beat.brushType = global::alphatab.model.BrushType.ArpeggioDown; } break; } case "Properties": { this.parseBeatProperties(c, beat); break; } case "FreeText": { beat.text = this.getValue(c); break; } case "Dynamic": { string _g12 = this.getValue(c); switch (_g12) { case "PPP": { beat.dynamicValue = global::alphatab.model.DynamicValue.PPP; break; } case "PP": { beat.dynamicValue = global::alphatab.model.DynamicValue.PP; break; } case "P": { beat.dynamicValue = global::alphatab.model.DynamicValue.P; break; } case "MP": { beat.dynamicValue = global::alphatab.model.DynamicValue.MP; break; } case "MF": { beat.dynamicValue = global::alphatab.model.DynamicValue.MF; break; } case "F": { beat.dynamicValue = global::alphatab.model.DynamicValue.F; break; } case "FF": { beat.dynamicValue = global::alphatab.model.DynamicValue.FF; break; } case "FFF": { beat.dynamicValue = global::alphatab.model.DynamicValue.FFF; break; } } break; } case "GraceNotes": { string _g13 = this.getValue(c); switch (_g13) { case "OnBeat": { beat.graceType = global::alphatab.model.GraceType.OnBeat; break; } case "BeforeBeat": { beat.graceType = global::alphatab.model.GraceType.BeforeBeat; break; } } break; } } } } } this._beatById.@set(beatId, beat); } }
public virtual void parseVoice(global::haxe.root.Xml node) { unchecked { global::alphatab.model.Voice voice = new global::alphatab.model.Voice(); string voiceId = node.@get("id"); { object __temp_iterator432 = node.iterator(); while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator432, "hasNext", 407283053, default(global::haxe.root.Array))) )) { global::haxe.root.Xml c = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator432, "next", 1224901875, default(global::haxe.root.Array))) ); if (( c.nodeType == global::haxe.root.Xml.Element )) { string _g = c._get_nodeName(); switch (_g) { case "Beats": { this._beatsOfVoice.@set(voiceId, global::haxe.lang.StringExt.split(this.getValue(c), " ")); break; } } } } } this._voiceById.@set(voiceId, voice); } }
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 parseGeneralMidi(global::alphatab.model.Track track, global::haxe.root.Xml node) { unchecked { track.playbackInfo.port = global::Std.parseInt(this.getValue(this.findChildElement(node, "Port"))).@value; track.playbackInfo.program = global::Std.parseInt(this.getValue(this.findChildElement(node, "Program"))).@value; track.playbackInfo.primaryChannel = global::Std.parseInt(this.getValue(this.findChildElement(node, "PrimaryChannel"))).@value; track.playbackInfo.secondaryChannel = global::Std.parseInt(this.getValue(this.findChildElement(node, "SecondaryChannel"))).@value; track.isPercussion = string.Equals(node.@get("table"), "Percussion"); } }