Example #1
0
		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 = [email protected]("id");
				chord.name = [email protected]("name");
				[email protected](chordId, chord);
			}
		}
Example #2
0
		public virtual   void parseTrackProperty(global::alphatab.model.Track track, global::haxe.root.Xml node)
		{
			unchecked 
			{
				string propertyName = [email protected]("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)[email protected]);
							}
							
						}
						
						track.tuning.reverse();
						break;
					}
					
					
					case "DiagramCollection":
					{
						this.parseDiagramCollection(track, node);
						break;
					}
					
					
					case "CapoFret":
					{
						track.capo = global::Std.parseInt(this.getValue(this.findChildElement(node, "Fret")))[email protected];
						break;
					}
					
					
				}
				
			}
		}
Example #3
0
		public virtual   void parseRhythm(global::haxe.root.Xml node)
		{
			unchecked 
			{
				global::alphatab.importer.GpxRhythm rhythm = new global::alphatab.importer.GpxRhythm();
				string rhythmId = [email protected]("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":
										{
											[email protected] = global::alphatab.model.Duration.Whole;
											break;
										}
										
										
										case "Half":
										{
											[email protected] = global::alphatab.model.Duration.Half;
											break;
										}
										
										
										case "Quarter":
										{
											[email protected] = global::alphatab.model.Duration.Quarter;
											break;
										}
										
										
										case "Eighth":
										{
											[email protected] = global::alphatab.model.Duration.Eighth;
											break;
										}
										
										
										case "16th":
										{
											[email protected] = global::alphatab.model.Duration.Sixteenth;
											break;
										}
										
										
										case "32nd":
										{
											[email protected] = global::alphatab.model.Duration.ThirtySecond;
											break;
										}
										
										
										case "64th":
										{
											[email protected] = global::alphatab.model.Duration.SixtyFourth;
											break;
										}
										
										
									}
									
									break;
								}
								
								
								case "PrimaryTuplet":
								{
									rhythm.tupletNumerator = global::Std.parseInt([email protected]("num"))[email protected];
									rhythm.tupletDenominator = global::Std.parseInt([email protected]("den"))[email protected];
									break;
								}
								
								
								case "AugmentationDot":
								{
									rhythm.dots = global::Std.parseInt([email protected]("count"))[email protected];
									break;
								}
								
								
							}
							
						}
						
					}
					
				}
				
				[email protected](rhythmId, rhythm);
			}
		}
Example #4
0
		public virtual   void parseTrack(global::haxe.root.Xml node)
		{
			unchecked 
			{
				global::alphatab.model.Track track = new global::alphatab.model.Track();
				string trackId = [email protected]("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;
								}
								
								
							}
							
						}
						
					}
					
				}
				
				[email protected](trackId, track);
			}
		}
Example #5
0
		public virtual   void parseNote(global::haxe.root.Xml node)
		{
			unchecked 
			{
				global::alphatab.model.Note note = new global::alphatab.model.Note();
				string noteId = [email protected]("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))[email protected];
									note.trillSpeed = global::alphatab.model.Duration.Sixteenth;
									break;
								}
								
								
								case "Accent":
								{
									global::haxe.lang.Null<int> accentFlags = global::Std.parseInt(this.getValue(c));
									if (( (( [email protected] & 1 )) != 0 )) 
									{
										note.isStaccato = true;
									}
									
									if (( (( [email protected] & 4 )) != 0 )) 
									{
										note.accentuated = global::alphatab.model.AccentuationType.Heavy;
									}
									
									if (( (( [email protected] & 8 )) != 0 )) 
									{
										note.accentuated = global::alphatab.model.AccentuationType.Normal;
									}
									
									break;
								}
								
								
								case "Tie":
								{
									if (string.Equals([email protected]("origin").ToLower(), "true")) 
									{
										note.isTieOrigin = true;
									}
									
									if (string.Equals([email protected]("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;
								}
								
								
							}
							
						}
						
					}
					
				}
				
				[email protected](noteId, note);
			}
		}
Example #6
0
		public virtual   void parseBeat(global::haxe.root.Xml node)
		{
			unchecked 
			{
				global::alphatab.model.Beat beat = new global::alphatab.model.Beat();
				string beatId = [email protected]("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":
								{
									[email protected](beatId, global::haxe.lang.StringExt.split(this.getValue(c), " "));
									break;
								}
								
								
								case "Rhythm":
								{
									[email protected](beatId, [email protected]("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)[email protected], 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)[email protected], 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)[email protected], 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;
								}
								
								
							}
							
						}
						
					}
					
				}
				
				[email protected](beatId, beat);
			}
		}
Example #7
0
		public virtual   void parseVoice(global::haxe.root.Xml node)
		{
			unchecked 
			{
				global::alphatab.model.Voice voice = new global::alphatab.model.Voice();
				string voiceId = [email protected]("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":
								{
									[email protected](voiceId, global::haxe.lang.StringExt.split(this.getValue(c), " "));
									break;
								}
								
								
							}
							
						}
						
					}
					
				}
				
				[email protected](voiceId, voice);
			}
		}
Example #8
0
		public virtual   void parseBar(global::haxe.root.Xml node)
		{
			unchecked 
			{
				global::alphatab.model.Bar bar = new global::alphatab.model.Bar();
				string barId = [email protected]("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":
								{
									[email protected](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;
								}
								
								
							}
							
						}
						
					}
					
				}
				
				[email protected](barId, bar);
			}
		}
Example #9
0
		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")))[email protected];
				track.playbackInfo.program = global::Std.parseInt(this.getValue(this.findChildElement(node, "Program")))[email protected];
				track.playbackInfo.primaryChannel = global::Std.parseInt(this.getValue(this.findChildElement(node, "PrimaryChannel")))[email protected];
				track.playbackInfo.secondaryChannel = global::Std.parseInt(this.getValue(this.findChildElement(node, "SecondaryChannel")))[email protected];
				track.isPercussion = string.Equals([email protected]("table"), "Percussion");
			}
		}