Re: Completely baffled..... Cocoa GUI with C midi proc ?
Re: Completely baffled..... Cocoa GUI with C midi proc ?
- Subject: Re: Completely baffled..... Cocoa GUI with C midi proc ?
- From: Patrick Gostovic <email@hidden>
- Date: Wed, 18 Feb 2004 12:14:27 -0500
Hi Paul.
When you call MIDIInputPortCreate from an Objective-C context, pass in
"self" for the fourth argument (refCon). Then when your midi read proc
is called, that "self" object will pop in as the second argument
(readProcRefCon). Then you can call back into the context from which
you setup the midi read proc.
i.e.
void myReadProc(const MIDIPacketList *pktlist, void *readProcRefCon,
void *srcConnRefCon)
{
[(SomeObjC_Class*)readProcRefCon doSomething];
}
Hope that helps.
Patrick
On 18-Feb-04, at 12:01 PM, Paul Ferguson wrote:
>
Thanks Patrick, I've tried combining the c functions and obj c methods
>
in
>
the same .m, but I still can't work out how to access my TextView from
>
within a c function (my midi receiving myReadProc() to be specific..),
>
I can
>
call the c functions from objC with no problems
>
>
Thanks, Paul
>
>
> From: Patrick Gostovic <email@hidden>
>
> Date: Wed, 18 Feb 2004 10:41:05 -0500
>
> To: Paul Ferguson <email@hidden>
>
> Cc: email@hidden
>
> Subject: Re: Completely baffled..... Cocoa GUI with C midi proc ?
>
>
>
> Forget the .c file -- you can freely mix Objective-C and C.
>
>
>
> On 18-Feb-04, at 10:21 AM, Paul Ferguson wrote:
>
>
>
>> Hi folks, please can someone put me out of my misery ? - I'm
>
>> writing a
>
>> small midi app based on Doug's echo.cpp. My Controller is objC, my
>
>> model
>
>> (midi routines) are in a .c - how on earth do I access the
>
>> TextView
>
>> in my
>
>> nib to display my parsed midi messages, I can't get objc_msgSend to
>
>> work (if
>
>> that is indeed the way to do it....)
>
>>
>
>> Any suggestions/sample code anyone ?? - thanks in antici...pation
>
>> _______________________________________________
>
>> 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.
_______________________________________________
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.