• 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: Audio MIDI Setup Names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Audio MIDI Setup Names (From: "brucecoughlin" <email@hidden>)

  • Prev by Date: A potentially nasty bug in AUDispatch.cpp
  • Next by Date: AudioUnitHosting and MusicDevices
  • Previous by thread: Audio MIDI Setup Names
  • Next by thread: A potentially nasty bug in AUDispatch.cpp
  • Index(es):
    • Date
    • Thread