コード例 #1
0
ファイル: MidiMap.cs プロジェクト: xx70235/wwt-windows-client
        public void ConnectDevice(int index, int outputIndex)
        {
            InputDevice = new MidiInput();
            if (InputDevice.Open(index))
            {
                InputDevice.MessageReceived += new MidiMessageReceived(InputDevice_MessageReceived);
                InputDevice.Start();
                Connected = true;
            }
            else
            {
                InputDevice = null;
            }

            OutputDevice = new MidiOutput();
            if (OutputDevice.Open(outputIndex))
            {
                Connected = true;
            }
            else
            {
                OutputDevice = null;
            }
        }