Example #1
0
        /// <summary>
        /// Applies a single color effect to a device
        /// </summary>
        /// <param name="fromDevice">The device to map lights from</param>
        /// <param name="toDevice">The device to map lights to</param>
        private void ApplySingleColorEffect(IDevice fromDevice, IDevice toDevice)
        {
            var fromLight = fromDevice.Lights.FirstOrDefault();

            foreach (var light in toDevice.Lights)
            {
                light.Color = fromLight.Color;
            }

            toDevice.ApplyLights();
        }
Example #2
0
        /// <summary>
        /// Applies a wrap effect to a device
        /// </summary>
        /// <param name="fromDevice">The device to map lights from</param>
        /// <param name="toDevice">The device to map lights to</param>
        private void ApplyWrapEffect(IDevice fromDevice, IDevice toDevice)
        {
            var fromLights   = fromDevice.Lights.ToArray();
            var currentLight = 0;

            foreach (var light in toDevice.Lights)
            {
                light.Color = fromLights[currentLight].Color;
                currentLight++;

                if (currentLight == fromLights.Length)
                {
                    currentLight = 0;
                }
            }

            toDevice.ApplyLights();
        }