Re: MIDIReadProc problem
Re: MIDIReadProc problem
- Subject: Re: MIDIReadProc problem
- From: Doug Wyatt <email@hidden>
- Date: Tue, 7 Aug 2001 08:22:55 -0700
Is your callback in CFM or Mach-O code? It will be called using Mach-O
conventions. If it is in CFM code, you need special glue. I'm told
there's documentation in the Carbon SDK on how to get a CFM function
called back from an API that expects a Mach-O callback.
Doug
On Tuesday, August 7, 2001, at 08:02 AM, John Alexander wrote:
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 );
}
_______________________________________________
coreaudio-api mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden
http://www.sonosphere.com
"Changing OS's is the corporate equivalent of molting -- you're very
vulnerable after you've done it but you have to do it to survive".
-- Ray Spears