Пример #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;
 }
Пример #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;
 }
Пример #3
0
        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;
        }
Пример #4
0
        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));
        }
Пример #5
0
 public CurrentActivityProvider(IKeyLogger keyLogger, IScreenCapturer screenCapture)
 {
     _keyLogger     = keyLogger;
     _screenCapture = screenCapture;
 }
Пример #6
0
 public Hands(IInputGenerator inputGenerator, IScreenCapturer screenCapturer)
 {
     this.inputGenerator = inputGenerator;
     this.screenCapturer = screenCapturer;
 }
Пример #7
0
 public Eyes(IScreenCapturer screenCapturer, IBrain brain, IBoardLogger boardLogger)
 {
     this.screenCapturer = screenCapturer;
     this.brain          = brain;
     this.boardLogger    = boardLogger;
 }
Пример #8
0
 public Hands(IInputGenerator inputGenerator, IScreenCapturer screenCapturer)
 {
     this.inputGenerator = inputGenerator;
     this.screenCapturer = screenCapturer;
 }
Пример #9
0
 public Eyes(IScreenCapturer screenCapturer, IBrain brain, IBoardLogger boardLogger)
 {
     this.screenCapturer = screenCapturer;
     this.brain = brain;
     this.boardLogger = boardLogger;
 }
Пример #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));
        }