public bool Close() { if (mPlayClient != null) { if (CLocalSystem.ActiveSystem.SystemContext.VideoSourceManager.Close(mPlayClient.Name)) { mPlayClient.OnPlayStatusChanged -= new PLAYSTATUS_CHANGED(DoPlayStatusChanged); mPlayClient.OnRecordFileDownProgress -= new RECORDFILE_DOWNPROGRESS(DoRecordFileDownProgress); mPlayClient = null; mConfigChanged = true; return(true); } } return(false); }
public bool Open() { if (mConfigChanged || mPlayClient == null) { lock (this) { Close(); mConfig.IP = mIP; mConfig.Channel = mChannel; mConfig.UserName = mUserName; mConfig.Password = mPassword; mConfig.StartTime = mStartTime; mConfig.StopTime = mStopTime; IVideoSource vs = CLocalSystem.ActiveSystem.SystemContext.VideoSourceManager.Open(mConfig, pictureBox_play.Handle); mPlayClient = vs as CHKDVRBackPlayer; if (mPlayClient != null) { mPlayClient.OnPlayStatusChanged += new PLAYSTATUS_CHANGED(DoPlayStatusChanged); mPlayClient.OnRecordFileDownProgress += new RECORDFILE_DOWNPROGRESS(DoRecordFileDownProgress); mPlayClient.ImageDrawer.IsDrawImage = mIsDrawImage; mPlayClient.ImageDrawer.Transparence = mTransparence; mPlayClient.ImageDrawer.DrawImage = mDrawImage; mPlayClient.IsMute = IsMute; mPlayClient.Volume = Volume; mConfigChanged = false; return(true); } } return(false); } else { return(true); } }