- (MIDIDeviceRef) fetchMIDIDeviceForService:(DIIO
KitService *)kitDevice
{
MIDIDeviceRef device = NULL;
TDriverMIDIDeviceList?? ? ? ? ? deviceList(fMIDIDriver);
NSString * guidString;
NSNumber * guidNumber;
MIDIDeviceRef checkMIDIDevice;
guidNumber = [kitDevice propertyForKey:@"GUID"];
guidString = [NSString stringWithFormat:@"%llX", [guidNumber unsignedLongLongValue]];
// Find the device in the current MIDI environment
while( deviceList.Next(checkMIDIDevice) )
{
.......
status = MIDIObjectGetStringProperty( checkMIDIDevice, kDeviceGUIDPropertyName, (CFStringRef *)&deviceGUID );
if( status == noErr )
{
if( [guidString isEqualToString:deviceGUID] )
{
device = checkMIDIDevice;
}
...
}
else?......
}
......
}