Beispiel #1
0
 public Viewer(ICasterSocket casterSocket,
               IScreenCapturer screenCapturer,
               IClipboardService clipboardService,
               IWebRtcSessionFactory webRtcSessionFactory,
               IAudioCapturer audioCapturer)
 {
     Capturer             = screenCapturer;
     CasterSocket         = casterSocket;
     WebRtcSessionFactory = webRtcSessionFactory;
     ClipboardService     = clipboardService;
     ClipboardService.ClipboardTextChanged += ClipboardService_ClipboardTextChanged;
     AudioCapturer = audioCapturer;
     AudioCapturer.AudioSampleReady += AudioCapturer_AudioSampleReady;
 }
Beispiel #2
0
 public Viewer(CasterSocket casterSocket,
               IScreenCapturer screenCapturer,
               IClipboardService clipboardService,
               IWebRtcSessionFactory webRtcSessionFactory,
               IAudioCapturer audioCapturer)
 {
     Capturer             = screenCapturer;
     CasterSocket         = casterSocket;
     WebRtcSessionFactory = webRtcSessionFactory;
     EncoderParams        = new EncoderParameters();
     ImageQuality         = defaultImageQuality;
     ClipboardService     = clipboardService;
     ClipboardService.ClipboardTextChanged += ClipboardService_ClipboardTextChanged;
     AudioCapturer = audioCapturer;
     AudioCapturer.AudioSampleReady += AudioCapturer_AudioSampleReady;
 }
        public PlaybackStreamViewModel(IScreenCapturer screenCapturer,
                                       IWindowManager windowManager,
                                       IActiveProfileProvider activeProfileProvider)
        {
            _screenCapturer = screenCapturer;
            _windowManager = windowManager;
            _activeProfileProvider = activeProfileProvider;

            _activeProfileProvider.ActiveProfileChanged += ChangeProfile;

            _screenCapturer.CaptureRegionResolver = () => _activeProfile != null
                                                              ? _activeProfile.CaptureRegion
                                                              : new ScreenRegion();
            _screenCapturer.CapturesPerSecondResolver = () => _activeProfile != null
                                                                  ? _activeProfile.CPS
                                                                  : 25;
            _screenCapturer.ScreenCaptured += (sender, args) => { CapturedImage = args.CapturedImage; };

            CanShow = true;
        }
        public Tuple <double, double> GetAbsolutePointFromRelativePercent(double percentX, double percentY, IScreenCapturer capturer)
        {
            var absoluteX = (capturer.CurrentScreenBounds.Width * percentX) + capturer.CurrentScreenBounds.Left;
            var absoluteY = (capturer.CurrentScreenBounds.Height * percentY) + capturer.CurrentScreenBounds.Top;

            return(new Tuple <double, double>(absoluteX, absoluteY));
        }
Beispiel #5
0
 public CurrentActivityProvider(IKeyLogger keyLogger, IScreenCapturer screenCapture)
 {
     _keyLogger     = keyLogger;
     _screenCapture = screenCapture;
 }
Beispiel #6
0
 public Hands(IInputGenerator inputGenerator, IScreenCapturer screenCapturer)
 {
     this.inputGenerator = inputGenerator;
     this.screenCapturer = screenCapturer;
 }
Beispiel #7
0
 public Eyes(IScreenCapturer screenCapturer, IBrain brain, IBoardLogger boardLogger)
 {
     this.screenCapturer = screenCapturer;
     this.brain          = brain;
     this.boardLogger    = boardLogger;
 }
Beispiel #8
0
 public Hands(IInputGenerator inputGenerator, IScreenCapturer screenCapturer)
 {
     this.inputGenerator = inputGenerator;
     this.screenCapturer = screenCapturer;
 }
Beispiel #9
0
 public Eyes(IScreenCapturer screenCapturer, IBrain brain, IBoardLogger boardLogger)
 {
     this.screenCapturer = screenCapturer;
     this.brain = brain;
     this.boardLogger = boardLogger;
 }
Beispiel #10
0
        public Tuple <double, double> GetAbsolutePercentFromRelativePercent(double percentX, double percentY, IScreenCapturer capturer)
        {
            var screenBounds = capturer.CurrentScreenBounds;

            var absoluteX = (screenBounds.Width * percentX) + screenBounds.Left - capturer.GetVirtualScreenBounds().Left;
            var absoluteY = (screenBounds.Height * percentY) + screenBounds.Top - capturer.GetVirtualScreenBounds().Top;

            return(new Tuple <double, double>(absoluteX / capturer.GetVirtualScreenBounds().Width, absoluteY / capturer.GetVirtualScreenBounds().Height));
        }