public VideoPreviewUserControl() { InitializeComponent(); _playbackUserControl = ClientControl.Instance.GeneratePlaybackUserControl(); _playbackUserControl.Dock = DockStyle.Top; _playbackUserControl.TimeSpan = TimeSpan.FromHours(1); _playbackUserControl.ShowTallUserControl = true; panelPlayback.Controls.Add(_playbackUserControl); FQID playbackControllerFQID = ClientControl.Instance.GeneratePlaybackController(); _playbackUserControl.Init(playbackControllerFQID); _bitmapSource = new BitmapSource(); _bitmapSource.PlaybackFQID = playbackControllerFQID; _bitmapSource.NewBitmapEvent += _bitmapSource_NewBitmapEvent; _bitmapSource.Selected = true; EnvironmentManager.Instance.SendMessage( new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackSkipModeCommand, PlaybackSkipModeData.Skip), playbackControllerFQID); _playbackUserControl.Enabled = false; }
private void MainForm_Load(object sender, EventArgs e) { _playbackUserControl = ClientControl.Instance.GeneratePlaybackUserControl(); _playbackUserControl.Visible = true; _playbackUserControl.Dock = DockStyle.Fill; _panelPlayback.Controls.Add(_playbackUserControl); _playbackUserControl.BringToFront(); _playbackUserControl.Init(null); }
internal void Close() { if (_bitmapSource != null) { CloseBitmap(); _bitmapSource.NewBitmapEvent -= _bitmapSource_NewBitmapEvent; _bitmapSource = null; } if (_playbackUserControl != null) { _playbackUserControl.Close(); _playbackUserControl = null; } }
private void OnClose(object sender, EventArgs e) { VideoOS.Platform.SDK.Environment.Logout(); if (_bitmapSource != null) { CloseBitmap(); _bitmapSource.NewBitmapEvent -= _bitmapSource_NewBitmapEvent; _bitmapSource = null; } if (_playbackUserControl != null) { _playbackUserControl.Close(); _playbackUserControl = null; } this.Close(); }
private void OnClose(object sender, EventArgs e) { if (_playbackUserControl != null) { _playbackUserControl.Close(); _playbackUserControl = null; } if (_imageViewerControl != null) { _imageViewerControl.Disconnect(); _imageViewerControl.Close(); _panelImageViewer.Controls.Remove(_imageViewerControl); _imageViewerControl.Dispose(); _imageViewerControl = null; } VideoOS.Platform.SDK.Environment.RemoveAllServers(); Close(); }
private void PrepareControls(Panel videoPanel) { _currentVideoPanel = videoPanel; _videoPictureBox = new PictureBox(); videoPanel.Controls.Clear(); videoPanel.Controls.Add(_videoPictureBox); _videoPictureBox.Dock = DockStyle.Fill; _playbackFQID = null;//Null в данном случае - использование стандартного способа управления контролом _playbackUserControl = ClientControl.Instance.GeneratePlaybackUserControl(); _playbackUserControl.Visible = true; _playbackUserControl.Dock = DockStyle.Fill; _playbackController = ClientControl.Instance.GetPlaybackController(_playbackFQID); _bitmapSource = new BitmapSource(); _bitmapSource.PlaybackFQID = _playbackFQID; _bitmapSource.NewBitmapEvent += _bitmapSource_NewBitmapEvent; _bitmapSource.Selected = true; }
public override void Init() { base.Init(); this.imageViewerControl = ClientControl.Instance.GenerateImageViewerControl(WindowInformation); this.panel2.Controls.Add(imageViewerControl); this.imageViewerControl.Dock = DockStyle.Fill; _playbackUserControl = ClientControl.Instance.GeneratePlaybackUserControl(this.WindowInformation); _playbackUserControl.Dock = DockStyle.Fill; panel1.Controls.Add(_playbackUserControl); _playbackFQID = ClientControl.Instance.GeneratePlaybackController(); //this.imageViewerControl.ClickEvent += new System.EventHandler(this.OnImageClick); //Note the usercontrol MouseClick does not work for ImageViewerControl - use above //this.imageViewerControl.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ViewItemUserControl_MouseClick); //this.imageViewerControl.DoubleClickEvent += imageViewerControl_DoubleClickEvent; _audioPlayerControl = ClientControl.Instance.GenerateAudioPlayerControl(WindowInformation); panel2.Controls.Add(_audioPlayerControl); _audioPlayerControlSpeaker = ClientControl.Instance.GenerateAudioPlayerControl(WindowInformation); panel2.Controls.Add(_audioPlayerControlSpeaker); _playbackUserControl.Init(_playbackFQID); imageViewerControl.PlaybackControllerFQID = _playbackFQID; _audioPlayerControl.PlaybackControllerFQID = _playbackFQID; _audioPlayerControlSpeaker.PlaybackControllerFQID = _playbackFQID; /* * string fqidString = _viewItemManager.GetProperty(ClientControl.EmbeddedCameraFQIDProperty); * if (fqidString != null) * { * _selectedCameraItem = Configuration.Instance.GetItem(new FQID(fqidString)); * FillCameraSelection(); * * FillMicrophoneSelection(); * }*/ }
/// <summary> /// Method that is called immediately after the view item is displayed. /// </summary> public override void Init() { _playbackUserControl = ClientControl.Instance.GeneratePlaybackUserControl(this.WindowInformation); _playbackUserControl.Dock = DockStyle.Fill; panelPlaybackControl.Controls.Add(_playbackUserControl); _playbackUserControl.ShowTallUserControl = true; _playbackUserControl.ShowSpeedControl = true; _playbackUserControl.ShowTimeSpanControl = true; _imageViewerControl = ClientControl.Instance.GenerateImageViewerControl(this.WindowInformation); _imageViewerControl.Dock = DockStyle.Fill; _imageViewerControl.ClickEvent += new EventHandler(_imageViewerControl_ClickEvent); _imageViewerControl.MouseWheel += new MouseEventHandler(_imageViewerControl_MouseWheel); _imageViewerControl.Selected = true; panelVideo.Controls.Add(_imageViewerControl); _playbackFQID = ClientControl.Instance.GeneratePlaybackController(); _playbackUserControl.Init(_playbackFQID); _imageViewerControl.PlaybackControllerFQID = _playbackFQID; ClientControl.Instance.RegisterUIControlForAutoTheming(this); EnvironmentManager.Instance.RegisterReceiver((p1, p2, p3) => { System.Diagnostics.Trace.WriteLine("PlaybackCommand:" + ((PlaybackCommandData)p1.Data).Command + ", Main=" + (p3 == null)); return(null); }, new MessageIdFilter(MessageId.SmartClient.PlaybackIndication)); SetUpApplicationEventListeners(); _imageViewerControl.Initialize(); // Make sure Click events have been configured if (_viewItemManager.SelectedCamera != null) { ViewItemManagerPropertyChangedEvent(this, null); } }
private void OnLoad(object sender, EventArgs e) { // In this sample we create a specific PlaybackController. // All commands to this controller needs to be sent via messages with the destination as _playbackFQID. // All message Indications coming from this controller will have sender as _playbackController. _playbackFQID = null; // use default playbackController instead of: ClientControl.Instance.GeneratePlaybackController(); _playbackUserControl = ClientControl.Instance.GeneratePlaybackUserControl(); _playbackUserControl.Visible = true; _playbackUserControl.Dock = DockStyle.Fill; panelPlayback.Controls.Add(_playbackUserControl); _playbackUserControl.BringToFront(); _playbackUserControl.Init(_playbackFQID); _playbackController = ClientControl.Instance.GetPlaybackController(_playbackFQID); _bitmapSource = new BitmapSource(); _bitmapSource.PlaybackFQID = _playbackFQID; _bitmapSource.NewBitmapEvent += _bitmapSource_NewBitmapEvent; _bitmapSource.Selected = true; EnvironmentManager.Instance.TraceFunctionCalls = true; }