public CSLOBSConnector() { Mode = EOBSMode.Normal; Scenes = new List <SOBSScene>(); PreviewScenes = new List <SOBSScene>(); Transitions = new List <SOBSTransition>(); Sources = new List <SOBSSource>(); AudioSources = new List <SOBSAudioSource>(); ActiveScene = new SOBSScene(); ActivePreviewScene = new SOBSScene(); ActiveTransition = new SOBSTransition(); _state = new SOBSStreamingState(); _state.Stream = EOBSStreamingState.Unkown; _state.Record = EOBSStreamingState.Unkown; _state.Replay = EOBSStreamingState.Unkown; ws = new SLOBSWebsocket(); ws.ConnectionStatus += Ws_ConnectionStatus; ws.SceneChanged += Ws_SceneChanged; ws.SceneListChanged += Ws_SceneListChanged; ws.SceneItemChanged += Ws_SceneItemChanged; ws.SourceChanged += Ws_SourceChanged; ws.StreamingStatusChanged += Ws_StreamingStatusChanged; //timer for querying Recording & Replay buffer status //SLOBS api has no events for this types yet. statusTimer = new System.Timers.Timer(5000); statusTimer.Elapsed += StatusTimer_Elapsed;; statusTimer.AutoReset = true; statusTimer.Enabled = false; }
private SOBSTransition _translateTransition(string input, int index = 0) { SOBSTransition transition = new SOBSTransition(); transition.Name = input; transition.Id = _uidFromString(input); transition.Index = index; return(transition); }
private SOBSTransition _translateActiveTransition(TransitionSettings input) { SOBSTransition transition = new SOBSTransition(); transition.Name = input.Name; transition.Id = _uidFromString(input.Name); for (int i = 0; i < Transitions.Count; i++) { if (Transitions[i].Id == transition.Id) { transition.Index = i; } } return(transition); }
private void Ws_TransitionChanged(OBSWebsocket sender, string newTransitionName) { SOBSTransition newTransition = new SOBSTransition(); newTransition.Name = newTransitionName; newTransition.Id = _uidFromString(newTransitionName); for (int i = 0; i < Transitions.Count; i++) { if (Transitions[i].Name == newTransitionName) { newTransition.Index = i; } } ActiveTransition = newTransition; if (TransitionChanged != null) { TransitionChanged(this, EOBSEvent.TransitionChanged); } }
public COBSConnector() { Mode = EOBSMode.Normal; Scenes = new List <SOBSScene>(); PreviewScenes = new List <SOBSScene>(); Transitions = new List <SOBSTransition>(); Sources = new List <SOBSSource>(); AudioSources = new List <SOBSAudioSource>(); ActiveScene = new SOBSScene(); ActivePreviewScene = new SOBSScene(); ActiveTransition = new SOBSTransition(); _state = new SOBSStreamingState(); _state.Stream = EOBSStreamingState.Unkown; _state.Record = EOBSStreamingState.Unkown; _state.Replay = EOBSStreamingState.Unkown; SpecialSources = new Dictionary <string, string>(); ws = new OBSWebsocket(); ws.Connected += Ws_Connected; ws.Disconnected += Ws_Disconnected; ws.OnError += Ws_OnError; ws.SceneChanged += Ws_SceneChanged; ws.PreviewSceneChanged += Ws_PreviewSceneChanged; ws.SceneCollectionChanged += Ws_SceneCollectionChanged; ws.TransitionChanged += Ws_TransitionChanged; ws.TransitionListChanged += Ws_TransitionListChanged; ws.SceneItemVisibilityChanged += Ws_SceneItemVisibilityChanged; ws.SceneItemAdded += Ws_SceneItemAdded; ws.SceneItemRemoved += Ws_SceneItemRemoved; ws.SourceOrderChanged += Ws_SourceOrderChanged; ws.StudioModeSwitched += Ws_StudioModeSwitched; ws.StreamingStateChanged += Ws_StreamingStateChanged; ws.RecordingStateChanged += Ws_RecordingStateChanged; }