public async Task SetSourceDimensions(string sceneName, string sourceName, StreamingSoftwareSourceDimensionsModel dimensions) { StreamlabsOBSSceneItem sceneItem = await this.GetSceneItem(sceneName, sourceName); if (sceneItem != null) { StreamlabsOBSRequest request = new StreamlabsOBSRequest("setTransform", sceneItem.ResourceID); JObject positionJObj = new JObject(); positionJObj["x"] = dimensions.X; positionJObj["y"] = dimensions.Y; JObject scaleObj = new JObject(); scaleObj["x"] = dimensions.XScale; scaleObj["y"] = dimensions.YScale; JObject jobj = new JObject(); jobj["position"] = positionJObj; jobj["scale"] = scaleObj; jobj["rotation"] = dimensions.Rotation; request.Arguments.Add(jobj); await this.SendAndReceive(request); } }
public async Task SetSourceDimensions(string sceneName, string sourceName, StreamingSoftwareSourceDimensionsModel dimensions) { await this.OBSCommandTimeoutWrapper((cancellationToken) => { Logger.Log(LogLevel.Debug, "Setting source dimensions - " + sourceName); this.OBSWebsocket.SetSceneItemPosition(sourceName, dimensions.X, dimensions.Y, sceneName); this.OBSWebsocket.SetSceneItemTransform(sourceName, dimensions.Rotation, dimensions.XScale, dimensions.YScale, sceneName); return(false); }); }
protected override async Task OnLoadedInternal() { this.SourceGetCurrentDimensionsCommand = this.CreateCommand(async() => { if (!string.IsNullOrEmpty(this.SourceName)) { StreamingSoftwareSourceDimensionsModel dimensions = await StreamingSoftwareActionModel.GetSourceDimensions(this.SelectedStreamingSoftwareType, this.SceneName, this.SourceName); if (dimensions != null) { this.SourceXPosition = dimensions.X; this.SourceYPosition = dimensions.Y; this.SourceRotation = dimensions.Rotation; this.SourceXScale = dimensions.XScale; this.SourceYScale = dimensions.YScale; } } }); await base.OnLoadedInternal(); }
public Task SetSourceDimensions(string sceneName, string sourceName, StreamingSoftwareSourceDimensionsModel dimensions) { return(Task.FromResult(0)); }