This commit is contained in:
2025-05-13 00:34:26 +03:00
parent ba0eb53334
commit f2b9d7c0db
12 changed files with 707 additions and 0 deletions
+19
View File
@@ -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());
}
}
}
}