Exemplo n.º 1
0
        public static void Init()
        {
            ctrlVals   = new ControllerValues();
            midiInputs = InputDevice.InstalledDevices;
            bool connected = false;

            foreach (InputDevice inDevice in midiInputs)
            {
                if (inDevice.Name == "nanoKONTROL2")
                {
                    if (Open(inDevice))
                    {
                        StartInterpThread();
                        connected = true;
                    }
                    break;
                }
            }

            Core.win.midiCtrlButton.Click += MidiCtrlButton_Click;

            if (connected && Properties.Settings.Default.masterIp.Length > 0)
            {
                Connect(Properties.Settings.Default.masterIp);
            }
        }
Exemplo n.º 2
0
    internal void ResetControls()
    {
        TextAsset controlJsonFile = Resources.Load <TextAsset>("ControllerValues");

        PlayerPrefs.SetString(prefControllerJson, controlJsonFile.ToString());
        controllerValues = JsonUtility.FromJson <ControllerValues>(controlJsonFile.ToString());
    }
Exemplo n.º 3
0
 private void CreateControllerValues(int addr, int count)
 {
     for (int i = 0; i < count; i++)
     {
         for (int j = 0; j < 12; j++)
         {
             ControllerValues.Add(new DeviceValueRow <float>($"{addr + i:d2} " + ((EUT55ARegisterSeries)j).ToString(), 0));
         }
     }
 }
Exemplo n.º 4
0
    //{
    //get
    //{
    //	return javaClass.GetStatic<AndroidJavaObject>("instance");
    //}
    //	}



    #region Unity Callbacks
    private void Awake()
    {
        GenerateBtnJSON();
        InitializePlugin();
        TextAsset controlJsonFile = Resources.Load <TextAsset>("ControllerValues");

        if (PlayerPrefs.GetString(prefControllerJson) == string.Empty)
        {
            PlayerPrefs.SetString(prefControllerJson, controlJsonFile.ToString());
        }
        controllerValues = JsonUtility.FromJson <ControllerValues>(PlayerPrefs.GetString(prefControllerJson));
    }
Exemplo n.º 5
0
    private void GenerateBtnJSON()
    {
        ControllerValues controllerValues = new ControllerValues
        {
            btnValues = new ButtonValues[10]
        };

        controllerValues.btnValues[0] = new ButtonValues {
            upValue = "900", downValue = "901"
        };
        controllerValues.btnValues[1] = new ButtonValues {
            upValue = "902", downValue = "903"
        };
        controllerValues.btnValues[2] = new ButtonValues {
            upValue = "904", downValue = "905"
        };
        controllerValues.btnValues[3] = new ButtonValues {
            upValue = "906", downValue = "907"
        };
        controllerValues.btnValues[4] = new ButtonValues {
            upValue = "908", downValue = "909"
        };
        controllerValues.btnValues[5] = new ButtonValues {
            upValue = "910", downValue = "911"
        };
        controllerValues.btnValues[6] = new ButtonValues {
            upValue = "912", downValue = "913"
        };
        controllerValues.btnValues[7] = new ButtonValues {
            upValue = "914", downValue = "915"
        };
        controllerValues.btnValues[8] = new ButtonValues {
            upValue = "916", downValue = "917"
        };
        controllerValues.btnValues[9] = new ButtonValues {
            upValue = "918", downValue = "919"
        };
    }
Exemplo n.º 6
0
 public static void SetCtrlVals(ControllerValues ctrlVals_)
 {
     ctrlVals    = ctrlVals_;
     initialized = new bool[51];
 }