Esempio n. 1
0
        public BlendHueData(GroupID gID, LightID lID, LightData fromData, LightData toData, float transitionTime)
        {
            _gID = gID;
             _lID = lID;
             _fromData = fromData;
             _toData = toData;
             _transitionTime = transitionTime;

             _timeStamp = Time.time;
        }
Esempio n. 2
0
 public LightEventArgs(GroupID g, LightID l, LightTypes lt, LightData d)
 {
     Group = g; Light = l; LightType = lt;  Data = d;
 }
Esempio n. 3
0
 public LightTriggeredEventArgs(GroupID g, LightID l, float w)
 {
     Group = g; Light = l; Weight = w;
 }
Esempio n. 4
0
    //finds the GroupID and LightID of a light with the given channel #
    //returns false if it doesnt find a compatible light in any of the groups
    bool FindLight(int channel, LightTypes lightType, ref GroupID gID, ref LightID lID)
    {
        for (int i = 0; i < LightGroups.Length; i++)
          {
         LightGroupConfig g = LightGroups[i];

         for (int j = 0; j < g.Lights.Length; j++)
         {
            LightConfig l = g.Lights[j];

            if ((l.Channel == channel) && (l.LightType == lightType))
            {
               gID = g.Group;
               lID = (LightID)j;
               return true;
            }
         }
          }

          return false;
    }
Esempio n. 5
0
    LightConfig FindLightConfig(GroupID gId, LightID lId)
    {
        for (int i = 0; i < LightGroups.Length; i++)
          {
         LightGroupConfig g = LightGroups[i];
         if (g.Group == gId)
         {
            for (int j = 0; j < g.Lights.Length; j++)
            {
               if (j == (int)lId)
                  return g.Lights[j];
            }
         }
          }

          return null;
    }
Esempio n. 6
0
 //a way to set the value of any light in the system, regardless of type (Hue, LightJams, whatevs)
 public void SetLight(GroupID gID, LightID lID, float intensity, Color color = default(Color), float transitionTime = 0.0f)
 {
     LightConfig lc = FindLightConfig(gID, lID);
       if (lc != null)
      lc.Set(color, intensity, transitionTime);
 }
Esempio n. 7
0
 public void SendLightTriggeredEvent(GroupID g, LightID l, float weight)
 {
     if (OnLightEffectTriggered != null)
      OnLightEffectTriggered(this, new LightTriggeredEventArgs(g, l, weight));
 }
Esempio n. 8
0
 public void SendHueEvent(GroupID gID, LightID lID, LightData newData)
 {
     if(OnLightChanged != null)
      OnLightChanged(this, new LightEventArgs(gID, lID, LightTypes.Hue, newData));
 }
Esempio n. 9
0
 public bool IsLightJamsLight(GroupID g, LightID l)
 {
     LightConfig lConfig = FindLightConfig(g, l);
       if (lConfig != null)
      return lConfig.LightType == LightTypes.LightJams;
       return false;
 }
Esempio n. 10
0
 //get latency for the given light.  Meaning this is how long it takes to set a value, and have it appear on the lights.
 public float GetLatency(GroupID gID, LightID lID)
 {
     LightConfig lc = FindLightConfig(gID, lID);
      if (lc != null)
      {
         if (lc.LightType == LightTypes.Hue)
            return HueMessenger.Instance.GetCurLatency();
         else
            return LightJamsMgr.Instance.GetCurLatency();
      }
      return 0.0f;
 }