Example #1
0
        private void AddEffectData(IChannelIdentity channelIdentity, IEnumerable <DeviceController> devices, ChannelEffectInstance.DeviceType deviceType)
        {
            foreach (var effectData in this.channelEffectsPerChannel[channelIdentity])
            {
                var effectInstance = new ChannelEffectInstance
                {
                    Devices = devices,
                    Effect  = effectData,
                    Type    = deviceType
                };

                timeline.AddMs(effectData.StartMs, effectInstance);
            }
        }
Example #2
0
            public override void Execute(IReceivesColor device, ChannelEffectInstance.DeviceType deviceType, IControlToken token)
            {
                Executor.Current.MasterEffect.Shimmer(new LogicalDevice.VirtualDevice(b =>
                {
                    var currentColor = device.Color;
                    switch (deviceType)
                    {
                        case ChannelEffectInstance.DeviceType.ColorR:
                            device.SetColor(Color.FromArgb((int)(b * 255), currentColor.G, currentColor.B), 1, token);
                            break;

                        case ChannelEffectInstance.DeviceType.ColorG:
                            device.SetColor(Color.FromArgb(currentColor.R, (int)(b * 255), currentColor.B), 1, token);
                            break;

                        case ChannelEffectInstance.DeviceType.ColorB:
                            device.SetColor(Color.FromArgb(currentColor.R, currentColor.G, (int)(b * 255)), 1, token);
                            break;
                    }
                }), StartBrightness, EndBrightness, DurationMs, token: token);
            }
 public abstract void Execute(IReceivesColor device, ChannelEffectInstance.DeviceType deviceType, IControlToken token);
Example #4
0
            public override void Execute(IReceivesColor device, ChannelEffectInstance.DeviceType deviceType, IControlToken token)
            {
                var currentColor = device.Color;
                switch (deviceType)
                {
                    case ChannelEffectInstance.DeviceType.ColorR:
                        device.SetColor(Color.FromArgb((int)(Brightness * 255), currentColor.G, currentColor.B), 1, token);
                        break;

                    case ChannelEffectInstance.DeviceType.ColorG:
                        device.SetColor(Color.FromArgb(currentColor.R, (int)(Brightness * 255), currentColor.B), 1, token);
                        break;

                    case ChannelEffectInstance.DeviceType.ColorB:
                        device.SetColor(Color.FromArgb(currentColor.R, currentColor.G, (int)(Brightness * 255)), 1, token);
                        break;
                }
            }
        private void AddEffectData(IChannelIdentity channelIdentity, IEnumerable<DeviceController> devices, ChannelEffectInstance.DeviceType deviceType)
        {
            foreach (var effectData in this.channelEffectsPerChannel[channelIdentity])
            {
                var effectInstance = new ChannelEffectInstance
                {
                    Devices = devices,
                    Effect = effectData,
                    Type = deviceType
                };

                timeline.AddMs(effectData.StartMs, effectInstance);
            }
        }