public void ParseSections(string edlFilePath, string outputFilePath, Predicate <IEdlEntry> predicate) { var edlFileContents = File.ReadAllText(edlFilePath); var edl = new CMX3600Deserializer().Read(edlFileContents); List <Section> sections = new(); foreach (var entry in edl) { if (predicate == null || predicate(entry)) { var outTC = new TimeCode(entry.RecordOut, SmpteFrameRate.Smpte25); var outTC2 = TimeCode.FromFrames(outTC.TotalFrames - 1, outTC.FrameRate); var section = new Section() { In = new TimeCode(entry.RecordIn, SmpteFrameRate.Smpte25), Out = outTC2 }; sections.Add(section); } } var sw = new SectionWriter(); sw.WriteToFile(outputFilePath, sections); }
public IEnumerable <Item> GetItems() { var edl = new CMX3600Deserializer(Options.Create(new CMX3600DeserializerSettings { IgnoreFps = true })); var edlText = File.ReadAllText(@"C:\Users\steph\OneDrive\Desktop\20210702\ASSEMBLIES - ACT 3.02.00.07.FED SEP.01.edl"); var entries = edl.Read(edlText); var retval = new List <Item>(); foreach (var entry in entries.Where(p => p.ClipName.Contains("V00007341"))) //36-40 { if (string.IsNullOrEmpty(entry.RecordIn)) { throw new InvalidOperationException("Timecode should not be empty"); } retval.Add(new Item { TimeCode = entry.RecordIn }); } return(retval); }