Exemplo n.º 1
0
        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);
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void ModifyCueCamera(int Camera)
 {
     if (CueListView.SelectedObjects.Count > 0)
     {
         BufferCue cue = CueListView.SelectedObjects[0] as BufferCue;
         cue.Channel = server.Channels[Camera];
         CueListView.RefreshObject(cue);
     }
 }
Exemplo n.º 3
0
 private void CloneSelected()
 {
     foreach (BufferCue item in CueListView.SelectedObjects)
     {
         BufferCue newCue = new BufferCue(item);
         //CueListView.AddObject(newCue);
         CueListView.AddObject(newCue);
         // AddCueToList(newCue);
     }
 }
Exemplo n.º 4
0
        private void DeleteSelected()
        {
            List <BufferCue> toDelete = new List <BufferCue>();

            foreach (BufferCue item in CueListView.SelectedObjects)
            {
                toDelete.Add(item);
            }
            foreach (BufferCue item in toDelete)
            {
                CueListView.RemoveObject(item);
            }
        }
Exemplo n.º 5
0
 private void Tag(string tag)
 {
     if (CueListView.SelectedObjects.Count > 0)
     {
         foreach (BufferCue cue in CueListView.SelectedObjects)
         {
             if (cue.Tags.Contains(tag))
             {
                 cue.Tags.Remove(tag);
             }
             else
             {
                 cue.Tags.AddLast(tag);
             }
             CueListView.RefreshObject(cue);
         }
     }
 }
Exemplo n.º 6
0
        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();
        }
Exemplo n.º 7
0
        private void MainWindow_KeyUp(object sender, KeyEventArgs e)
        {
            if (!ServerAddressComboBox.Focused)
            {
                if (e.Modifiers == Keys.None)
                {
                    switch (e.KeyCode)
                    {
                    case Keys.Up:
                    case Keys.Down:
                        CueListView.Focus();
                        break;

                    case Keys.I:
                        SetInPointTemp();
                        break;

                    case Keys.O:
                        SetOutPointTemp();
                        break;

                    case Keys.D1:
                        SwitchToCamera1();
                        break;

                    case Keys.D2:
                        SwitchToCamera2();
                        break;

                    case Keys.D3:
                        SwitchToCamera3();
                        break;

                    case Keys.Z:
                        Tag(Tags[0]);
                        break;

                    case Keys.X:
                        Tag(Tags[1]);
                        break;

                    case Keys.C:
                        Tag(Tags[2]);
                        break;

                    case Keys.V:
                        Tag(Tags[3]);
                        break;

                    case Keys.B:
                        Tag(Tags[4]);
                        break;

                    case Keys.N:
                        Tag(Tags[5]);
                        break;

                    case Keys.M:
                        Tag(Tags[6]);
                        break;

                    case Keys.Enter:
                        if ((InPointTemp > 0) && (OutPointTemp == 0))
                        {
                            SetOutPointTemp();
                        }
                        CueOneSelected();
                        break;

                    case Keys.J:
                        SetShuttleSpeed(-1);
                        break;

                    case Keys.K:
                    case Keys.Q:
                        SetSpeed(0);
                        SpeedBar.Value = 0;
                        ClearShuttleSpeed();
                        break;

                    case Keys.W:
                        SetSpeed(0.25);
                        SpeedBar.Value = 25;
                        ClearShuttleSpeed();
                        break;

                    case Keys.E:
                        SetSpeed(0.33);
                        SpeedBar.Value = 33;
                        ClearShuttleSpeed();
                        break;

                    case Keys.R:
                        SetSpeed(0.5);
                        SpeedBar.Value = 50;
                        ClearShuttleSpeed();
                        break;

                    case Keys.T:
                        SetSpeed(0.75);
                        SpeedBar.Value = 75;
                        ClearShuttleSpeed();
                        break;

                    case Keys.L:
                    case Keys.Y:
                        SetSpeed(1);
                        SpeedBar.Value = 100;
                        ClearShuttleSpeed();
                        break;

                    case Keys.Escape:
                        CueListView.Focus();
                        break;

                    case Keys.Delete:
                        DeleteSelected();
                        break;

                    case Keys.S:
                        if (SpeedBar.Value + 10 <= SpeedBar.Maximum)
                        {
                            SpeedBar.Value += 10;
                        }
                        else
                        {
                            SpeedBar.Value = SpeedBar.Maximum;
                        }
                        SetSpeed((double)SpeedBar.Value / (double)SpeedBar.Maximum);
                        ClearShuttleSpeed();
                        break;

                    case Keys.A:
                        if (SpeedBar.Value - 10 >= 0)
                        {
                            SpeedBar.Value -= 10;
                        }
                        else
                        {
                            SpeedBar.Value = 0;
                        }
                        SetSpeed((double)SpeedBar.Value / (double)SpeedBar.Maximum);
                        ClearShuttleSpeed();
                        break;

                    case Keys.Add:
                    case Keys.Insert:
                        CloneSelected();
                        break;

                    case Keys.OemPeriod:
                        GoLive();
                        break;

                    case Keys.OemSemicolon:
                        GoBack1();
                        break;

                    case Keys.OemQuotes:
                        GoForward1();
                        break;
                    }
                }
                else if (e.Modifiers == Keys.Control)
                {
                    switch (e.KeyCode)
                    {
                    case Keys.D1:
                        ModifyCueCamera(0);
                        break;

                    case Keys.D2:
                        ModifyCueCamera(1);
                        break;

                    case Keys.D3:
                        ModifyCueCamera(2);
                        break;

                    case Keys.Enter:
                        if ((InPointTemp > 0) && (OutPointTemp == 0))
                        {
                            SetOutPointTemp();
                        }
                        PlayOneSelected();
                        break;
                    }
                }
                else if (e.Modifiers == Keys.Shift)
                {
                    switch (e.KeyCode)
                    {
                    case Keys.Enter:
                        if ((InPointTemp > 0) && (OutPointTemp == 0))
                        {
                            SetOutPointTemp();
                        }
                        PlayOneSelected(0.5);
                        break;
                    }
                }
                else if (e.Modifiers == (Keys.Control | Keys.Shift))
                {
                    switch (e.KeyCode)
                    {
                    case Keys.G:
                        StopShuttle();
                        break;

                    case Keys.H:
                        ShuttlePlus05();
                        break;

                    case Keys.J:
                        ShuttlePlus10();
                        break;

                    case Keys.K:
                        ShuttlePlus20();
                        break;

                    case Keys.L:
                        ShuttlePlus40();
                        break;

                    case Keys.P:
                        ShuttlePlus100();
                        break;

                    case Keys.O:
                        ShuttlePlus400();
                        break;

                    case Keys.F:
                        ShuttleMinus05();
                        break;

                    case Keys.D:
                        ShuttleMinus10();
                        break;

                    case Keys.S:
                        ShuttleMinus20();
                        break;

                    case Keys.A:
                        ShuttleMinus40();
                        break;

                    case Keys.Q:
                        ShuttleMinus100();
                        break;

                    case Keys.W:
                        ShuttleMinus400();
                        break;


                    case Keys.Y:
                        GoForward1Frame();
                        break;

                    case Keys.T:
                        GoBack1Frame();
                        break;
                    }
                }

                e.SuppressKeyPress = true;
                e.Handled          = true;
            }
        }
Exemplo n.º 8
0
 private void MainWindow_Load(object sender, EventArgs e)
 {
     SystemStatusLabel.Text = "System framerate: " + this.SystemFramerate + " fps";
     CueListView.SetObjects(cues);
 }