Esempio n. 1
0
        /// <summary>
        /// Updates all elements to display the current effect and brightness
        /// </summary>
        public void Update()
        {
            //Update UI on main thread
            Dispatcher.Invoke(new Action(() =>
            {
                var orchestrator = OrchestratorCollection.GetOrchestratorForDevice(_device);
                var activeEffect = orchestrator.GetActiveEffectName();

                if (string.IsNullOrEmpty(activeEffect))
                {
                    ActiveEffectLabel.Content = MainWindows.Resources.None;
                }
                else
                {
                    ActiveEffectLabel.Content = $"{activeEffect} ({EnumLocalizer.GetLocalizedEnum(_device.OperationMode)})";
                }

                _selectedEffect = activeEffect;

                var activeBrightness = orchestrator.GetActiveBrightness();
                Brightness           = activeBrightness < 0 ? 0 : activeBrightness;
                OnPropertyChanged(nameof(Brightness)); //Call property changed to correctly set slider position

                //Update the colors in the mainwindow
                _parent.UpdateLayoutColors(_device.Name);

                //Update the dropdown
                EffectComboBox.UpdateSelection(_selectedEffect);
            }));
        }
Esempio n. 2
0
        public void ReloadEffects()
        {
            //Reset the orchestrator since it can happen that the orchestrators have been reset before calling this function
            SetOrchestrator();

            EffectComboBox.InitializeEffects(_orchestrator);

            EffectComboBox.UpdateSelection(_selectedEffect);
        }
Esempio n. 3
0
        public void ReloadEffects()
        {
            //Reset the orchestrator since it can happen that the orchestrators have been reset before calling this function
            RegisterWithOrchestrator();

            var orchestrator = OrchestratorCollection.GetOrchestratorForDevice(_device);

            EffectComboBox.InitializeEffects(orchestrator);

            EffectComboBox.UpdateSelection(_selectedEffect);
        }