public void AddTickData(BeatTick pStartPosition, BeatTick pEndPosition, GtTickData pTickData) { if (pStartPosition > pEndPosition) { throw new InvalidEndPosition("StartPosition can't be greater then EndPosition"); } this[pStartPosition.Beat, pStartPosition.Tick].MomentInMiliseconds = pTickData.MomentInMiliseconds; for (BeatTick pos = pStartPosition; pos <= pEndPosition; pos = pos.AddTicks(10)) { this[pos.Beat, pos.Tick].RemarkOrChordName = pTickData.RemarkOrChordName; this[pos.Beat, pos.Tick].String1 = pTickData.String1; this[pos.Beat, pos.Tick].String2 = pTickData.String2; this[pos.Beat, pos.Tick].String3 = pTickData.String3; this[pos.Beat, pos.Tick].String4 = pTickData.String4; this[pos.Beat, pos.Tick].String5 = pTickData.String5; this[pos.Beat, pos.Tick].String6 = pTickData.String6; this[pos.Beat, pos.Tick].IsStartTick = false; this[pos.Beat, pos.Tick].IsEndTick = false; } //mark the first as StartTick this[pStartPosition.Beat, pStartPosition.Tick].IsStartTick = true; //mark the last as EndTick this[pEndPosition.Beat, pEndPosition.Tick].IsEndTick = true; }
/// <summary> /// Process the data stored in fTckDataTable, creating the items in fNotes. /// </summary> private void InitializeSceneItems() { var auxiliarTable = new GtSceneGuitarNote[6]; var endPosition = new BeatTick(fTickDataTable.NumberOfBeats, 470); for (var pos = new BeatTick(1, 0); pos <= endPosition; pos = pos.AddTicks(10)) { var tickData = fTickDataTable[pos.Beat, pos.Tick]; SetSceneGuitarNote(ref auxiliarTable, 1, tickData.String1, pos); SetSceneGuitarNote(ref auxiliarTable, 2, tickData.String2, pos); SetSceneGuitarNote(ref auxiliarTable, 3, tickData.String3, pos); SetSceneGuitarNote(ref auxiliarTable, 4, tickData.String4, pos); SetSceneGuitarNote(ref auxiliarTable, 5, tickData.String5, pos); SetSceneGuitarNote(ref auxiliarTable, 6, tickData.String6, pos); if (tickData.IsEndTick) { AddNewNoteWhenExists(ref auxiliarTable, 1); AddNewNoteWhenExists(ref auxiliarTable, 2); AddNewNoteWhenExists(ref auxiliarTable, 3); AddNewNoteWhenExists(ref auxiliarTable, 4); AddNewNoteWhenExists(ref auxiliarTable, 5); AddNewNoteWhenExists(ref auxiliarTable, 6); } } }