MIDIReadProc problem
MIDIReadProc problem
- Subject: MIDIReadProc problem
- From: John Alexander <email@hidden>
- Date: Tue, 07 Aug 2001 11:02:57 -0400
Hi maybe someone on the list can help me out. My problem is this: In my
Carbon application I create a bundle from the CoreMIDI framework, and get
pointers to the functions I need. After setting up a client, adding an input
port and connecting sources, I crash(exit) when my app receives its first
MIDIPacket. None of the CoreMIDI functions return an error.
What would cause my app to crash after receiving a MIDIPacket and calling
the callback? Thanks to anyone who can help!
- John Alexander
static void myProc( const MIDIPacketList *P, void* refCon, void* connrefCon)
{
// do something
}
... get CoreMIDI framework, bundle using CFBundleCreate ...
... and function pointers CFBundleGetFunctionPointerForName ...
err = myMIDIClientCreatePtr(CFSTR("myclient"), NULL, NULL, &client );
err = myMIDIInputPortCreatePtr(client, CFSTR("myinput"), myProc, NULL,
&inport);
err = myMIDIOutputPortCreatePtr(client, CFSTR("myoutput"), &outport);
for( i = 0; i < myMIDIGetNumberOfSourcesPtr(); ++i ){
MIDIEndpointRef src = myMIDIGetSourcePtr( i );
err = myMIDIPortConnectSourcePtr( inport, src, NULL );
}