• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ReadProc can't use Objective C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ReadProc can't use Objective C


  • Subject: Re: ReadProc can't use Objective C
  • From: Michael Thornburgh <email@hidden>
  • Date: Mon, 23 Dec 2002 09:41:40 -0800

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
_______________________________________________
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.

  • Follow-Ups:
    • Re: ReadProc can't use Objective C
      • From: Herbie Robinson <email@hidden>
References: 
 >ReadProc can't use Objective C (From: Craig Bakalian <email@hidden>)

  • Prev by Date: ReadProc can't use Objective C
  • Next by Date: DLS Synth and 10.2.3
  • Previous by thread: ReadProc can't use Objective C
  • Next by thread: Re: ReadProc can't use Objective C
  • Index(es):
    • Date
    • Thread