*
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace RushMidiLibrary {
|
||||
public class MidiDevice {
|
||||
|
||||
|
||||
protected void CheckMMResult(MidiApiWindows.MMRESULT errorCode) {
|
||||
if(errorCode != MidiApiWindows.MMRESULT.MMSYSERR_NOERROR) {
|
||||
StringBuilder errorMessage = new StringBuilder(128);
|
||||
errorCode = MidiApiWindows.midiInGetErrorText(errorCode, errorMessage);
|
||||
if (errorCode != MidiApiWindows.MMRESULT.MMSYSERR_NOERROR) {
|
||||
throw new MidiDeviceException("Unknown error");
|
||||
}
|
||||
throw new MidiDeviceException(errorMessage.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user