28 lines
815 B
C#
28 lines
815 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using JD.Serialization;
|
|
|
|
namespace JDSongConverter.Utils
|
|
{
|
|
public static class TapeUtils
|
|
{
|
|
public static void FixCollisions(this IEnumerable<Clip> clips)
|
|
{
|
|
var clipList = clips.ToList();
|
|
for (int i = 0; i < clipList.Count - 1; i++)
|
|
{
|
|
var currentClip = clipList[i];
|
|
var nextClip = clipList[i+1];
|
|
|
|
if (nextClip.StartFrame <= currentClip.StartFrame)
|
|
{
|
|
nextClip.StartFrame = currentClip.StopFrame;
|
|
}
|
|
else if (currentClip.StopFrame > nextClip.StartFrame)
|
|
{
|
|
currentClip.StopFrame = nextClip.StartFrame;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|