Exemple #1
0
 private void _DiscoverIntentsFromEffects()
 {
     // For each effect in the in-effect list for the context...
     //Parallel.ForEach(_currentEffects, effectNode =>
     foreach (var effectNode in CurrentEffects)
     {
         var           layer = GetLayerForNode(effectNode);
         TimeSpan      effectRelativeTime = _currentTime - effectNode.StartTime;
         EffectIntents effectIntents      = effectNode.Effect.Render();
         if (effectIntents == null)
         {
             continue;
         }
         foreach (var effectIntent in effectIntents)
         {
             foreach (IIntentNode intentNode in effectIntent.Value)
             {
                 if (TimeNode.IntersectsInclusively(intentNode, effectRelativeTime))
                 {
                     IIntentState intentState = intentNode.CreateIntentState(effectRelativeTime - intentNode.StartTime,
                                                                             layer);
                     _elementStateBuilder.AddElementState(effectIntent.Key, intentState);
                 }
             }
         }
     }
 }
Exemple #2
0
        private static Color ProcessIntentNodes(KeyValuePair <Guid, IntentNodeCollection> effectIntent, TimeSpan effectRelativeTime)
        {
            IntentStateList states = new IntentStateList();

            foreach (IIntentNode intentNode in effectIntent.Value)
            {
                if (TimeNode.IntersectsInclusively(intentNode, effectRelativeTime))
                {
                    IIntentState intentState = intentNode.CreateIntentState(effectRelativeTime - intentNode.StartTime, SequenceLayers.GetDefaultLayer());
                    states.Add(intentState);
                }
            }

            return(IntentHelpers.GetOpaqueRGBMaxColorForIntents(states));
        }
Exemple #3
0
        private static Dictionary <Color, DiscreteValue> ProcessDiscreteIntentNodes(KeyValuePair <Guid, IntentNodeCollection> effectIntent, TimeSpan effectRelativeTime)
        {
            IntentStateList states = new IntentStateList();

            foreach (IIntentNode intentNode in effectIntent.Value)
            {
                if (TimeNode.IntersectsInclusively(intentNode, effectRelativeTime))
                {
                    IIntentState intentState = intentNode.CreateIntentState(effectRelativeTime - intentNode.StartTime, SequenceLayers.GetDefaultLayer());
                    states.Add(intentState);
                }
            }

            return(GetAlphaDiscreteColorsForIntents(states));
        }