RocksmithToolkitLib.Sng2014HSL.Sng2014FileWriter.parseEbeats C# (CSharp) Method

parseEbeats() private method

private parseEbeats ( Song2014 xml, Sng2014File sng ) : void
xml Song2014
sng Sng2014File
return void
        private void parseEbeats(Song2014 xml, Sng2014File sng)
        {
            sng.BPMs = new BpmSection();
            sng.BPMs.Count = xml.Ebeats.Length;
            sng.BPMs.BPMs = new Bpm[sng.BPMs.Count];
            Int16 measure = 0;
            Int16 beat = 0;
            for (int i = 0; i < sng.BPMs.Count; i++)
            {
                var ebeat = xml.Ebeats[i];
                var bpm = new Bpm();
                bpm.Time = ebeat.Time;
                if (ebeat.Measure >= 0)
                {
                    measure = ebeat.Measure;
                    beat = 0;
                }
                else
                {
                    beat++;
                }
                bpm.Measure = measure;
                bpm.Beat = beat;
                bpm.PhraseIteration = getPhraseIterationId(xml, bpm.Time, true);
                if (beat == 0)
                {
                    bpm.Mask |= 1;
                    if (measure % 2 == 0)
                        bpm.Mask |= 2;
                }
                sng.BPMs.BPMs[i] = bpm;
            }
        }