Esempio n. 1
0
        private SceneItem GetCurrentSceneFullDisplayCaptureSource(string captureSourceName)
        {
            SceneItem obsDisplayCaptureSource = _obs.GetCurrentScene().Items.FirstOrDefault(i => i.SourceName == captureSourceName);

            if (obsDisplayCaptureSource?.InternalType == null || obsDisplayCaptureSource.InternalType != "monitor_capture")
            {
                return(null);
            }

            return(obsDisplayCaptureSource);
        }
        private void OnActionWindowFocused(FocusedWindowSourceVisibilityAction action, WindowInfo newFocusedWindow)
        {
            string currentSceneName = _obs.GetCurrentScene().Name;

            if (action.EnabledForScenes.Count != 0 && !action.EnabledForScenes.Any(s => s == currentSceneName))
            {
                return;
            }
            if (action.DisabledForScenes.Count != 0 && action.DisabledForScenes.Any(s => s == currentSceneName))
            {
                return;
            }
            _logger.Write(LogLevel.Info, $"Source Visibility Window focused, switching '{action.SourceName}' visibility to visible");

            _currentFocusAction       = action;
            _currentFocusedWindowInfo = newFocusedWindow;
            _actionSourceInScene      = currentSceneName;

            if (!_actionSourceVisible)
            {
                _obs.SetSourceRender(action.SourceName, true);
                _actionSourceVisible = true;
            }
        }
Esempio n. 3
0
        private void OnActionWindowFocused(FocusedWindowSceneSwitchAction action, WindowInfo newFocusedWindow)
        {
            string currentSceneName = _obs.GetCurrentScene().Name;

            if (action.EnabledForScenes.Count != 0 && !action.EnabledForScenes.Any(s => s == currentSceneName))
            {
                return;
            }
            if (action.DisabledForScenes.Count != 0 && action.DisabledForScenes.Any(s => s == currentSceneName))
            {
                return;
            }
            _logger.Write(LogLevel.Info, $"Scene Switch Window focused, switching '{action.SceneName}' to previous scene '{currentSceneName}'");

            _currentFocusAction       = action;
            _currentFocusedWindowInfo = newFocusedWindow;

            if (!_sceneSwitched)
            {
                _previousSceneName = currentSceneName;
                _obs.SetCurrentScene(_currentFocusAction.SceneName);
                _sceneSwitched = true;
            }
        }