public bool Stop()
 {
     if (this._device == IntPtr.Zero)
     {
         return(true);
     }
     if (!this._started)
     {
         return(true);
     }
     this._closing   = true;
     this._lastError = Midi.MIDI_InStop(this._device);
     if (this._lastError == MIDIError.MIDI_OK)
     {
         this._started = false;
         this.FlushShortMsgStack();
         this.RaiseMessageReceived(MidiMessageEventType.Stopped, null);
     }
     this._closing = false;
     return(!this._started);
 }