Пример #1
0
        private void LevelsUpdate(PioneerDDJSB2 ddjsb2, float[] levels)
        {
            // Voicemeeter    DDJSB2
            // 0 - 1.1        0 - 127

            const float divisor = 127.0f / 1.1f;

            float deck1Value = levels[2] * divisor;
            float deck2Value = levels[1] * divisor;

            ddjsb2.LevelLedControl(Leds.Deck.Deck1, Leds.Level, (byte)deck1Value);
            ddjsb2.LevelLedControl(Leds.Deck.Deck2, Leds.Level, (byte)deck2Value);

            // Is something playing on the Spotify channel?
            if (levels[0] > 0.005f && playLed == false)
            {
                playLed = true;
                ddjsb2.LedControl(Leds.Deck.Deck2, Leds.PlayLed, false, true);
            }
            if (levels[0] < 0.005f && playLed)
            {
                playLed = false;
                ddjsb2.LedControl(Leds.Deck.Deck2, Leds.PlayLed, false, false);
                lastPause = DateTime.UtcNow;
            }

            //ddjsb2.LedControl(Leds.Deck.Deck1, Leds.PlayLed, false, GameService.GameStatusObservable.EliteAPI.Status.IsRunning);
        }
Пример #2
0
 private void ParametersUpdate(PioneerDDJSB2 ddjsb2, int changeEvent)
 {
     // Deck 2 Headphone Cue hooked to SpotifyA1Patch
     ddjsb2.LedControl(
         Leds.Deck.Deck2,
         Leds.HeadphoneCueLed,
         false,
         VoiceMeeter.Remote.GetParameter(SpotifyA1Patch) > 0);
 }
        public static void SpotifyTrackChange(PioneerDDJSB2 ddjsb2, int mediaVkey, Leds.Deck deck, Led led, IState state)
        {
            var button = state.Control as Button;
            var on     = button.NoteValue > 0;

            // Light the LED when pressed
            ddjsb2.LedControl(deck, led, false, on);

            if (on)
            {
                Utils.SendVKeyToProcess("Spotify", mediaVkey);
            }
        }
Пример #4
0
        private void FocusWindowHandler(PioneerDDJSB2 ddjsb2, string process, Leds.Deck deck, IState state)
        {
            Logger.LogDebug($"FocusWindowHandler: {state.Control.Name}");

            var button = state.Control as Button;
            var on     = button.NoteValue > 0;

            // Light the LED when pressed
            ddjsb2.LedControl(deck, Leds.CueLed, false, on);

            if (on)
            {
                Utils.FocusWindow(process);
            }
        }