Skip to content

Instantly share code, notes, and snippets.

@guillaC
Created December 22, 2021 21:50
Show Gist options
  • Save guillaC/80a4f2111abcf4a3630b1779c8626a6c to your computer and use it in GitHub Desktop.
Save guillaC/80a4f2111abcf4a3630b1779c8626a6c to your computer and use it in GitHub Desktop.
Fiverr Order #FO5164BE0C485
namespace Gap10Min
{
using ScriptPortal.Vegas;
using System.Windows.Forms;
using System.Collections.Generic;
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
Project proj = vegas.Project;
foreach (Track track in proj.Tracks)
{
Timecode tTimeCode = null;
Timecode gapeTimeCode = new Timecode(600000); //10 minutes
List<TrackEvent> trackEvents = new List<TrackEvent>();
foreach (TrackEvent trackEvent in track.Events)
{
trackEvents.Add(trackEvent);
}
trackEvents.Sort((a, b) => a.Start.CompareTo(b.Start));
foreach (TrackEvent trackEvent in trackEvents)
{
if (tTimeCode == null)
{
tTimeCode = trackEvent.End;
tTimeCode = tTimeCode + gapeTimeCode;
}
else
{
trackEvent.Start = tTimeCode;
tTimeCode.Nanos = trackEvent.End.Nanos;
tTimeCode = tTimeCode + gapeTimeCode;
}
}
}
MessageBox.Show("Done.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment