Created
December 22, 2021 21:50
-
-
Save guillaC/80a4f2111abcf4a3630b1779c8626a6c to your computer and use it in GitHub Desktop.
Fiverr Order #FO5164BE0C485
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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