Re: Audio MIDI Setup Names
Re: Audio MIDI Setup Names
- Subject: Re: Audio MIDI Setup Names
- From: Pete Yandell <email@hidden>
- Date: Fri, 13 Jun 2003 18:53:39 +1000
Here's the code I use. This strings together the names of any connected
devices (separated by commas) or reverts back to the endpoint name if
none are found.
CFDataRef externalIDs;
OSStatus result;
NSString* displayName;
NSMutableArray* names = [NSMutableArray arrayWithCapacity:0];
// Pull in a list of external devices connected to our endpoint
result = MIDIObjectGetDataProperty (
midiEndpointRef, kMIDIPropertyConnectionUniqueID, &externalIDs
);
// If we do have external devices, grab all their names and glue
them together
if (result == noErr) {
int i;
for (i = 0; i < CFDataGetLength (externalIDs); i += 4) {
SInt32 externalID;
CFDataGetBytes (externalIDs, CFRangeMake (i, 4),
(UInt8*)&externalID);
if (externalID != 0) {
MIDIObjectRef externalDevice;
MIDIObjectType deviceType;
result = MIDIObjectFindByUniqueID (externalID,
&externalDevice, &deviceType);
CFStringRef externalName;
result = MIDIObjectGetStringProperty (externalDevice,
kMIDIPropertyName, &externalName);
[names addObject:[NSString
stringWithString:(NSString*)externalName]];
CFRelease (externalName);
}
}
CFRelease (externalIDs);
}
if ([names count] > 0)
displayName = [names componentsJoinedByString:@", "];
else
displayName = name;
On Friday, June 13, 2003, at 03:38 PM, brucecoughlin wrote:
>
I'm sure this has probably been asked before, but I can't seem to get
>
into
>
the archives.
>
>
>
>
I can't figure out how to access the Audio MIDI Setup names from my
>
app.
>
>
For instance, I'm using
>
MIDIGetNumberofSources() then
>
MIDIGetSource then
>
MIDIObjectGetStringProperty(src, kMIDIPropertyName, &pname);
>
>
to get the interface model and port name of the ports on a midi
>
interface.
>
>
But what I end up with is a list like
>
MIDITimePieceAV:Port 1
>
MIDITimePieceAV:Port 2
>
>
etc
>
>
What I WANT to see are the synths, etc that are connected to those
>
ports,
>
whose names are in the Audio MIDI Setup.
>
MIDITimePieceAV:JV2080
>
MIDITimePieceAV:S-760
>
>
How do I access these?
>
>
I tried using MIDIDeviceGetEntity() (and the associated calls with it)
>
but
>
that only returned the same info I already had gotten (Port 1, Port 2,
>
etc).
>
>
>
Any hints?
>
>
TIA
>
_______________________________________________
>
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.