public TimeIntervalCollection Reverse() { TimeIntervalCollection complementary = new TimeIntervalCollection(Start, End); if (Count == 0) { complementary.Add(Start, End); } else { if (intervalList[0].Start > Start) { complementary.Add(Start, intervalList[0].Start); } for (int i = 1; i < intervalList.Count; i++) { complementary.Add(intervalList[i - 1].End, intervalList[i].Start); } if (intervalList[Count - 1].End != End) { complementary.Add(intervalList[intervalList.Count - 1].End, End); } } return(complementary); }
public ConversionOptions(VideoEncoder encoder) { Encoder = encoder; NoAudio = false; EncodingMode = 0; EncodeSections = new TimeIntervalCollection(TimeSpan.Zero); AudioConversionOptions = new Dictionary <int, AudioConversionOptions>(); Filters = new List <IFilter>(); FadeEffect = false; }
public ConversionOptions(Encoder encoder) { Encoder = encoder; CropData = CropData.NoCrop; Resolution = Resolution.SameAsSource; Rotation = Rotation.NoRotation; Framerate = 0; SkipAudio = false; EncodingMode = 0; EncodeSections = new TimeIntervalCollection(TimeSpan.Zero); }
public void UpdateIntervalCollection(TimeIntervalCollection intervalCollection, TimeSpan duration) { gridCutSections.Children.Clear(); if (intervalCollection.Count > 0) { foreach (var timeInterval in intervalCollection) { Border b = new Border(); b.Style = Resources["cutSectionBorder"] as Style; double max = duration.TotalSeconds; double leftMargin = timeInterval.Start.TotalSeconds * ActualWidth / max; double rightMargin = (max - timeInterval.End.TotalSeconds) * ActualWidth / max; b.Margin = new Thickness(leftMargin, 0, rightMargin, 0); gridCutSections.Children.Add(b); } } else { Border b = new Border(); b.Style = Resources["cutSectionBorder"] as Style; b.Margin = new Thickness(0, 0, 0, 0); gridCutSections.Children.Add(b); } }