Exemple #1
0
        static void StartLiveAnimation(string sceneName, List <VideoAnimationBinding> bindings, DateTime startTime)
        {
            CleanUpLiveFeedAnimators();
            liveFeedAnimators = new List <LiveFeedAnimator>();
            foreach (VideoAnimationBinding videoAnimationBinding in bindings)
            {
                string      movementFile = GetFullPathToMovementFile(videoAnimationBinding.MovementFileName);
                VideoFeed[] videoFeeds   = AllVideoFeeds.GetAll(videoAnimationBinding);

                LiveFeedAnimator liveFeedAnimator = LoadLiveAnimation(movementFile, videoAnimationBinding, videoFeeds);
                liveFeedAnimator.FrameAnimator.AnimationComplete += LiveFeedAnimator_AnimationComplete;
                liveFeedAnimator.FrameAnimator.Start(startTime);
                liveFeedAnimators.Add(liveFeedAnimator);
            }

            // TODO: Track which video feed we are running in case we abort while we are running.

            string fullPathToLightsFile = VideoAnimationManager.GetFullPathToLightsFile(sceneName);

            if (System.IO.File.Exists(fullPathToLightsFile))
            {
                string           lightsJson       = System.IO.File.ReadAllText(fullPathToLightsFile);
                LightingSequence lightingSequence = JsonConvert.DeserializeObject <LightingSequence>(lightsJson);
                //log.Clear();
                foreach (Light light in lightingSequence.Lights)
                {
                    FrameAnimator frameAnimator = new FrameAnimator(light.SequenceData.Count);
                    frameAnimator.Data = light;
                    frameAnimator.AnimationComplete += FrameAnimator_AnimationComplete;
                    frameAnimator.RenderFrame       += FrameAnimator_RenderLights;
                    frameAnimator.Start(startTime);
                    lightAnimators.Add(frameAnimator);
                }
            }

            existingAnimationIsRunning = true;
        }
Exemple #2
0
 public LiveFeedAnimator(VideoFeed[] videoFeeds, List <ObsTransform> liveFeedFrames) : base(videoFeeds)
 {
     LiveFeedSequences          = liveFeedFrames;
     FrameAnimator              = new FrameAnimator(liveFeedFrames.Count);
     FrameAnimator.RenderFrame += FrameAnimator_RenderFrame;
 }