void StartLiveFeedAnimation(string itemName, string sceneName, double playerX, double videoAnchorHorizontal, double videoAnchorVertical, double videoWidth, double videoHeight, double targetScale, double timeMs) { SceneItem sceneItem = ObsManager.GetSceneItem(sceneName, itemName); SceneItemProperties sceneItemProperties = ObsManager.GetSceneItemProperties(itemName, sceneName); double startScale = sceneItemProperties.Bounds.Height / videoHeight; VideoFeed[] videoFeeds = GetVideoFeeds(sceneName, itemName, videoAnchorHorizontal, videoAnchorVertical, videoWidth, videoHeight); LiveFeedScaler liveFeedAnimation = new LiveFeedScaler(videoFeeds, playerX, startScale, targetScale, timeMs); if (!sceneItem.Render) { ObsManager.SizeAndPositionItem(liveFeedAnimation, (float)liveFeedAnimation.TargetScale); } else { liveFeedAnimation.Render += LiveFeedAnimation_Render; } }
private void LiveFeedAnimation_Render(object sender, LiveFeedScaler e) { float scale = (float)e.GetTargetScale(); ObsManager.SizeAndPositionItem(e, scale); }
void OnRender(object sender, LiveFeedScaler e) { Render?.Invoke(sender, e); }