Ejemplo n.º 1
0
        protected void DoPlayStatusChange(string vsName, VideoSourceState vsStatus, PlayState playStatus)
        {
            try
            {
                if (IsPlay && vsStatus > VideoSourceState.Norme)
                {
                    this.Reset();
                }

                if (OnPlayStatusChanged != null)
                {
                    if (CLocalSystem.MainForm != null)
                    {
                        MethodInvoker form_invoker = delegate
                        {
                            OnPlayStatusChanged(SystemContext, vsName, vsStatus, playStatus);
                        };
                        CLocalSystem.MainForm.Invoke(form_invoker);
                    }
                    else
                    {
                        OnPlayStatusChanged(SystemContext, vsName, vsStatus, playStatus);
                    }
                }
            }
            catch (Exception e)
            {
                CLocalSystem.WriteErrorLog(string.Format("CVideoSource.DoPlayStatusChange Exception:{0}", e));
            }
        }
Ejemplo n.º 2
0
        private void DoPlayStausChanged(IMonitorSystemContext context, string vsName, VideoSourceState vsStatus, PlayState playStatus)
        {
            //System.Console.Out.WriteLine("CVideoSourceManager.DoPlayStausChanged Name="+vsName+", vsStatus="+vsStatus+", playStatuss="+playStatus);

            if (OnPlayStatusChanged != null)
            {
                OnPlayStatusChanged(context, vsName, vsStatus, playStatus);
            }
        }
Ejemplo n.º 3
0
        private void DoPlayStatusChanged(IMonitorSystemContext context, string vsName, VideoSourceState vsStatus, PlayState playStatus)
        {
            //System.Console.Out.WriteLine("BackPlayer PlayStatusChanged hPlay="+hPlay+", vsStatus="+vsStatus+", playStatus="+playStatus);

            if (mPlayClient != null)
            {
                if (vsName.Equals(mPlayClient.Name))
                {
                    if (playStatus == PlayState.Play)
                    {
                        toolStripButton_Play.Text  = mStopText;
                        toolStripButton_Play.Image = mStopImage;

                        toolStripButton_Fast.Enabled   = true;
                        toolStripButton_Slow.Enabled   = true;
                        toolStripButton_Frame.Enabled  = true;
                        toolStripButton_Normal.Enabled = true;

                        if (mPlayClient != null)
                        {
                            if (toolStripLabel_PlayTime.Text != "")
                            {
                                toolStripLabel_PlayTime.Text = "已播放时间:" + mPlayClient.PlayTime.TimeOfDay;
                            }
                            else
                            {
                                toolStripLabel_PlayTime.Text = "已播放时间:00:00:00";
                            }
                        }

                        mTimer.Enabled = true;
                    }
                    else if (playStatus == PlayState.End)
                    {
                        Close();

                        if (IsCycle)
                        {
                            Play();
                        }
                        else
                        {
                            toolStripButton_Play.Text      = mPlayText;
                            toolStripButton_Play.Image     = mPlayImage;
                            toolStripButton_Fast.Enabled   = false;
                            toolStripButton_Slow.Enabled   = false;
                            toolStripButton_Frame.Enabled  = false;
                            toolStripButton_Normal.Enabled = false;
                        }
                    }
                    else if (playStatus == PlayState.Close)
                    {
                        toolStripButton_Play.Text      = mPlayText;
                        toolStripButton_Play.Image     = mPlayImage;
                        toolStripLabel_PlayTime.Text   = "";
                        toolStripButton_Fast.Enabled   = false;
                        toolStripButton_Slow.Enabled   = false;
                        toolStripButton_Frame.Enabled  = false;
                        toolStripButton_Normal.Enabled = false;
                    }
                    else
                    {
                        toolStripButton_Play.Text      = mPlayText;
                        toolStripButton_Play.Image     = mPlayImage;
                        toolStripButton_Fast.Enabled   = false;
                        toolStripButton_Slow.Enabled   = false;
                        toolStripButton_Frame.Enabled  = false;
                        toolStripButton_Normal.Enabled = false;
                    }

                    if (vsStatus > VideoSourceState.Norme)
                    {
                        Close();
                    }

                    if (OnPlayStatusChanged != null)
                    {
                        OnPlayStatusChanged(context, vsName, vsStatus, playStatus);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void DoPlayStateChanged(IMonitorSystemContext context, string vsName, VideoSourceState vsStatus, PlayState playStatus)
        {
            CFuncNode node = mLinkObj as CFuncNode;

            if (node != null)
            {
                IVideoSourceConfig vsConfig = node.ExtConfigObj as IVideoSourceConfig;
                if (vsConfig != null && vsConfig.SystemContext == context && vsConfig.Name.Equals(vsName))
                {
                    if (playStatus == PlayState.Play || playStatus == PlayState.Pause)
                    {
                        IsShowInfo = false;
                    }
                    else if (playStatus == PlayState.Stop)
                    {
                        IsShowInfo = false;
                    }
                    else
                    {
                        IsShowInfo = true;
                        pictureBox_play.Invalidate();
                    }

                    if (playStatus != PlayState.None)
                    {
                        IVideoSource vs = context.VideoSourceManager.GetVideoSource(vsName);
                        if (vs != null && vs.HWnd != this.HWnd)
                        {
                            vs.HWnd = this.HWnd;
                        }
                    }

                    if (OnPlayBoxStateChanged != null)
                    {
                        OnPlayBoxStateChanged(this);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private void DoPlayStatusChanged(IMonitorSystemContext context, string vsName, VideoSourceState vsStatus, PlayState playStatus)
        {
            if (mVSConfig.Name.Equals(vsName))
            {
                IFileVideoSource vs = context.VideoSourceManager.GetVideoSource(vsName) as IFileVideoSource;
                switch (playStatus)
                {
                case PlayState.Open:
                    if (vs != null)
                    {
                        InitPlayProgress((int)vs.TotalFrame);
                    }
                    button_open.Text         = "关闭";
                    button_play.Text         = "播放";
                    button_play.Enabled      = true;
                    button_playFrame.Enabled = true;
                    button_getFrame.Enabled  = true;
                    break;

                case PlayState.Play:
                    button_play.Text = "暂停";
                    break;

                case PlayState.Stop:
                    button_play.Text = "播放";
                    break;

                case PlayState.Close:
                    button_open.Text         = "打开";
                    button_play.Text         = "播放";
                    button_play.Enabled      = false;
                    button_playFrame.Enabled = false;
                    button_getFrame.Enabled  = false;
                    label_fileName.Text      = string.Format("{0}未打开文件", Desc);
                    label_totalTime.Text     = "0:00:00";
                    label_curTime.Text       = "0:00:00";
                    progressBar_play.Value   = 0;
                    break;
                }

                if (OnPlayStatusChanged != null)
                {
                    OnPlayStatusChanged(context, vsName, vsStatus, playStatus);
                }
            }
        }
Ejemplo n.º 6
0
        protected void DoPlayStatusChanged(IMonitorSystemContext context, string vsName, VideoSourceState vsStatus, PlayState playStatus)
        {
            if (mVideoSource != null && mVideoSource.Name.Equals(vsName))
            {
                if (playStatus == PlayState.Play)
                {
                    mStartTime = DateTime.Now;

                    button_play.Text = mStopText;

                    if (ShowButtons)
                    {
                        if (mVideoSource != null)
                        {
                            if (label_playtime.Text != "")
                            {
                                label_playtime.Text = "已播放时间:" + TimeSpanToStr(DateTime.Now - mStartTime);// + mVideoSource.PlayTime.TimeOfDay;
                            }
                            else
                            {
                                label_playtime.Text = "已播放时间:00:00:00";
                            }
                        }

                        mTimer.Enabled = true;
                    }
                }
                else if (playStatus == PlayState.End)
                {
                    Close();

                    if (mVSConfig.BoolValue("IsCycle"))
                    {
                        Play();
                    }
                    else
                    {
                        button_play.Text    = mPlayText;
                        button_play.Enabled = true;
                        pictureBox_play.Invalidate();
                    }
                }
                else if (playStatus == PlayState.Open)
                {
                    button_play.Text    = mPlayText;
                    button_play.Enabled = true;
                    label_playtime.Text = "";
                }
                else if (playStatus == PlayState.Close)
                {
                    button_play.Text    = mPlayText;
                    button_play.Enabled = false;
                    label_playtime.Text = "";
                }
                else
                {
                    button_play.Text = mPlayText;
                }

                if (OnPlayStatusChanged != null)
                {
                    OnPlayStatusChanged(context, vsName, vsStatus, playStatus);
                }
            }
        }
Ejemplo n.º 7
0
        private void DoPlayStausChanged(IMonitorSystemContext context, string vsName, VideoSourceState vsStatus, PlayState playStatus)
        {
            if (mBackPlayVS != null && mBackPlayVS.Name.Equals(vsName))
            {
                switch (playStatus)
                {
                case PlayState.Open:
                    break;

                case PlayState.Play:
                    IsShowInfo = false;
                    break;

                default:
                    StopPlayback();
                    locate(Index);
                    break;
                }

                if (OnBackPlayStateChanged != null)
                {
                    OnBackPlayStateChanged(this, context, playStatus);
                }
            }
            else if (mRealPlayVS != null && mRealPlayVS.Name.Equals(vsName))
            {
                switch (playStatus)
                {
                case PlayState.Open:
                    break;

                case PlayState.Play:
                    IsShowInfo = false;
                    break;

                default:
                    locate(Index);
                    break;
                }

                if (OnRealPlayStateChanged != null)
                {
                    OnRealPlayStateChanged(this, context, playStatus);
                }
            }
        }