Exemple #1
0
        public Presenter(PresenterSettings presenterSettings)
        {
            try
            {
                _presenterSettings = presenterSettings;
                _videoCapture = _presenterSettings.VideoCaptureControl;
                _audioStreamManager = new AudioStreamManager(_presenterSettings.AudioTimerInterval, 
                    _presenterSettings.OnAudioCaptureAvailable);

                // initialize the image capture size
                if (_videoCapture != null)
                {
                    _videoCapture.ImageHeight = presenterSettings.VideoScreenSize.Height;
                    _videoCapture.ImageWidth = presenterSettings.VideoScreenSize.Width;

                    _firstTimeCapturing = true;

                    // bind the image captured event
                    _videoCapture.ImageCaptured += new Delegates.WebCamEventHandler(presenterSettings.OnVideoImageCaptured);
                }

                _screenCaptureTool = new ScreenCaptureTool(_presenterSettings.RemotingTimerInterval, 
                    _presenterSettings.OnRemotingImageCaptured);
            }
            catch (Exception ex)
            {
                Tools.Instance.Logger.LogError(ex.ToString());
            }
        }
 public FormMyWebcam(int timerInterval, EventHandler statusToggle)
 {
     try
     {
         _statusToggle = statusToggle;
         _timerInterval = timerInterval;
         InitializeComponent();
         _webcamCapture = new WebcamCapture(_timerInterval, this.Handle);
         _webcamCapture.ParentForm = this;
         _captures = new Dictionary<DateTime, byte[]>();
         Program.Controller.StartVideo(_webcamCapture);
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }
Exemple #3
0
 public void StartVideoPresentation()
 {
     try
     {
         if (_videoCapture == null)
         {
             _videoCapture = _presenterSettings.VideoCaptureControl;
             _videoCapture.ImageHeight = _presenterSettings.VideoScreenSize.Height;
             _videoCapture.ImageWidth = _presenterSettings.VideoScreenSize.Width;
             // bind the image captured event
             _videoCapture.ImageCaptured += new Delegates.WebCamEventHandler(_presenterSettings.OnVideoImageCaptured);
         }
         // start the video capturing
         _videoCapture.StartCapturing(_firstTimeCapturing);
         _firstTimeCapturing = false;
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }
 // todo: optional - convert this to an event handler , use it in the Webcam Form as observer
 /// <summary>
 /// method used to trigger video capture control start
 /// </summary>
 /// <param name="webcamControl"></param>
 public void StartVideo(IWebcamCapture webcamControl)
 {
     try
     {
         // create Presenter and start the presentation
         // initialize the presenter that will send webcam captures to all Server Sessions
         SystemConfiguration.Instance.PresenterSettings.VideoCaptureControl = webcamControl;
         PresenterManager.Instance(SystemConfiguration.Instance.PresenterSettings).StartVideoPresentation();
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }
 public void StartCapturing()
 {
     try
     {
         if (_webcamCapture == null)
         {
             _webcamCapture = new WebcamCapture(_timerInterval, this.Handle);
         }
         Program.Controller.StartVideo(_webcamCapture);
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }