Example #1
0
 private void ChartForm_Closed(object sender, EventArgs e)
 {
     FormList.Remove(this);
     if (mCurrentChartForm == this)
     {
         StatisticForm.FreeStatistic();
         if (FormList.Count > 0)
         {
             mCurrentChartForm = (ChartForm)FormList[0];
         }
         else
         {
             mCurrentChartForm = null;
         }
     }
     om.SaveObject(m_code);
 }
Example #2
0
        private void OnStreamStarted()
        {
            this.Cursor = Cursors.Default;

            infoButton.Enabled = true;

            networkSettingsLayoutPanel.Enabled     = false;
            videoSourceSettingsLayoutPanel.Enabled = false;
            audioSourceSettingsLayoutPanel.Enabled = false;

            switchStreamingStateButton.Enabled = true;
            switchStreamingStateButton.Text    = "Stop Streaming";

            contextMenu.Enabled         = true;
            startToolStripMenuItem.Text = "Stop";

            var ex = mediaStreamer.ExceptionObj;

            if (ex != null)
            {
                captureStatusLabel.Text = "Streaming attempt has failed";

                var errorMessage = ex.Message;
                var iex          = ex.InnerException;
                if (iex != null)
                {
                    errorMessage = iex.Message;
                }

                MessageBox.Show(errorMessage);


                return;
            }

            var videoSettings = currentSession.VideoSettings;

            if (videoSettings.Enabled)
            {
                var captureDescr = videoSettings?.CaptureDevice;
                if (captureDescr.CaptureMode == CaptureMode.Screen)
                {
                    var screenDescr = (ScreenCaptureDevice)captureDescr;

                    if (screenDescr.Properties.ShowDebugBorder)
                    {
                        debugBorderForm         = new RegionForm(screenDescr.CaptureRegion);
                        debugBorderForm.Visible = true;
                    }

                    if (screenDescr.Properties.ShowDebugInfo)
                    {
                        if (statisticForm == null)
                        {
                            statisticForm = new StatisticForm();
                        }
                        statisticForm.Location = screenDescr.CaptureRegion.Location;

                        var stats = mediaStreamer.Stats;

                        statisticForm.Start(stats);
                    }

                    //if (selectAreaForm != null)
                    //{
                    //    selectAreaForm.Capturing = true;
                    //}
                }
            }

            captureStatusLabel.Text = "";
            var statusDescription = "";
            var _port             = currentSession.CommunicationPort;

            if (currentSession.CommunicationPort >= 0)
            {
                var listenUri = mediaStreamer.ListenUri;
                statusDescription = "Stream running on: " + listenUri.Host + ":" + listenUri.Port;
            }

            //"Waiting for connection at " + _port + " port";
            captureStatusDescriptionLabel.Text = statusDescription;
        }
Example #3
0
 private void ListForm_Activated(object sender, EventArgs e)
 {
     StatisticForm.HideStatistic();
 }
Example #4
0
 private void buttonStatistic_Click(object sender, EventArgs e)
 {
     sF = new StatisticForm();
     sF.Show();
 }