<CoreFoundation/CFPlugIn.h>,
<CoreFoundation/CFPlugInCOM.h>,
<CoreFoundation/CFRunLoop.h>,
<CoreMIDI/CoreMIDI.h>
This is the header file for Mac OS X's MIDI driver interface.
MIDI drivers are CFPlugIns, installed into the following places:
/System/Library/Extensions -- not recommended for non-Apple drivers, but necessary for compatibility with CoreMIDI 1.0 /Library/Audio/MIDI Drivers -- starting with CoreMIDI 1.1 ~/Library/Audio/MIDI Drivers -- starting with CoreMIDI 1.1
Refer to the CFPlugIn documentation for more information about plug-ins.
A driver's bundle settings should include settings resembling the following:
Bundle settings: CFBundleIdentifier String com.mycompany.midi.driver.mydevice (note that this will be the driver's persistent ID in MIDISetup's) CFPlugInDynamicRegistration String NO CFPlugInFactories Dictionary 1 key/value pair [your new factory UUID] String [your factory function name] CFPlugInTypes Dictionary 1 key/value pair ECDE9574-0FE4-11D4-BB1A-0050E4CEA526 Array 1 object (this is kMIDIDriverTypeID) 0 String [your new factory UUID] Build settings: WRAPPER_EXTENSION plugin
Drivers have access to most of the CoreMIDI API. They should link with
CoreMIDIServer.framework, not CoreMIDI.framework.
Unlike applications, drivers communicate with the server directly, not
through Mach messaging. This necessitates some limitations on the contexts from
which a driver may call the server.
The MIDI I/O functions MIDISend and MIDIReceived may be called from any thread.
All other CoreMIDI functions must only be called from the server's main thread, which is the
thread on which the driver is created and from which all calls to the driver other than
Send() are made.