Add native MIDI support for Mac OSX via Core MIDI API
A couple of years ago I contributed native MIDI support for Windows and Linux, but was not able to do so for Mac OSX because I lacked a workable development environment. This has been remedied, and I was able to implement and test Core MIDI support in an OSX Mojave VM talking to a real Roland SC-88 via a USB-MIDI interface.
As with Windows, support for this is automatically enabled in OSX builds because it's an OS-provided functionality.
File change notes:
- CMakeLists.txt:
- link required Core API libraries on OSX
- src/MusicSrc/MusicDevice.c:
- include relevant headers for native MIDI support on OSX
- add Core MIDI handles to native MIDI device struct on OSX
- change Windows NativeMidiSendMessage() to take a pointer for outHandle so that calling code can stay common between that and OSX
- add device name lookup utilities from rtmidi library
- implement Core MIDI based NativeMidiSendMessage() function
- implement Core MIDI device init/destroy and device query logic
- update NativeMidiSendMessage() callers to pass outHandle as pointer for Windows and OSX
You can see what I meant with my own pull request to your pull request: https://github.com/HunterZ/systemshock/pull/2
You can see what I meant with my own pull request to your pull request: HunterZ#2
Thanks. I don't know much about coremidi and was just going off of what examples I could find, so I'm happy to merge in your suggestions.