private void ImportCues(String FileName) { char[] separators = new char[] { ' ', '\t' }; FileStream fs = new FileStream(FileName, FileMode.Open); StreamReader sr = new StreamReader(fs, Encoding.ASCII); Dictionary <string, string> sources = new Dictionary <string, string>(); string header = sr.ReadLine(); if (header.StartsWith("mplayer EDL")) // valid EDL file { while (!sr.EndOfStream) { string line = sr.ReadLine(); if (line.StartsWith("<")) // Source video defines { string[] elements = line.Split(separators, StringSplitOptions.RemoveEmptyEntries); sources.Add(elements[1], elements[2]); } else // Cue points { string[] elements = line.Split(separators, StringSplitOptions.RemoveEmptyEntries); string[] timecodes = elements[1].Split('-'); BufferCue cue = new BufferCue(UInt64.Parse(timecodes[0]), UInt64.Parse(timecodes[1]), sources[elements[0]]); CueListView.AddObject(cue); } } } }
private void CloneSelected() { foreach (BufferCue item in CueListView.SelectedObjects) { BufferCue newCue = new BufferCue(item); //CueListView.AddObject(newCue); CueListView.AddObject(newCue); // AddCueToList(newCue); } }
private void SetOutPointTemp() { OutPointTemp = server.Channels[3].Producer.PlaybackHead; if (OutPointTemp < NoInPointDiff) { InPointTemp = 1; } if (InPointTemp == 0) { InPointLabel.Text = FormatTime(OutPointTemp - NoInPointDiff, SystemFramerate); } OutPointLabel.Text = FormatTime(OutPointTemp, SystemFramerate); BufferCue cue = new BufferCue((InPointTemp > 0 ? InPointTemp : OutPointTemp - NoInPointDiff), OutPointTemp, currentPGMChannel); CueListView.AddObject(cue); // AddCueToList(cue); ClearPointTemp(); }