Exemple #1
0
    public void ChangeButtonState(DJControllerControl control, bool isActive)
    {
        TMP_Text textButton = GetButtonText(control);

        if (textButton == null)
        {
            return;
        }

        if (isActive)
        {
            textButton.color = ColorManager.Instance.Blue;
            textButton.font  = _boldFont;

            if (control == DJControllerControl.Rec)
            {
                textButton.text  = "Off";
                textButton.color = ColorManager.Instance.Red;
            }
        }
        else
        {
            textButton.color = ColorManager.Instance.MidBrown;
            textButton.font  = _regularFont;

            if (control == DJControllerControl.Rec)
            {
                textButton.text  = "On";
                textButton.color = ColorManager.Instance.Green;
            }
        }
    }
Exemple #2
0
    Image GetJogImage(DJControllerControl control)
    {
        switch (control)
        {
        case DJControllerControl.LeftJog:
            return(_leftJog);

        case DJControllerControl.RightJog:
            return(_rightJog);

        case DJControllerControl.LeftVolume:
            return(_leftVolumeJog);

        case DJControllerControl.RightVolume:
            return(_rightVolumeJog);

        case DJControllerControl.LeftMedium:
            return(_leftMediumJog);

        case DJControllerControl.LeftBass:
            return(_leftBassJog);

        case DJControllerControl.RightMedium:
            return(_rightMediumJog);

        case DJControllerControl.RightBass:
            return(_rightBassJog);

        default:
            return(null);
        }
    }
Exemple #3
0
 private void SendToRadio(DJControllerControl key, string onMessage, string offMessage, int control)
 {
     if (control == 127)
     {
         if (_activeCommands.ContainsKey(key))
         {
             if (_activeCommands[key] == onMessage)
             {
                 _activeCommands[key] = offMessage;
                 SerialManager.instance.Write(offMessage);
                 WriteOut(new[] { key }, false);
             }
             else
             {
                 _activeCommands[key] = onMessage;
                 SerialManager.instance.Write(onMessage);
                 WriteOut(new[] { key });
             }
         }
         else
         {
             _activeCommands.Add(key, onMessage);
             SerialManager.instance.Write(onMessage);
             WriteOut(new[] { key });
         }
     }
 }
Exemple #4
0
    private void ChangeRadioMode(string mode)
    {
        var command = "";
        DJControllerControl note = DJControllerControl.None;

        DJControllerControl[] switchOff = null;

        switch (mode)
        {
        case "CW":
            command    = "MD3;MD";
            _radioMode = RadioMode.CW;
            note       = DJControllerControl.RightPad3;
            switchOff  = new[]
            {
                DJControllerControl.RightPad2,
                DJControllerControl.RightPad1,
                DJControllerControl.RightPad4
            };
            break;

        case "LSB":
            command    = "MD1;MD";
            _radioMode = RadioMode.LSB;
            note       = DJControllerControl.RightPad1;
            switchOff  = new[]
            {
                DJControllerControl.RightPad2,
                DJControllerControl.RightPad3,
                DJControllerControl.RightPad4
            };
            break;

        case "USB":
            command    = "MD2;MD";
            _radioMode = RadioMode.USB;
            note       = DJControllerControl.RightPad2;
            switchOff  = new[]
            {
                DJControllerControl.RightPad1,
                DJControllerControl.RightPad3,
                DJControllerControl.RightPad4
            };
            break;

        case "FSK":
            command    = "MD6;MD";
            _radioMode = RadioMode.FSK;
            note       = DJControllerControl.RightPad4;
            switchOff  = new[]
            {
                DJControllerControl.RightPad2,
                DJControllerControl.RightPad3,
                DJControllerControl.RightPad1
            };
            break;
        }

        SendToRadio(note, command, switchOff);
    }
Exemple #5
0
    private void ChangeVFO(string vfo)
    {
        var command = "";
        DJControllerControl note = DJControllerControl.None;

        DJControllerControl[] switchOff = null;

        // Reset split state
        _isSplitActive = false;

        switch (vfo)
        {
        case "A":
            command   = "FR0;";
            _vfo      = VFO.A;
            note      = DJControllerControl.LeftSync;
            switchOff = new[] { DJControllerControl.LeftCue, DJControllerControl.LeftPad4 };
            _activeCommands.Remove(DJControllerControl.LeftPad4);
            break;

        case "B":
            command   = "FR1;";
            _vfo      = VFO.B;
            note      = DJControllerControl.LeftCue;
            switchOff = new[] { DJControllerControl.LeftSync, DJControllerControl.LeftPad4 };
            _activeCommands.Remove(DJControllerControl.LeftPad4);
            break;
        }

        SendToRadio(note, command, switchOff);
    }
Exemple #6
0
    TMP_Text GetButtonText(DJControllerControl control)
    {
        switch (control)
        {
        case DJControllerControl.LeftSync:
            return(_leftSync);

        case DJControllerControl.LeftCue:
            return(_leftCue);

        case DJControllerControl.LeftPausePlay:
            return(_leftPausePlay);

        case DJControllerControl.Rec:
            return(_rec);

        case DJControllerControl.LeftPad1:
            return(_leftPad1);

        case DJControllerControl.LeftPad2:
            return(_leftPad2);

        case DJControllerControl.LeftPad3:
            return(_leftPad3);

        case DJControllerControl.LeftPad4:
            return(_leftPad4);

        case DJControllerControl.ScratchAtomix:
            return(_scratchAtomix);

        case DJControllerControl.RightPad1:
            return(_rightPad1);

        case DJControllerControl.RightPad2:
            return(_rightPad2);

        case DJControllerControl.RightPad3:
            return(_rightPad3);

        case DJControllerControl.RightPad4:
            return(_rightPad4);

        case DJControllerControl.RightSync:
            return(_rightSync);

        case DJControllerControl.RightCue:
            return(_rightCue);

        case DJControllerControl.RightPausePlay:
            return(_rightPausePlay);

        default:
            return(null);
        }
    }
Exemple #7
0
    private void SendToRadio(DJControllerControl key, string message, DJControllerControl[] switchOffCodes = null)
    {
        WriteOut(new[] { key });

        if (switchOffCodes != null)
        {
            WriteOut(switchOffCodes, false);
        }

        SerialManager.Instance.Write(message);
    }
Exemple #8
0
    private IEnumerator ISendToRadio(DJControllerControl key, string message, int control, bool forceClose)
    {
        WriteOut(new[] { key });

        SerialManager.Instance.Write(message);

        yield return(new WaitForSeconds(.3f));

        if (control == 0 || forceClose)
        {
            WriteOut(new[] { key }, false);
        }
    }
Exemple #9
0
    public void MoveJog(int control, DJControllerControl controlJog, bool isRelative = false)
    {
        Image jog = GetJogImage(controlJog);

        if (isRelative)
        {
            jog.transform.DOLocalRotate(control < 64 ? new Vector3(0, 0, -1) : new Vector3(0, 0, 1), 0f,
                                        RotateMode.LocalAxisAdd);
        }
        else
        {
            jog.transform.DOLocalRotate(new Vector3(0, 0, -control), 0f, RotateMode.FastBeyond360);
        }
    }
Exemple #10
0
 private void SendToRadio(DJControllerControl key, string message, int control, bool forceClose = false)
 {
     StartCoroutine(ISendToRadio(key, message, control, forceClose));
 }