Declared in NSUIApplication+MIKMIDI.h

Overview

MIKMIDI implements a category on NSApplication (on OS X) or UIApplication (on iOS) to facilitate the creation and use of a MIDI responder hierarchy, along with the ability to send MIDI commands to responders in that hierarchy.

Tasks

  • – registerMIDIResponder:

    Register a MIDI responder for receipt of incoming MIDI messages.

  • – unregisterMIDIResponder:

    Unregister a previously-registered MIDI responder so it stops receiving incoming MIDI messages.

  • – respondsToMIDICommand:

    NSApplication (OS X) or UIApplication (iOS) itself implements to methods in the MIKMIDIResponder protocol. This method determines if any responder in the MIDI responder chain (registered responders and their subresponders) responds to the passed in MIDI command, and returns YES if so.

  • – handleMIDICommand:

    When this method is invoked with a MIDI command, the application will search its registered MIDI responders, for responders that respond to the command, then call their -handleMIDICommand: method.

  • – MIDIResponderWithIdentifier:

    Returns a registered MIDI responder with the given MIDI identifier.

  • – allMIDIResponders

    Returns all MIDI responders that have been registered with the application.

Instance Methods

MIDIResponderWithIdentifier:

- (id<MIKMIDIResponder>)MIDIResponderWithIdentifier:(NSString *)identifier
Discussion

Returns a registered MIDI responder with the given MIDI identifier.

Parameters

identifier

An NSString instance containing the MIDI identifier to search for.

Return Value

An object that conforms to MIKMIDIResponder, or nil if no registered responder for the passed in identifier could be found.

Declared In

NSUIApplication+MIKMIDI.h

allMIDIResponders

- (NSSet *)allMIDIResponders
Discussion

Returns all MIDI responders that have been registered with the application.

Return Value

An NSSet containing objects that conform to the MIKMIDIResponder protocol.

Declared In

NSUIApplication+MIKMIDI.h

handleMIDICommand:

- (void)handleMIDICommand:(MIKMIDICommand *)command
Discussion

When this method is invoked with a MIDI command, the application will search its registered MIDI responders, for responders that respond to the command, then call their -handleMIDICommand: method.

Call this method from a MIDI source event handler block to automatically dispatch MIDI commands/messages from that source to all interested registered responders.

Parameters

command

The command to dispatch to responders.

Declared In

NSUIApplication+MIKMIDI.h

registerMIDIResponder:

- (void)registerMIDIResponder:(id<MIKMIDIResponder>)responder
Discussion

Register a MIDI responder for receipt of incoming MIDI messages.

If targeting OS X 10.8 or higher, or iOS, the application maintains a zeroing weak reference to the responder, so unregistering the responder on deallocate is not necessary.

For applications targeting OS X 10.7, registered responders must be explicitly unregistered (e.g. in their -dealloc method) by calling -unregisterMIDIResponder before being deallocated.

Parameters

responder

The responder to register.

Declared In

NSUIApplication+MIKMIDI.h

respondsToMIDICommand:

- (BOOL)respondsToMIDICommand:(MIKMIDICommand *)command
Discussion

NSApplication (OS X) or UIApplication (iOS) itself implements to methods in the MIKMIDIResponder protocol. This method determines if any responder in the MIDI responder chain (registered responders and their subresponders) responds to the passed in MIDI command, and returns YES if so.

Parameters

command

An MIKMIDICommand instance.

Return Value

YES if any registered MIDI responder responds to the command.

Declared In

NSUIApplication+MIKMIDI.h

unregisterMIDIResponder:

- (void)unregisterMIDIResponder:(id<MIKMIDIResponder>)responder
Discussion

Unregister a previously-registered MIDI responder so it stops receiving incoming MIDI messages.

Parameters

responder

The responder to unregister.

Declared In

NSUIApplication+MIKMIDI.h