public void EditMoveAction(MoveChannel channel, float beatNumber, MoveType moveType) { App.logger.Debug("Editing " + (object)channel + "/" + (object)beatNumber + " = " + (object)moveType); MusicActionMoveCue musicActionMoveCue = (MusicActionMoveCue)null; int index1 = -1; for (int index2 = 0; index2 < this.musicActionList.Count; ++index2) { if (this.musicActionList[index2] is MusicActionMoveCue) { MusicActionMoveCue musicAction = (MusicActionMoveCue)this.musicActionList[index2]; if ((double)musicAction.beatNumber == (double)beatNumber && musicAction.moveAction.moveChannel == channel) { index1 = index2; musicActionMoveCue = musicAction; break; } if (index1 == 0 && (double)this.musicActionList[index2].beatNumber > (double)beatNumber) { index1 = index2; } } } if (moveType == MoveType.None) { if (index1 != -1) { App.logger.Debug("Deleting entry at " + (object)index1); this.musicActionList.RemoveAt(index1); } } else { if (musicActionMoveCue == null) { musicActionMoveCue = new MusicActionMoveCue(new MoveAction(moveType, channel), beatNumber, 0.0); if (index1 > 0) { this.musicActionList.Insert(index1, (MusicAction)musicActionMoveCue); } else { this.musicActionList.Add((MusicAction)musicActionMoveCue); } } App.logger.Debug("modified cue"); musicActionMoveCue.moveAction.moveType = moveType; } this.RecalculateCueTiming(); }
public MoveAction(MoveType type, MoveChannel channel) { this.moveType = type; this.moveChannel = channel; }