public void ReadSong(Song2014 songXml, Sng2014File sngFile)
{
// fix for 'Object reference not set to an instance of an object' error
Int16[] tuning = { 0, 0, 0, 0, 0, 0 };
try
{
tuning[0] = songXml.Tuning.String0;
tuning[1] = songXml.Tuning.String1;
tuning[2] = songXml.Tuning.String2;
tuning[3] = songXml.Tuning.String3;
tuning[4] = songXml.Tuning.String4;
tuning[5] = songXml.Tuning.String5;
}
catch
{
// just ignore any error and use any tuning that is available from XML file
}
parseEbeats(songXml, sngFile);
parsePhrases(songXml, sngFile);
parseChords(songXml, sngFile, tuning, songXml.Arrangement == "Bass");
// vocals use different parse function
sngFile.Vocals = new VocalSection { Vocals = new Vocal[0] };
parsePhraseIterations(songXml, sngFile);
parsePhraseExtraInfo(songXml, sngFile);
parseNLD(songXml, sngFile);
parseActions(songXml, sngFile);
parseEvents(songXml, sngFile);
parseTones(songXml, sngFile);
parseDNAs(songXml, sngFile);
parseSections(songXml, sngFile);
parseArrangements(songXml, sngFile);
parseMetadata(songXml, sngFile, tuning);
// this needs to be initialized after arrangements
parseChordNotes(songXml, sngFile);
}