📄 midi_methods.cpp
字号:
/* midi_methods.cpp
C wrapper for Windows MIDI interface, callable by Java programs
*/
#include "StubPreamble.h"
#include "midi_MidiOutDevice.h"
#include <mmsystem.h>
extern "C" __declspec(dllexport) long midi_MidiOutDevice_MidiOutGetNumDevs(struct Hmidi_MidiOutDevice *)
{
int n = midiOutGetNumDevs();
return n;
}
extern "C" __declspec(dllexport) long midi_MidiOutDevice_MidiOutOpen(struct Hmidi_MidiOutDevice *thisdev)
{
HMIDIOUT hmidiout = NULL;
UINT rc = midiOutOpen(&hmidiout, unhand(thisdev)->deviceId, NULL, NULL, CALLBACK_NULL);
unhand(thisdev)->deviceHandle = (long) hmidiout;
return (long) rc;
}
extern "C" __declspec(dllexport) long midi_MidiOutDevice_MidiOutReset(struct Hmidi_MidiOutDevice *thisdev)
{
return midiOutReset((HMIDIOUT)unhand(thisdev)->deviceHandle);
}
extern "C" __declspec(dllexport) long midi_MidiOutDevice_MidiOutClose(struct Hmidi_MidiOutDevice *thisdev)
{
return midiOutClose((HMIDIOUT)unhand(thisdev)->deviceHandle);
}
extern "C" __declspec(dllexport) long midi_MidiOutDevice_MidiOutShortMsg(struct Hmidi_MidiOutDevice *thisdev, long message)
{
return midiOutShortMsg((HMIDIOUT)unhand(thisdev)->deviceHandle, message);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -