Пример #1
0
        public void AddNewSegment()
        {
            SegmentData _cutsegment = new SegmentData();

            _segmentslist.Add((object)_cutsegment);
            _listchanged = true;
        }
Пример #2
0
 public bool LoadEDLFile(string VideoPath)
 {
     // try to found edl file
     try
     {
         string EDLFileName = Path.ChangeExtension(VideoPath, ".edl");
         if (File.Exists(EDLFileName))
         {
             if (Microsoft.MediaCenter.Hosting.AddInHost.Current.MediaCenterEnvironment.Dialog("For this video EDL file found. Do you want to load it?", "Found EDL file", (DialogButtons)12, 0, true) == DialogResult.Yes)
             {
                 // try to load file
                 using (StreamReader sr = new StreamReader(EDLFileName))
                 {
                     String line;
                     char[] charSeparator = new char[] { ' ' };
                     _segmentslist.Clear();
                     while ((line = sr.ReadLine()) != null)
                     {
                         // parse edl line from file
                         string[] parseline = line.Split(charSeparator, 3, StringSplitOptions.RemoveEmptyEntries);
                         //try convert to timespan
                         SegmentData _cutsegment = new SegmentData();
                         _cutsegment.strStartPosition = parseline[0];
                         _cutsegment.strEndPosition   = parseline[1];
                         _cutsegment.EDLAction        = 0;
                         _segmentslist.Add((object)_cutsegment);
                     }
                 }
                 return(true);
             }
         }
     }
     catch
     {
     }
     return(false);
 }