Re: finding midi device Endpoints by External Devices names?
Re: finding midi device Endpoints by External Devices names?
- Subject: Re: finding midi device Endpoints by External Devices names?
- From: Luke Bellandi <email@hidden>
- Date: Wed, 11 Feb 2004 16:39:25 -0800
From <CoreMIDI/MIDIServices.h>:
/*!
@constant kMIDIPropertyConnectionUniqueID
@discussion device/entity/endpoint property, integer or CFDataRef
UniqueID of an external device/entity/endpoint attached to this one
(strongly recommended that it be an endpoint).
This is for the use of a setup editor UI; not currently used
internally.
A driver-owned entity or endpoint has this property to refer
to an external MIDI device that is connected to it.
The property is non-existant or 0 if there is no connection.
New for CoreMIDI 1.1.
Beginning with CoreMIDI 1.3, this property may be a CFDataRef
containing
an array of big-endian SInt32's, to allow specifying that a driver
object connects
to multiple external objects (via MIDI thru-ing or splitting).
This property may also exist for external devices/entities/endpoints,
in which case it signifies a MIDI Thru connection to another external
device/entity/endpoint (again, strongly recommended that it be an
edpoint).
*/
So you'll need to use MIDIObjectGetIntegerProperty (...) instead.
Luke
On Feb 11, 2004, at 3:46 PM, Ken Hawkins wrote:
>
well i am still stuck;
>
>
>
CFStringRef pname, pmanuf, pmodel, puID;
>
>
n = MIDIGetNumberOfDevices();
>
MIDIDeviceRef dev = NULL;
>
for (i = 0; i < n; ++i) {
>
dev = MIDIGetDevice(i);
>
>
MIDIObjectGetStringProperty(dev, kMIDIPropertyName, &pname);
>
MIDIObjectGetStringProperty(dev, kMIDIPropertyManufacturer, &pmanuf);
>
MIDIObjectGetStringProperty(dev, kMIDIPropertyModel, &pmodel);
>
MIDIObjectGetStringProperty(dev, kMIDIPropertyConnectionUniqueID,
>
&puID);
>
...
>
>
tells me in the debugger that puID that is supposed to hold the value
>
for kMIDIPropertyConnectionUniqueID is always out of scope and hold
>
(0x0) for these calls.
>
>
this happens with all my devices that are connected and whether it is
>
using MIDIGetDevice(i) or MIDIGetExternalDevice(i) calls.
>
>
everything else works great. except......
>
>
thanks,
>
ken;
>
>
On Feb 11, 2004, at 1:29 PM, Luke Bellandi wrote:
>
>
> Hi Ken,
>
>
>
>> i am unclear as to how to connect to the device that i want to send
>
>> it
>
>> packets of midi data. how can i connect to the endpoint of a SPECIFIC
>
>> midi device and send it data?
>
>
>
> You can't interface with external devices directly. Assuming you've
>
> got your MIDI Setup characterized correctly in Audio MIDI Setup
>
> (i.e., you've added your external devices, and made the appropriate
>
> connections to your MIDI Interfaces), take the following steps to do
>
> what you're asking:
>
>
>
> 1) For the particular endpoint on the external device you're
>
> interested in, get property kMIDIPropertyConnectionUniqueID to find
>
> out what it's connected to.
>
> 2) Use the MIDIObjectFindByUniqueID(...) API on the UniqueID you just
>
> got to find the interface object it's connected to.
>
> 3) Send MIDI Data to *that* object.
>
>
>
> MIDI I/O can only be done with MIDI Devices, not External Devices.
>
>
>
> Best,
>
> Luke
>
> _______________________________________________
>
> 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.