示例#1
0
        private void OnEventReceived(EventDispatcher.Event e, object?arg)
        {
            Dispatcher.UIThread.Post(async() =>
            {
                switch (e)
                {
                case EventDispatcher.Event.EqualizerToggle:
                    await MessageComposer.SetEqualizer(!_eqSwitch.IsChecked, (EqPreset)_presetSlider.Value, false);
                    _eqSwitch.Toggle();
                    break;

                case EventDispatcher.Event.EqualizerNextPreset:
                    _eqSwitch.IsChecked = true;
                    var newVal          = _presetSlider.Value + 1;
                    if (newVal >= 5)
                    {
                        newVal = 0;
                    }

                    _presetSlider.Value = newVal;
                    await MessageComposer.SetEqualizer(_eqSwitch.IsChecked, (EqPreset)_presetSlider.Value, false);
                    break;
                }
            });
        }
示例#2
0
 private async void EqPreset_OnChanged(object?sender, int e)
 {
     await MessageComposer.SetEqualizer(_eqSwitch.IsChecked, (EqPreset)_presetSlider.Value, false);
 }
示例#3
0
 private async void EqToggle_OnToggled(object?sender, bool e)
 {
     await MessageComposer.SetEqualizer(_eqSwitch.IsChecked, (EqPreset)_presetSlider.Value, false);
 }