#pragma warning disable CS0612 // Type or member is obsolete internal StreamingSoftwareActionModel(MixItUp.Base.Actions.StreamingSoftwareAction action) : base(ActionTypeEnum.StreamingSoftware) { this.StreamingSoftwareType = (StreamingSoftwareTypeEnum)(int)action.SoftwareType; this.ActionType = (StreamingSoftwareActionTypeEnum)(int)action.ActionType; if (this.ActionType == StreamingSoftwareActionTypeEnum.SceneCollection) { this.ItemName = action.SceneCollectionName; } else if (this.ActionType == StreamingSoftwareActionTypeEnum.Scene) { this.ItemName = action.SceneName; } else if (this.ActionType == StreamingSoftwareActionTypeEnum.SourceDimensions || this.ActionType == StreamingSoftwareActionTypeEnum.SourceVisibility || this.ActionType == StreamingSoftwareActionTypeEnum.TextSource || this.ActionType == StreamingSoftwareActionTypeEnum.WebBrowserSource) { this.ItemName = action.SourceName; this.ParentName = action.SceneName; } this.Visible = action.SourceVisible; this.SourceText = action.SourceText; this.SourceTextFilePath = action.SourceTextFilePath; this.SourceURL = action.SourceURL; if (action.SourceDimensions != null) { this.SourceDimensions = new StreamingSoftwareSourceDimensionsModel(action.SourceDimensions.X, action.SourceDimensions.Y, action.SourceDimensions.Rotation, action.SourceDimensions.XScale, action.SourceDimensions.YScale); } }
public static async Task <StreamingSoftwareSourceDimensionsModel> GetSourceDimensions(StreamingSoftwareTypeEnum softwareType, string sceneName, string sourceName) { StreamingSoftwareSourceDimensionsModel dimensions = null; if (softwareType == StreamingSoftwareTypeEnum.DefaultSetting) { softwareType = ChannelSession.Settings.DefaultStreamingSoftware; } if (softwareType == StreamingSoftwareTypeEnum.OBSStudio) { if (ChannelSession.Services.OBSStudio.IsConnected || (await ChannelSession.Services.OBSStudio.Connect()).Success) { dimensions = await ChannelSession.Services.OBSStudio.GetSourceDimensions(sceneName, sourceName); } } else if (softwareType == StreamingSoftwareTypeEnum.StreamlabsOBS) { if (ChannelSession.Services.StreamlabsOBS.IsConnected || (await ChannelSession.Services.StreamlabsOBS.Connect()).Success) { dimensions = await ChannelSession.Services.StreamlabsOBS.GetSourceDimensions(sceneName, sourceName); } } return(dimensions); }
public static StreamingSoftwareActionModel CreateSourceDimensionsAction(StreamingSoftwareTypeEnum softwareType, string sceneName, string sourceName, bool sourceVisible, StreamingSoftwareSourceDimensionsModel sourceDimensions) { StreamingSoftwareActionModel action = StreamingSoftwareActionModel.CreateSourceVisibilityAction(softwareType, sceneName, sourceName, sourceVisible); action.ActionType = StreamingSoftwareActionTypeEnum.SourceDimensions; action.SourceDimensions = sourceDimensions; return(action); }