Beispiel #1
0
        public void recordTime(object source, System.Timers.ElapsedEventArgs e)
        {
            if (!m_bPauseLocalPlay)
            {
                float pos = XMSDK.H264_DVR_GetPlayPos(m_nLocalplayHandle);
                trackBarLocalPlayPos.Value = Convert.ToInt32(pos * 1000);
            }

            if (!m_bPauseNetPlay)
            {
                float pos = XMSDK.H264_DVR_GetPlayPos(m_nNetPlayHandle);
                trackBarNetPlayPos.Value = Convert.ToInt32(pos * 1000);
            }

            if (m_DownLoadFileHandle != 0)
            {
                int nPos = XMSDK.H264_DVR_GetDownloadPos(m_DownLoadFileHandle);
                if (nPos < 0)           //fail
                {
                    XMSDK.H264_DVR_StopGetFile(m_DownLoadFileHandle);
                    progressBarDownloadPos.Value = 0;
                    m_DownLoadFileHandle         = 0;
                    btnDownload.Text             = "Download";
                    MessageBox.Show("Get download process fail !");
                    timerDownload.Stop();
                }
                if (nPos == 100)                //download end
                {
                    XMSDK.H264_DVR_StopGetFile(m_DownLoadFileHandle);
                    m_DownLoadFileHandle = 0;

                    timerDownload.Stop();
                    progressBarDownloadPos.Value = 0;
                    btnDownload.Text             = "Download";
                    MessageBox.Show("Download Finished");
                    return;
                }
                if (nPos > 100)         //abnormal
                {
                    XMSDK.H264_DVR_StopGetFile(m_DownLoadFileHandle);
                    m_DownLoadFileHandle         = 0;
                    progressBarDownloadPos.Value = 0;
                    btnDownload.Text             = "Download";
                    MessageBox.Show("Download Error");
                }
                else
                {
                    progressBarDownloadPos.Value = nPos;
                }
            }
        }