protected override void Dispose(bool disposing) { if (disposing) { lock (_lockObject) { Reset(); var result = WindowsMultimediaDevice.midiInClose(Handle); if (result != 0) { throw new InputDeviceException(result); } } } else { WindowsMultimediaDevice.midiInReset(Handle); WindowsMultimediaDevice.midiInClose(Handle); } base.Dispose(disposing); }
public override void Reset() { if (IsDisposed) { throw new ObjectDisposedException("InputDevice"); } lock (_lockObject) { _resetting = true; var result = WindowsMultimediaDevice.midiInReset(Handle); if (result == (int)EDeviceException.MmsyserrNoerror) { _recording = false; _resetting = false; } else { _resetting = false; throw new InputDeviceException(result); } } }