Re: ReadProc can't use Objective C
Re: ReadProc can't use Objective C
- Subject: Re: ReadProc can't use Objective C
- From: Herbie Robinson <email@hidden>
- Date: Tue, 24 Dec 2002 04:06:43 -0500
It would be a good idea to avoid anything that might garbage collect.
if your MIDIReadProc is implemented in a .m file, then you can use any
objective-c construct. you could use one of the RefCons to pass in
an objective-c object pointer, like
void myReadProc(const MIDIPacketList *pktlist, void
*readProcRefCon, void *srcConnRefCon)
{
SomeClass *anObject = readProcRefCon;
[anObject someMessage:pktlist];
}
there's no such thing as "self" or "super" inside your C function, since those
only make sense in a method definition. but you can certainly send messages
to an object, as long as you get your hands on the object in the first place.
-mike
On Monday, December 23, 2002, at 08:33 AM, Craig Bakalian wrote:
Hi,
I have a standard ReadProc set up in a Cocoa app. I need to
send the data to a Cocoa Object. The standard C like nature of the
readProc can't see an Objective C function like -
[self sendMidiData: (unsigned)tonalValue]. What is a programmer to do?
Craig Bakalian
--
-*****************************************
**
http://www.curbside-recording.com/ **
******************************************
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.