Exemple #1
0
        private void OnFullCaptureWindowFocused(CaptureFullWindowAction action, WindowInfo newFocusedWindowInfo)
        {
            _logger.Write(LogLevel.Debug, $"Full Capture Window focused, waiting {action.NeededWindowFocusTime} seconds...");

            _currentActiveFullCaptureAction = action;
            _currentFullCaptureWindowInfo   = newFocusedWindowInfo;

            //Check if focus is still focused in configured time
            _focusedCheckTimer = new Timer(OnFullCaptureWindowReallyFocused, null, action.NeededWindowFocusTime * 1000, Timeout.Infinite);
        }
Exemple #2
0
        private void OnFullCapturedWindowFocusLost()
        {
            _logger.Write(LogLevel.Info, $"Full Capture Window focus lost, disabling '{_currentActiveFullCaptureAction.DisplayCaptureSourceName}'");

            //If capture window focus lost, kill timer
            _focusedCheckTimer.Dispose();
            _focusedCheckTimer = null;

            //Reset visibility of full capture source
            if (_fullCaptureWindowSourceVisible)
            {
                ToggleObsSourceRender(_currentActiveFullCaptureAction.DisplayCaptureSourceName, false);
            }

            _currentActiveFullCaptureAction = null;
            _currentFullCaptureWindowInfo   = null;
        }