Exemplo n.º 1
0
        public static SceneItem GetSceneItem(string sceneName, string itemName)
        {
            if (sceneList == null)
            {
                if (!obsWebsocket.IsConnected)
                {
                    return(null);
                }
                sceneList = obsWebsocket.GetSceneList();
            }

            OBSScene scene = sceneList?.Scenes?.FirstOrDefault(x => x.Name == sceneName);

            return(scene?.Items?.FirstOrDefault(x => x.SourceName == itemName));
        }
        private RemoteControlData GetObs(RemoteControlData wsData)
        {
            RemoteObsScenes remoteScenes = new RemoteObsScenes();

            if (obsService.isConnected)
            {
                GetSceneListInfo scenes = obsService.getScenes();
                foreach (OBSScene scene in scenes.Scenes)
                {
                    RemoteObsScene remoteScene = new RemoteObsScene();
                    remoteScene.name = scene.Name;
                    remoteScenes.Add(remoteScene);
                }
            }
            else
            {
                wsData.status = "OBS_WEBSOCKET_ERROR";
            }

            wsData.data = remoteScenes;
            return(wsData);
        }