Question

I'm trying to distinguish between "Virtual" and "Non-Virtual" MIDIEndpointRefs in my iOS app.

The MIDIObjectType enum seems to be the place to look, but as far as I can tell, this property is not something I can query.

Any advice?

Was it helpful?

Solution 2

Here's the solution I was pointed to on the OMAC google group (thanks Jesse Chappell

static BOOL isVirtualEndpoint(MIDIEndpointRef ref)
{
    MIDIEntityRef entity = 0;

    MIDIEndpointGetEntity(ref, &entity);
    if (entity) 
    {
        return NO;
    }
    else 
    {
    return YES;
    }
}

OTHER TIPS

Starting with the MIDIEndpointRef, try using MIDIEndpointGetEntity and then MIDIEntityGetDevice to find a device. If the entity or device are nil, then the endpoint is probably "virtual".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top