Re: MIDI device/entity/endpoint names formatting on UI and for persistent device references?
Re: MIDI device/entity/endpoint names formatting on UI and for persistent device references?
- Subject: Re: MIDI device/entity/endpoint names formatting on UI and for persistent device references?
- From: Brian Willoughby <email@hidden>
- Date: Thu, 16 Jul 2009 15:13:43 -0700
On Jul 16, 2009, at 01:09, Ross Bencina wrote:
I'm trying to display a list of all MIDI endpoints in a list and
I'm having trouble constructing meaningful names. The developer
library documentation conflicts with what I've found from
experience and what I'm reading on line and I'm confused. Could
anyone please confirm a method they use which works well in
practice? I have listed the two Apple methods I found below. Is
there a list of names which different drivers output for device/
entity/endpoint which I could use to validate my code?
Also, although I understand the abstractions, I'm a little unclear
on the uniqueness criteria for the different device/entity/endpoint
names. If there are two of the same type of MIDI device connected,
can I rely on Core Audio to guarantee that their device names will
be unique (e.g. does it append a number or something) or do I need
to use something other than their names to uniquely identify them?
Are entity names within a device required to be unique or should I
be encoding the indexes for persistent reference?
If you want guaranteed uniqueness, then you should request the UID.
I believe there are potentially two questions to consider here.
First, how do you save a persistent reference that is guaranteed to
be unique. Second, how do you display device names to the user. I
believe that you should use the UID for your persistent storage, but
this is not something which can be displayed to the user. In some
respects, you may not need to distinguish each option in a device
name list so long as you can reliably associate each with a unique
device. Personally, I use the 'tag' attribute of the items in a
popup to store the UID, while the visible text displays some basic
name. It takes some care to do this properly, since the standard
method for adding a name will fail if the name already exists, but if
you access the list by index, that problem does not occur. Sometimes
this results in multiple items with the same name, so always match on
the UID first, then fall back to the text if the UID is missing.
You can possibly find a better description of matching and display by
searching the archives of this mailing list. Apple employees have
commented many times on the recommended practices.
Brian Willoughby
Sound Consulting
_______________________________________________
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