Re: question about CoreMIDI & cocoa
Re: question about CoreMIDI & cocoa
- Subject: Re: question about CoreMIDI & cocoa
- From: Robert Grant <email@hidden>
- Date: Tue, 28 Sep 2004 20:09:50 -0400
On Sep 28, 2004, at 5:31 PM, john wrote:
Hi Khamba,
I've never used CoreMIDI, but I am familiar with calling ObjC methods
from C callbacks and I do find it rather trivial. Maybe Robert is
referring to some other aspect since I know nothing about CoreMIDI. In
any case I'm sure checking out the MIDIMonitor source will be very
helpful overall.
Hi John,
Certainly calling Obj-C methods from C code is not a problem - it's the
thread communication that's the problem as AppKit is not generally
thread-safe.
I seem to remember getting spanked over using the approach the Shaun
suggests (performSelectorOnMainThread) as it allocates memory which can
block the MIDI thread (perhaps I'm mis-remembering) - various
non-blocking queueing mechanisms were then discussed - it's all in the
archives.
Anyway - for most apps performSelectorOnMainThread will do the job -
IMHO (which I would have suggested if I had not gone through the
spanking before ;-))
Robert.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden