コード例 #1
0
 /// <summary>
 ///     Internal Constructor, only called by the getter for the InstalledDevices property.
 /// </summary>
 /// <param name="deviceId">Position of this device in the list of all devices.</param>
 /// <param name="caps">Win32 Struct with device metadata</param>
 internal InputDevice(UIntPtr deviceId, MIDIINCAPS caps)
     : base(caps.szPname)
 {
     _deviceId = deviceId;
     _caps     = caps;
     _inputCallbackDelegate = InputCallback;
     _isOpen      = false;
     _clock       = null;
     _nrpnWatcher = new NrpnWatcher(this);
 }
コード例 #2
0
        /// <summary>
        /// Opens the input device.
        /// </summary>
        /// <exception cref="InvalidOperationException">The device is already open.</exception>
        /// <exception cref="DeviceException">The device cannot be opened.</exception>
        /// <remarks>Note that Open() establishes a connection to the device, but no messages will
        /// be received until <see cref="StartReceiving()"/> is called.</remarks>
        public void Open()
        {
            lock (_lockObj)
            {
                CheckNotOpen();

                _inputCallbackDelegate = this.InputCallback;
                StartMessageProcessingThread();

                CheckReturnCode(Win32API.midiInOpen(out _handle, _deviceId, _inputCallbackDelegate, (UIntPtr)0));
                _isOpen = true;
            }
        }
コード例 #3
0
ファイル: InputDevice.cs プロジェクト: Meddington/xyzmidi
 /// <summary>
 /// Private Constructor, only called by the getter for the InstalledDevices property.
 /// </summary>
 /// <param name="deviceId">Position of this device in the list of all devices.</param>
 /// <param name="caps">Win32 Struct with device metadata</param>
 private InputDevice(UIntPtr deviceId, Win32API.MIDIINCAPS caps)
     : base(caps.szPname)
 {
     this.deviceId = deviceId;
     this.caps = caps;
     this.inputCallbackDelegate = new Win32API.MidiInProc(this.InputCallback);
     this.isOpen = false;
     this.clock = null;
 }
コード例 #4
0
 internal WindowsMidiDriver() : base()
 {
     _callback = new Win32API.MidiInProc(this.InputCallback);
 }