private void DestroyHandle()
        {
            if (_handle == IntPtr.Zero)
            {
                return;
            }

            MidiInWinApi.midiInReset(_handle);
            MidiInWinApi.midiInClose(_handle);
        }
        /// <summary>
        /// Stops listening for incoming MIDI events on the current <see cref="InputDevice"/> and flushes
        /// all pending data.
        /// </summary>
        /// <exception cref="ObjectDisposedException">The current <see cref="InputDevice"/> is disposed.</exception>
        /// <exception cref="MidiDeviceException">An error occurred on device.</exception>
        public void Reset()
        {
            EnsureDeviceIsNotDisposed();

            if (_handle == IntPtr.Zero)
            {
                return;
            }

            ProcessMmResult(MidiInWinApi.midiInReset(_handle));
        }
Beispiel #3
0
        public void Reset()
        {
            EnsureDeviceIsNotDisposed();

            if (_handle == IntPtr.Zero)
            {
                return;
            }

            ProcessMmResult(() => MidiInWinApi.midiInReset(_handle));
            _startTime = DateTime.UtcNow;
        }