Skip to content

Commit

Permalink
Issue #106: Fix for potential to connect to 'half' of a virtual device.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Madsen committed Nov 6, 2015
1 parent 8d2002f commit 3de4421
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Source/MIKMIDIConnectionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,23 @@ - (void)setIncludesVirtualDevices:(BOOL)includesVirtualDevices
}
}

- (void)setAvailableDevices:(NSArray *)availableDevices
{
if (availableDevices != _availableDevices) {

// Disconnect from newly unavailable devices.
// This will include "partial" virtual devices that are now complete
// by virtue of having been notified of other sources for them.
for (MIKMIDIDevice *device in self.connectedDevices) {
if (![availableDevices containsObject:device]) {
[self internalDisconnectFromDevice:device];
}
}

_availableDevices = availableDevices;
}
}

+ (BOOL)automaticallyNotifiesObserversOfConnectedDevices { return NO; }
- (MIKSetOf(MIKMIDIDevice *) *)connectedDevices
{
Expand Down

0 comments on commit 3de4421

Please sign in to comment.