Пример #1
0
 public void Set(bool[] filter)
 {
     for (int i = 0; i < 100; i++)
     {
         Grid.SetColor(LaunchpadGrid.SignalToGrid(i), GetColor(filter[i]));
     }
 }
Пример #2
0
        public LaunchpadWindow(Launchpad launchpad)
        {
            InitializeComponent();
            #if DEBUG
            this.AttachDevTools();
            #endif

            UpdateTopmost(Preferences.AlwaysOnTop);
            Preferences.AlwaysOnTopChanged += UpdateTopmost;

            _launchpad = launchpad;

            Title = TitleText.Text = TitleCenter.Text = _launchpad.Name;

            for (int i = 0; i < 100; i++)
            {
                Grid.SetColor(LaunchpadGrid.SignalToGrid(i), launchpad.GetColor(i).ToScreenBrush());
            }

            observables.Add(Grid.GetObservable(Visual.BoundsProperty).Subscribe(Grid_Updated));

            observables.Add(this.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
            observables.Add(TitleText.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
            observables.Add(TitleCenter.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
            observables.Add(CenteringLeft.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
            observables.Add(CenteringRight.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
        }
Пример #3
0
        public KeyFilterViewer(KeyFilter filter)
        {
            InitializeComponent();

            _filter = filter;

            for (int i = 0; i < 101; i++)
            {
                Grid.SetColor(LaunchpadGrid.SignalToGrid(i), GetColor(_filter[i]));
            }
        }
Пример #4
0
        public PreviewViewer(Preview preview)
        {
            InitializeComponent();

            _preview = preview;

            for (int i = 0; i < 100; i++)
            {
                Grid.SetColor(LaunchpadGrid.SignalToGrid(i), new Color(0).ToScreenBrush());
            }
        }
Пример #5
0
        public void Set(Chain chain, bool[] filter)
        {
            int index = _multi.Chains.IndexOf(chain);

            if (index != -1 && _multi.Expanded != index)
            {
                return;
            }

            for (int i = 0; i < 100; i++)
            {
                Grid.SetColor(LaunchpadGrid.SignalToGrid(i), GetColor(filter[i]));
            }
        }
Пример #6
0
        public LaunchpadWindow(Launchpad launchpad)
        {
            InitializeComponent();
            #if DEBUG
            this.AttachDevTools();
            #endif

            UpdateTopmost(Preferences.AlwaysOnTop);
            Preferences.AlwaysOnTopChanged += UpdateTopmost;

            _launchpad = launchpad;

            Title = this.Get <TextBlock>("Title").Text = _launchpad.Name;

            for (int i = 0; i < 100; i++)
            {
                Grid.SetColor(LaunchpadGrid.SignalToGrid(i), launchpad.GetColor(i).ToScreenBrush());
            }

            Grid.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated);
        }
Пример #7
0
 public void SignalRender(Signal n) => Dispatcher.UIThread.InvokeAsync(() => {
     Grid.SetColor(LaunchpadGrid.SignalToGrid(n.Index), n.Color.ToScreenBrush());
 });
Пример #8
0
 void FadeExit(Signal n) => Dispatcher.UIThread.InvokeAsync(() => {
     Preview?.SetColor(LaunchpadGrid.SignalToGrid(n.Index), n.Color.ToScreenBrush());
 });
Пример #9
0
 void FadeExit(List <Signal> n) => Dispatcher.UIThread.InvokeAsync(() => {
     foreach (Signal s in n)
     {
         Preview?.SetColor(LaunchpadGrid.SignalToGrid(s.Index), s.Color.ToScreenBrush());
     }
 });