diff --git a/extras/SonyVegas/Debug Rhubarb.cs b/extras/SonyVegas/Debug Rhubarb.cs index 61c5f3a..62b6b98 100644 --- a/extras/SonyVegas/Debug Rhubarb.cs +++ b/extras/SonyVegas/Debug Rhubarb.cs @@ -49,7 +49,15 @@ public class EntryPoint { List filteredEvents = FilterEvents(timedEvents[eventType], visualization.Regex); foreach (TimedEvent timedEvent in filteredEvents) { Timecode start = Timecode.FromSeconds(timedEvent.Start); - Timecode length = Timecode.FromSeconds(timedEvent.End) - start; + Timecode end = Timecode.FromSeconds(timedEvent.End); + Timecode length = end - start; + if (config.LoopRegionOnly) { + Timecode loopRegionStart = vegas.Transport.LoopRegionStart; + Timecode loopRegionEnd = loopRegionStart + vegas.Transport.LoopRegionLength; + if (start < loopRegionStart || start > loopRegionEnd || end < loopRegionStart || end > loopRegionEnd) { + continue; + } + } switch (visualization.VisualizationType) { case VisualizationType.Marker: project.Markers.Add(new Marker(start, timedEvent.Value)); @@ -149,6 +157,7 @@ public class Config { private string logFile; private bool clearMarkers; private bool clearRegions; + private bool loopRegionOnly; private List visualizations = new List(); [DisplayName("Log File")] @@ -173,6 +182,13 @@ public class Config { set { clearRegions = value; } } + [DisplayName("Loop region only")] + [Description("Adds regions or markers to the loop region only.")] + public bool LoopRegionOnly { + get { return loopRegionOnly; } + set { loopRegionOnly = value; } + } + [DisplayName("Visualization rules")] [Description("Specify how to visualize various log events.")] [Editor(typeof(CollectionEditor), typeof(UITypeEditor))]