private void OnPlayPosChanged(VideoStatusInfo info) { bool isFind = false; XtraSinglePlayer player = null; if (m_player.HWnd == info.HWnd) { player = m_player; isFind = true; } if (!isFind) { return; } UpdateButtonStatus(info.HWnd); TimeInfo = string.Format("{0}/{1}", new DateTime().AddSeconds(info.CurrPlayTime).ToString("HH:mm:ss"), new DateTime().AddSeconds(info.TotlePlayTime).ToString("HH:mm:ss")); RaisePropertyChangedEvent("TimeInfo"); if (info.PlayState == VideoStatusType.E_STOP) { //player.PlayVideoName = ""; player.EnabledEx = false; player.SetStatusText(""); } else { if (PlayPosChange != null) { PlayPosChange(player, info.CurrPlayTime, info.TotlePlayTime); } } }
public void SetPlayer(int index, XtraSinglePlayer player) { if (index >= 1 && index <= MAX_WINDOW_COUNT) { m_playerList[index] = player; } }
private void OnPlayReady(VideoStatusInfo info) { bool isFind = false; XtraSinglePlayer player = null; foreach (KeyValuePair <int, XtraSinglePlayer> pair in m_playerList) { if (pair.Value.HWnd == info.HWnd) { player = pair.Value; isFind = true; break; } } if (!isFind) { return; } player.EnabledEx = true; player.SetStatusText(""); UpdateButtonStatus(info.HWnd); }
private void OnPlayReady(VideoStatusInfo info) { bool isFind = false; XtraSinglePlayer player = null; if (m_player.HWnd == info.HWnd) { player = m_player; isFind = true; } if (!isFind) { return; } player.EnabledEx = true; player.SetStatusText(""); try { player.PlayVideoName = Framework.Container.Instance.TaskManagerService.GetTaskUnitById(info.VideoTaskUnitID).TaskUnitName; UpdateButtonStatus(info.HWnd); //Framework.Container.Instance.GraphicDrawService.SetPlayDrawType(m_drawMode); } catch (SDKCallException ex) { Common.SDKCallExceptionHandler.Handle(ex, "根据编号获取任务单元"); } }
private void singlePlayer_DragDrop(object sender, DragEventArgs e) { XtraSinglePlayer p = sender as XtraSinglePlayer; Type dataType = typeof(List <object>); if (e.Data.GetDataPresent(dataType)) { List <object> selectedNodes = (List <object>)e.Data.GetData(dataType); if (panelBriefSetting.Visible) { panelBriefSetting.Visible = btnSetBrief.Checked = false; xtraSinglePlayer1.EditModel = false; m_viewModel.CancelBriefEdit(); } m_viewModel.PlayBriefVideo(selectedNodes); } else if (e.Data.GetDataPresent("BOCOM.ICAS.Protocol.TSEARCH_RESULT")) { } else if (e.Data.GetDataPresent("BOCOM.ICAS.Protocol.TVEHICLE_INFO")) { } }
public BriefVideoTreeViewModel(XtraSinglePlayer player) : base(TreeShowType.Video) { Framework.Container.Instance.EvtAggregator.GetEvent <BriefObjectPlayBackEvent>().Subscribe(OnBriefObjectPlayBack, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlayPosChangedEvent>().Subscribe(OnPlayPosChanged, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlayFailedEvent>().Subscribe(OnPlayFailed, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlayReadyEvent>().Subscribe(OnPlayReady, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <OpenBriefPlaybackVideoEvent>().Subscribe(OnOpenBriefPlaybackVideo, ThreadOption.WinFormUIThread); Framework.Container.Instance.RegisterEventSubscriber(this); PlayBtnImage = playvideoresource.播放5; PlayBtnCheckedImage = playvideoresource.播放3; PlayBtnMouseOverImage = playvideoresource.播放2; PlayBtnDisableImage = playvideoresource.播放5; PlayBtnOrigianlImage = playvideoresource.播放1; PlayBtnEnable = false; StopBtnEnable = false; GrabBtnEnable = false; GotoBtnEnable = false; EditVideoBtnEnable = false; //GotoBtnEnable = false; //ReplayBtnEnable = false; //PrivFrameBtnEnable = false ; //NextFrameBtnEnable = false ; //SlowBtnEnable = false ; //FastBtnEnable = false ; m_player = player; Filter = TreeShowObjectFilter.Brief; }
public VideoPlayBackSingleViewModel(XtraSinglePlayer player) { Framework.Container.Instance.EvtAggregator.GetEvent <CompareDrawModeChangeEvent>().Subscribe(OnDrawModeChange); Framework.Container.Instance.EvtAggregator.GetEvent <PlayPosChangedEvent>().Subscribe(OnPlayPosChanged, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlayReadyEvent>().Subscribe(OnPlayReady, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlayFailedEvent>().Subscribe(OnPlayFailed, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread); //Framework.Container.Instance.EvtAggregator.GetEvent<CameraSelectionChangedEvent>().Subscribe(OnCameraSelectionChanged); Framework.Container.Instance.EvtAggregator.GetEvent <SearchResoultPlaybackRequestEvent>().Subscribe(OnSearchResoultPlayBack); Framework.Container.Instance.EvtAggregator.GetEvent <TaskUnitDeletedEvent>().Subscribe(OnTaskUnitDeleted, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread); Framework.Container.Instance.RegisterEventSubscriber(this); m_player = player; PlayBtnImage = playvideoresource.播放5; PlayBtnCheckedImage = playvideoresource.播放3; PlayBtnMouseOverImage = playvideoresource.播放2; PlayBtnDisableImage = playvideoresource.播放5; PlayBtnOrigianlImage = playvideoresource.播放1; PlayBtnEnable = false; StopBtnEnable = false; PrivFrameBtnEnable = false; NextFrameBtnEnable = false; SlowBtnEnable = false; FastBtnEnable = false; GrabBtnEnable = false; ConcentratedBtnEnable = false; DownLoadConcentratedBtnEnable = false; EditVideoBtnEnable = false; MarkBtnEnable = false; GotoBtnEnable = false; }
private XtraSinglePlayer GetPlayerByPlayHandle(IntPtr handle) { XtraSinglePlayer player = null; foreach (KeyValuePair <int, XtraSinglePlayer> pair in m_playerList) { if (pair.Value.HWnd == handle) { player = pair.Value; break; } } return(player); }
public void CloseVideo(XtraSinglePlayer player) { try { Framework.Container.Instance.VideoPlayService.StopVideo(player.HWnd); player.PlayVideoName = ""; player.EnabledEx = false; player.SetStatusText(""); TimeInfo = "00:00:00/00:00:00"; UpdateButtonStatus(player.HWnd); } catch (SDKCallException ex) { Common.SDKCallExceptionHandler.Handle(ex, "关闭视频"); } }
private void OnPlayFailed(VideoStatusInfo info) { bool isFind = false; XtraSinglePlayer player = null; if (m_player.HWnd == info.HWnd) { player = m_player; isFind = true; } if (!isFind) { return; } CloseVideo(); }
private void OnPlayPosChanged(VideoStatusInfo info) { XtraSinglePlayer player = GetPlayerByPlayHandle(info.HWnd); if (player == null) { return; } if (CurrPlayer == player) { try { VideoStatusInfo e = Framework.Container.Instance.VideoPlayService.GetPlayStatus(info.HWnd); if (e.PlayStatePriv != e.PlayState) { SetPlayVideoBtnStatus(e); } TimeInfo = string.Format("{0}/{1}", new DateTime().AddSeconds(e.CurrPlayTime).ToString("HH:mm:ss"), new DateTime().AddSeconds(e.TotlePlayTime).ToString("HH:mm:ss")); RaisePropertyChangedEvent("TimeInfo"); } catch (SDKCallException ex) { Common.SDKCallExceptionHandler.Handle(ex, "获取播放状态"); } } if (info.PlayState == VideoStatusType.E_STOP) { //player.PlayVideoName = ""; player.EnabledEx = false; player.SetStatusText(""); } else { if (PlayPosChange != null) { PlayPosChange(player, info.PlayPercent); } } }
public PlayBriefVideoViewModel(XtraSinglePlayer player) { Framework.Container.Instance.EvtAggregator.GetEvent <PlayPosChangedEvent>().Subscribe(OnPlayPosChanged, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlayReadyEvent>().Subscribe(OnPlayReady, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlayFailedEvent>().Subscribe(OnPlayFailed, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlaySynthFailedEvent>().Subscribe(OnPlaySynthFailed, ThreadOption.WinFormUIThread); //Framework.Container.Instance.EvtAggregator.GetEvent<CameraSelectionChangedEvent>().Subscribe(OnCameraSelectionChanged, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <BriefMouseClickChangedEvent>().Subscribe(OnBriefMouseClickChanged, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <OCXPlayBriefVideoEvent>().Subscribe(OnOCXPlayBriefVideo, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <OCXStopPlayBriefVideoEvent>().Subscribe(OnOCXStopPlayBriefVideo, ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <TaskUnitDeletedEvent>().Subscribe(OnTaskUnitDeleted, ThreadOption.WinFormUIThread); Framework.Container.Instance.RegisterEventSubscriber(this); PlayBtnImage = playvideoresource.播放5; PlayBtnCheckedImage = playvideoresource.播放3; PlayBtnMouseOverImage = playvideoresource.播放2; PlayBtnDisableImage = playvideoresource.播放5; PlayBtnOrigianlImage = playvideoresource.播放1; PlayBtnEnable = false; StopBtnEnable = false; PrivFrameBtnEnable = false; NextFrameBtnEnable = false; SlowBtnEnable = false; FastBtnEnable = false; GrabBtnEnable = false; ConcentratedBtnEnable = false; DownLoadConcentratedBtnEnable = false; EditVideoBtnEnable = false; SaveObjectPicBtnEnable = false; SetBriefBtnEnable = false; PlayBackBtnEnable = false; ExportVideoBtnEnable = false; MarkBtnEnable = false; HidePlayBackWnd = true; m_briefDensityFilter = E_VDA_BRIEF_DENSITY.E_BRIEF_DENSITY_04; BriefMoveObjTypeFilter = E_VDA_MOVEOBJ_TYPE.E_VDA_MOVEOBJ_TYPE_ALL; BriefdwMoveObjColorFilter = 0x00ffffff; m_player = player; }
public void SetSelectedPlayer(XtraSinglePlayer player) { foreach (KeyValuePair <int, XtraSinglePlayer> pair in m_playerList) { if (pair.Value == player) { pair.Value.Selected = true; VideoStatusInfo e = Framework.Container.Instance.VideoPlayService.GetPlayStatus(pair.Value.HWnd); TimeInfo = string.Format("{0}/{1}", new DateTime().AddSeconds(e.CurrPlayTime).ToString("HH:mm:ss"), new DateTime().AddSeconds(e.TotlePlayTime).ToString("HH:mm:ss")); RaisePropertyChangedEvent("TimeInfo"); SetPlayVideoBtnStatus(e); } else { pair.Value.Selected = false; } } }
private void OnPlayReady(VideoStatusInfo info) { bool isFind = false; XtraSinglePlayer player = null; if (m_player.HWnd == info.HWnd) { player = m_player; isFind = true; } if (!isFind) { return; } player.EnabledEx = true; player.SetStatusText(""); this.UpdateButtonStatus(info.HWnd); }
private void OnPlayPosChanged(VideoStatusInfo info) { bool isFind = false; XtraSinglePlayer player = null; if (m_player.HWnd == info.HWnd) { player = m_player; isFind = true; } if (!isFind) { return; } this.UpdateButtonStatus(info.HWnd); if (info.PlayState == VideoStatusType.E_STOP) { //player.PlayVideoName = ""; player.EnabledEx = false; player.SetStatusText(""); } else { if (PlayPosChange != null) { if (info.StartPlayTime == 0 && info.EndPlayTime == 0) { PlayPosChange(player, info.PlayPercent, 1000); } else { PlayPosChange(player, info.CurrPlayTime - info.StartPlayTime, info.EndPlayTime - info.StartPlayTime);// info.PlayPercent); } } } }
public VideoEditViewModel(XtraSinglePlayer player, ucTimeTrack track) { Framework.Container.Instance.EvtAggregator.GetEvent <PlayPosChangedEvent>().Subscribe(OnPlayPosChanged, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlayReadyEvent>().Subscribe(OnPlayReady, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread); Framework.Container.Instance.EvtAggregator.GetEvent <PlayFailedEvent>().Subscribe(OnPlayFailed, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread); Framework.Container.Instance.RegisterEventSubscriber(this); m_player = player; m_track = track; PlayBtnImage = playvideoresource.播放5; PlayBtnCheckedImage = playvideoresource.播放3; PlayBtnMouseOverImage = playvideoresource.播放2; PlayBtnDisableImage = playvideoresource.播放5; PlayBtnOrigianlImage = playvideoresource.播放1; PlayBtnEnable = false; StopBtnEnable = false; PrivFrameBtnEnable = false; NextFrameBtnEnable = false; SlowBtnEnable = false; FastBtnEnable = false; GrabBtnEnable = false; EditVideoBtnEnable = false; }
private void OnPlayFailed(VideoStatusInfo info) { bool isFind = false; XtraSinglePlayer player = null; foreach (KeyValuePair <int, XtraSinglePlayer> pair in m_playerList) { if (pair.Value.HWnd == info.HWnd) { player = pair.Value; isFind = true; break; } } if (!isFind) { return; } CloseVideo(player); }
private void OnPlayReady(VideoStatusInfo info) { bool isFind = false; XtraSinglePlayer player = null; if (m_player.HWnd == info.HWnd) { player = m_player; isFind = true; } if (!isFind) { return; } player.EnabledEx = true; player.SetStatusText(""); try { VideoStatusInfo e = Framework.Container.Instance.BriefVideoPlayService.GetPlayStatus(info.HWnd); SetPlayVideoBtnStatus(e); //string newtime = string.Format("浓缩时长:{0}分{1}秒", e.TotlePlayTime / 60, e.TotlePlayTime % 60); //if (newtime != TimeInfo) //{ // TimeInfo = newtime; // RaisePropertyChangedEvent("TimeInfo"); //} } catch (SDKCallException ex) { Common.SDKCallExceptionHandler.Handle(ex, "获取播放状态"); } }
void singlePlayer_ProgressChanged(XtraSinglePlayer sender, uint curr, uint max) { m_viewModel.PosBriefVideo(curr); }
void xtraSinglePlayer1_CloseClicked(XtraSinglePlayer obj) { m_viewModel.CloseBriefVideo(); }
void m_viewModel_PlayPosChange(XtraSinglePlayer player, uint playpercent) { //VideoStatusInfo info = (VideoStatusInfo)sender; player.SetProgress((int)playpercent, 1000); }