Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtualDestinations returns hardware destinations too #323

Open
adamjansch opened this issue Dec 6, 2021 · 0 comments
Open

virtualDestinations returns hardware destinations too #323

adamjansch opened this issue Dec 6, 2021 · 0 comments

Comments

@adamjansch
Copy link
Contributor

So I've noticed in MIKMIDIDeviceManager this code:

- (void)retrieveVirtualEndpoints
{
    NSMutableArray *sources = [NSMutableArray array];
    ItemCount numSources = MIDIGetNumberOfSources();
    for (ItemCount i=0; i<numSources; i++) {
        MIDIEndpointRef sourceRef = MIDIGetSource(i);
        MIKMIDIEndpoint *source = [MIKMIDIEndpoint MIDIObjectWithObjectRef:sourceRef];
        if (!source) continue;
        [sources addObject:source];
    }
    self.internalVirtualSources = sources;
    
    NSMutableArray *destinations = [NSMutableArray array];
    ItemCount numDestinations = MIDIGetNumberOfDestinations();
    for (ItemCount i=0; i<numDestinations; i++) {
        MIDIEndpointRef destinationRef = MIDIGetDestination(i);
        MIKMIDIEndpoint *destination = [MIKMIDIEndpoint MIDIObjectWithObjectRef:destinationRef];
        if (!destination) continue;
        [destinations addObject:destination];
    }
    self.internalVirtualDestinations = destinations;
}

As I understand it, this code picks up any available MIDI source and destination, be they hardware or virtual, and uses those to set internalVirtualSources and internalVirtualDestinations. Is that the intention? If so then the "virtual" language on the property names is very confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant