• 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: Obj C and C with CoreMidi
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obj C and C with CoreMidi


  • Subject: Re: Obj C and C with CoreMidi
  • From: Craig Bakalian <email@hidden>
  • Date: Thu, 1 Jan 2004 09:44:36 -0500

On Dec 31, 2003, at 3:34 PM, Kurt Revis wrote:
Nonsense. There is an easier way to do it, without any static objects. Just pass in your Objective-C object as the refCon to MIDIInputPortCreate(). (If necessary, you can also use another object as the connRefCon in MIDIPortConnectSource() -- if you don't need it just use NULL.) Both of these objects will be given to your MIDIReadProc, at which time you can cast them to the appropriate type, and send Objective-C messages to them.

I'm sure code like this has been posted to the list before, but here it goes again. Let's assume you have an Obj-C class which takes MIDI input -- we'll call it MyPortRelatedObject. It creates an input port and then connects one or more endpoints to that port.

(There is also a class called MyConnectionRelatedObject which contains the information your application needs to know about the connection -- that is, the unique combination of input port and endpoint. There may be any number of these for each instance of MyPortRelatedObject. You might not need this at all in a simple application. I usually use these to hold a MIDI input parser object, so the state of the parser for each connected endpoint is independent of all the other parsers/endpoints.)

Well, you learn something new everyday. Thanks Kurt!

Craig Bakalian
www.eThinkingCap.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.

  • Next by Date: KEXT Undefined Symbols In Panther
  • Next by thread: KEXT Undefined Symbols In Panther
  • Index(es):
    • Date
    • Thread