Re: MIDIOutputPortCreate returning a odd MIDIPortRef
Re: MIDIOutputPortCreate returning a odd MIDIPortRef
- Subject: Re: MIDIOutputPortCreate returning a odd MIDIPortRef
- From: Pete Gontier <email@hidden>
- Date: Mon, 07 Jun 2004 10:04:55 -0700
circa 6/5/04 3:46, p3consulting <email@hidden> wrote:
>
>> I know MIDIPortRef is an opaque type but opaque to the point to be an
>
>> odd address seems quite strange to me !?
>
> Yes. It's just a number. Today they happen to start at 0x9810000.
>
> Tomorrow they might look different.
>
If MIDIPortRef is just a reference number it should be something like
>
>
unsigned MIDIPortRef ;
>
>
or better yet
>
>
unsigned MIDIPortID ;
There is a good reason for such things to be declared as pointers to
incomplete structs, and that is that most C-like languages are too stupid to
allow one to define a distinct integral type (short of burying it in a
struct). I also like the Ref suffix better than the ID suffix because ID
reveals detail I don't want.
>
Are they other xxxxRef in MIDI that are not the pointer they "pretend"
>
to be ?
Probably. This paradigm is used all over the Mac OS API these days. That's
why there are accessor functions and high-level debugger plug-ins which call
them. (I don't know if there is a debugger plug-in for CoreMIDI.)
--
Pete Gontier
http://www.m-audio.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.