Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
Exemplo n.º 3
0
 public abstract void Execute(IReceivesColor device, ChannelEffectInstance.DeviceType deviceType, IControlToken token);
Exemplo n.º 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;
                }
            }
Exemplo n.º 5
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);
            }
        }