MIKMIDIConnectionManagerDelegate
Objective-C
@protocol MIKMIDIConnectionManagerDelegate <NSObject>Swift
protocol MIKMIDIConnectionManagerDelegate : NSObjectProtocolProtocol containing method(s) to be implemented by delegates of MIKMIDIConnectionManager.
- 
                  
                  A connection manager’s delegate can implement this method to determine whether or not to automatically connect to a newly added MIDI device. See MIKMIDIAutoConnectBehavior for possible return values. If this method is not implemented, the default behavior is MIKMIDIAutoConnectBehaviorConnectIfPreviouslyConnectedOrNew.DeclarationObjective-C - (MIKMIDIAutoConnectBehavior)connectionManager: (nonnull MIKMIDIConnectionManager *)manager shouldConnectToNewlyAddedDevice:(nonnull MIKMIDIDevice *)device;Swift optional func connectionManager(_ manager: MIKMIDIConnectionManager, shouldConnectToNewlyAddedDevice device: MIKMIDIDevice) -> MIKMIDIAutoConnectBehaviorParametersmanagerAn instance of MIKMIDIConnectionManager. deviceThe newly added MIDI device. Return ValueOne of the values defined in MIKMIDIAutoConnectBehavior. 
- 
                  
                  A connection manager's delegate can implement this method to be notified when a device is connected, either because -connectToDevice:error: was called, or because the device was plugged, and the managerautomatically connected to it. You can for example use this method to update UI in response to a device being connected. DeclarationObjective-C - (void)connectionManager:(nonnull MIKMIDIConnectionManager *)manager deviceWasConnected:(nonnull MIKMIDIDevice *)device;Swift optional func connectionManager(_ manager: MIKMIDIConnectionManager, deviceWasConnected device: MIKMIDIDevice)ParametersmanagerAn instance of MIKMIDIConnectionManager. deviceThe MIKMIDIDevice that was disconnected. 
- 
                  
                  A connection manager’s delegate can implement this method to be notified when a connected device is disconnected, either because -disconnectFromDevice: was called, or because the device was unplugged. If a MIDI device is disconnected between sending a note on message and sending the corresponding note off command,this can cause a “stuck note” because the note off command will now never be delivered. e.g. a MIDI piano keyboard that is disconnected with a key held down. This method includes an array of these unterminated note on commands (if any) so that the receiver can appropriately deal with this situation. For example, corresponding note off commands could be generated and sent through whatever processing chain is processing incoming MIDI commands to terminate stuck notes. DeclarationObjective-C - (void)connectionManager:(nonnull MIKMIDIConnectionManager *)manager deviceWasDisconnected:(nonnull MIKMIDIDevice *)device withUnterminatedNoteOnCommands: (nonnull NSArray<MIKMIDINoteOnCommand *> *)commands;Swift optional func connectionManager(_ manager: MIKMIDIConnectionManager, deviceWasDisconnected device: MIKMIDIDevice, withUnterminatedNoteOnCommands commands: [MIKMIDINoteOnCommand])ParametersmanagerAn instance of MIKMIDIConnectionManager. deviceThe MIKMIDIDevice that was disconnected. commandsAn array of note on messages for which corresponding note off messages have not yet been received. 
 View on GitHub
View on GitHub MIKMIDIConnectionManagerDelegate Protocol Reference
        MIKMIDIConnectionManagerDelegate Protocol Reference