public void read(EndianBinaryReader r)
{
try
{
Count = r.ReadInt32();
BPMs = new Bpm[Count];
for (int i = 0; i < Count; i++)
{
var obj = new Bpm();
obj.read(r);
BPMs[i] = obj;
}
}
catch (Exception ex)
{
// incomplete song information causes exceptions during conversion
// such as, "End of Stream reached with 4 bytes left to read"
throw new Exception("Corrupt CDLC ... Regenerating with Creator GUI may fix it." + Environment.NewLine +
"Make sure the song information is complete and correct, including Song Year and Avg Tempo information. (HINT)" + Environment.NewLine +
ex.Message + Environment.NewLine + Environment.NewLine);
}
}