public OutputDevice(int deviceId) : base(deviceId) { _lockObject = new object(); _bufferCount = 0; _headerBuilder = new MidiHeaderBuilder(); Handle = 0; _runningStatusEnabled = false; _runningStatus = 0; _midiOutProcIstance = HandleMessage; var result = WindowsMultimediaDevice.midiOutOpen(ref Handle, deviceId, _midiOutProcIstance, 0, 0x30000); if (result != (int)EDeviceException.MmsyserrNoerror) { OnError(new ErrorEventArgs(new OutputDeviceException(result))); } }
public InputDevice(int deviceId) : base(deviceId) { _bufferCount = 0; _lockObject = new object(); _recording = false; _headerBuilder = new MidiHeaderBuilder(); Handle = 0; _resetting = false; _sysExBufferSize = 0x1000; _midiInProc = HandleMessage; var result = WindowsMultimediaDevice.midiInOpen(ref Handle, deviceId, _midiInProc, 0, 0x30000); if (result != (int)EDeviceException.MmsyserrNoerror) { throw new InputDeviceException(result); } }