You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When virtual sources or destinations are discovered and the app is already running these endpoints are not added to the internal virtual endpoint lists.
It seems to me as if the methods that should add the endpoints have a method body copied from the respective removal methods.
The methods - (void)addInternalVirtualSourcesObject:(MIKMIDISourceEndpoint *)source
and - (void)addInternalVirtualDestinationsObject:(MIKMIDIDestinationEndpoint *)destination
do not add endpoints they would instead remove the endpoints if they were to be found.
This is the method body for addInternalVirtualSourcesObject:
Hi Jan, thanks for reporting this. That is certainly a bug! I'd be happy to accept a pull request if you'd like to fix it and submit one. Otherwise, I'll get this fixed shortly.
I found a bug in
MIKMIDIDeviceManager
.When virtual sources or destinations are discovered and the app is already running these endpoints are not added to the internal virtual endpoint lists.
It seems to me as if the methods that should add the endpoints have a method body copied from the respective removal methods.
The methods
- (void)addInternalVirtualSourcesObject:(MIKMIDISourceEndpoint *)source
and
- (void)addInternalVirtualDestinationsObject:(MIKMIDIDestinationEndpoint *)destination
do not add endpoints they would instead remove the endpoints if they were to be found.
This is the method body for
addInternalVirtualSourcesObject
:NSUInteger index = [self.internalVirtualSources indexOfObject:source]; if (index == NSNotFound) return; [self willChange:NSKeyValueChangeRemoval valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"virtualSources"]; [self.internalVirtualSources removeObjectAtIndex:index]; [self didChange:NSKeyValueChangeRemoval valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"virtualSources"];
It should be:
NSUInteger index = [self.internalVirtualSources count]; [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"virtualSources"]; [self.internalVirtualSources insertObject:source atIndex:index]; [self didChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"virtualSources"];
The method body for
addInternalVirtualDestinationsObject
should be:NSUInteger index = [self.internalVirtualDestinations count]; [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"virtualDestinations"]; [self.internalVirtualDestinations insertObject:destination atIndex:index]; [self didChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"virtualDestinations"];
When I change the code in this way adding virtual endpoints works as expected.
Jan
The text was updated successfully, but these errors were encountered: