public bool SetToolTipInfo(VideoPlayWindow v, string strTip)
        {
            bool bolResult = false;

            ttip.SetToolTip(v.PicMain, strTip);
            return(bolResult);
        }
示例#2
0
 /// <summary>
 /// SDK状态改变回调
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="videoType"></param>
 /// <param name="sdkState"></param>
 public void SDKStateChangedCallBackEvent(object sender, Enum_SDKState sdkState)
 {
     if (bolDisPlaySDKState)
     {
         VideoPlayWindow v = (VideoPlayWindow)sender;
         DisplayRecord(sdkState.ToString());
     }
 }
        public bool SetPlayVideo(VideoPlayWindow window, VideoInfo v)
        {
            bool bolResult = false;

            window.Init_VideoInfo(v);
            window.VideoPlay();
            SetToolTipInfo(window);
            return(bolResult);
        }
 public void SetToolTipInfo(VideoPlayWindow v)
 {
     if (DisplayToolTipInfo && v.CurrentVideoInfo != null)
     {
         StringBuilder Temp_sbDisplayToopTipInfo = new StringBuilder();
         Temp_sbDisplayToopTipInfo.Append("(" + v.CurrentVideoInfo.DVSNumber + ")");
         Temp_sbDisplayToopTipInfo.Append("" + v.CurrentVideoInfo.DVSName + "");
         Temp_sbDisplayToopTipInfo.Append("_" + v.CurrentCameraInfo.CameraName + "");
         ttip.SetToolTip(v.PicMain, Temp_sbDisplayToopTipInfo.ToString());
     }
 }
 /// <summary>
 /// SDK事件回调
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="evType"></param>
 /// <param name="strTag"></param>
 public void SDKEventCallBackEvent(object sender, Enum_SDKEventType evType, string strTag)
 {
     if (bolDisplaySDKEvent)
     {
         VideoPlayWindow v = (VideoPlayWindow)sender;
         if (!string.IsNullOrEmpty(strTag))
         {
             DisplayRecord(evType.ToString() + "[" + strTag + "]");
         }
         DisplayRecord(evType.ToString());
     }
 }
        /// <summary>
        /// 设置播放窗体为最大化模式
        /// </summary>
        /// <param name="vWindows"></param>
        /// <returns></returns>
        public bool SetPlayWindowsMax(VideoPlayWindow vWindows)
        {
            bool bolResult       = false;
            int  Temp_intRow     = tablayMain.GetRow(vWindows);
            int  Temp_intColumns = tablayMain.GetColumn(vWindows);

            tablayMain.SuspendLayout();
            #region 移除旧控件 信息
            #endregion
            if (PlayWindowsMax)
            {
                //处于最大化状态,变为等分状态
                SetPlayWindowsAverage();
            }
            else
            {
                tablayMain.RowStyles.Clear();
                tablayMain.ColumnStyles.Clear();
                //处于等分状态,变为最大化
                for (int row = 0; row < tablayMain.RowCount; row++)
                {
                    if (row == Temp_intRow)
                    {
                        tablayMain.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
                    }
                    else
                    {
                        tablayMain.RowStyles.Add(new RowStyle(SizeType.Absolute, 0));
                    }
                }
                for (int col = 0; col < tablayMain.ColumnCount; col++)
                {
                    if (col == Temp_intColumns)
                    {
                        tablayMain.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
                    }
                    else
                    {
                        tablayMain.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 0));
                    }
                }
                PlayWindowsStatus = 1;
                tablayMain.ResumeLayout();
            }
            return(bolResult);
        }
 /// <summary>
 /// 关闭视频
 /// </summary>
 /// <param name="v"></param>
 public void VideoClose(VideoPlayWindow v)
 {
     v.VideoClose();
     SetToolTipInfo(v, "");
 }
 public void SetPlayInfo(VideoPlayWindow vWindow, VideoInfo vInfo, CameraInfo cInfo, VideoPlaySetting videoPlaySet)
 {
     vWindow.Init_VideoInfo(vInfo, cInfo, videoPlaySet);
     SetToolTipInfo(vWindow);
     vWindow.VideoPlay();
 }
        /// <summary>
        /// 设置Windows界面数量
        /// </summary>
        /// <param name="intNum"></param>
        public bool SetWindowNum(int intNum)
        {
            if (intNum == 0)
            {
                intNum = 1;
            }
            if (this.WindowNum == intNum)
            {
                this.VideoColse_All();
                //处于最大化状态
                if (PlayWindowsMax && this.WindowNum > 1)
                {
                    //重置界面
                    //Row Col重置
                    SetPlayWindowsAverage();
                }
                return(true);
            }
            Console.WriteLine("SetWindowNum" + intNum);
            switch (intNum)
            {
            case 1:
            case 4:
            case 9:
            case 16:
                double Temp_dblNum = intNum;
                int    Temp_intRow = Convert.ToInt32(Math.Sqrt(Temp_dblNum));
                tablayMain.RowCount    = Temp_intRow;
                tablayMain.ColumnCount = Temp_intRow;
                //清除旧控件信息
                VideoColse_All();
                foreach (VideoPlayWindow v in dicWin.Values)
                {
                    v.VideoClose();
                }
                dicWin.Clear();
                tablayMain.RowStyles.Clear();
                tablayMain.ColumnStyles.Clear();
                tablayMain.Controls.Clear();
                for (int row = 0; row < Temp_intRow; row++)
                {
                    tablayMain.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
                    tablayMain.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
                }
                int i = 0;
                for (int row = 0; row < Temp_intRow; row++)
                {
                    for (int col = 0; col < Temp_intRow; col++)
                    {
                        VideoPlayWindow videoPlayWindow = new VideoPlayWindow();
                        videoPlayWindow.Name                    = "Video_" + i;
                        videoPlayWindow.Size                    = new Size(100, 100);
                        videoPlayWindow.Dock                    = DockStyle.Fill;
                        videoPlayWindow.BackColor               = Color.Black;
                        videoPlayWindow.Margin                  = new Padding(0);
                        videoPlayWindow.Padding                 = new Padding(1);
                        videoPlayWindow.BackColor               = clrDefaulWindowColor;
                        videoPlayWindow.CurrentVideoPlaySet     = CurrentVideoPlaySet;  //赋值播放设置
                        videoPlayWindow.VideoPlayCallbackEvent += videoPlayCallbaclEvent;
                        tablayMain.Controls.Add(videoPlayWindow);
                        tablayMain.SetRow(videoPlayWindow, row);
                        tablayMain.SetColumn(videoPlayWindow, col);
                        videoPlayWindow.PicMain.MouseDown        += PicMain_MouseDown;
                        videoPlayWindow.PicMain.MouseDoubleClick += PicMain_MouseDoubleClick;
                        dicWin[i] = videoPlayWindow;

                        i++;
                    }
                }
                CurrentV = dicWin[0];
                break;

            default:
                return(false);
            }
            return(true);
        }