internal virtual int checkError(int err) { // note that Pm_Read and Pm_Write return positive result values // which are not errors, so compare with >= if (err >= pm.pmNoError) { return(err); } if (err == pm.pmHostError) { throw new CsPortMidiException(err, CsPortMidiApi.Pm_GetHostErrorText()); } else { throw new CsPortMidiException(err, CsPortMidiApi.Pm_GetErrorText(err)); } }