Ejemplo n.º 1
0
        private void OnVideoProcessExited()
        {
            if (m_VideoProcess != null && m_VideoProcess.HasExited())
            {
                if (ckbAutoRestart.Checked && timerRestartVideo.Interval >= 1000)
                {
                    BeginInvoke((Action)(() =>
                    {
                        timerRestartVideo.Enabled = true;
                        timerRestartVideo.Start();
                    }));

                    LogVideoMsg("\n");
                    LogVideoMsg("Video process will be restarted in " + (timerRestartVideo.Interval / 1000) + " second(s) ... \n");
                    return;
                }
            }

            if ((m_VideoProcess == null || m_VideoProcess.HasExited()) &&
                (m_AudioProcess == null || m_AudioProcess.HasExited()))
            {
                BeginInvoke((Action)(() =>
                {
                    try
                    {
                        if (!m_UpdatedUI4Start)
                        {
                            m_UpdatedUI4Start = true;

                            gbMediaSource.Enabled = true;
                            gbVideoTask.Enabled = true;
                            gbAudioTask.Enabled = true;

                            btnStart.Enabled = true;
                            btnStop.Enabled = true;

                            notifyIconMain.Icon = notifyIconStop.Icon;
                            notifyIconMain.Text = this.Text + " (" + notifyIconStop.Text + ")";
                        }
                    }
                    catch { }
                }));
            }
        }