MIKMIDIMappingItem
Objective-C
@interface MIKMIDIMappingItem : NSObject <NSCopying>
Swift
class MIKMIDIMappingItem : NSObject, NSCopying
MIKMIDIMappingItem contains information about a mapping between a physical MIDI control, and a single command supported by a particular MIDI responder object.
MIKMIDIMappingItem specifies the command type, and MIDI channel for the commands sent by the mapped physical control along with the control’s interaction type (e.g. knob, turntable, button, etc.). It also specifies the (software) MIDI responder to which incoming commands from the mapped control should be routed.
-
Creates and initializes a new MIKMIDIMappingItem instance.
Declaration
Objective-C
- (nonnull instancetype) initWithMIDIResponderIdentifier:(nonnull NSString *)MIDIResponderIdentifier andCommandIdentifier:(nonnull NSString *)commandIdentifier;
Swift
init(midiResponderIdentifier MIDIResponderIdentifier: String, andCommandIdentifier commandIdentifier: String)
Parameters
MIDIResponderIdentifier
The identifier for the MIDI responder object being mapped.
commandIdentifier
The identifer for the command to be mapped.
Return Value
An initialized MIKMIDIMappingItem instance.
-
Returns an NSString instance containing an XML representation of the receiver. The XML document returned by this method can be written to disk.
See
-writeToFileAtURL:error:
Declaration
Objective-C
- (nullable NSString *)XMLStringRepresentation;
Swift
func xmlStringRepresentation() -> String?
Return Value
An NSString containing an XML representation of the receiver, or nil if an error occurred.
-
The MIDI identifier for the (software) responder object being mapped. This is the same value as returned by calling -MIDIIdentifier on the responder to be mapped.
This value can be used to retrieve the MIDI responder to which this mapping refers at runtime using -[NS/UIApplication MIDIResponderWithIdentifier].
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull MIDIResponderIdentifier;
Swift
var midiResponderIdentifier: String { get }
-
The identifier for the command mapped by this mapping item. This will be one of the identifier’s returned by the mapped responder’s -commandIdentifiers method.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull commandIdentifier;
Swift
var commandIdentifier: String { get }
-
The interaction type for the physical control mapped by this item. This can be used to determine how to interpret the incoming MIDI messages mapped by this item.
Declaration
Objective-C
@property (nonatomic) MIKMIDIResponderType interactionType;
Swift
var interactionType: MIKMIDIResponderType { get set }
-
If YES, value decreases as slider/knob goes left->right or top->bottom. This property is currently only relevant for knobs and sliders, and has no meaning for buttons or other responder types.
Declaration
Objective-C
@property (nonatomic, getter=isFlipped) BOOL flipped;
Swift
var isFlipped: Bool { get set }
-
The MIDI channel upon which commands are sent by the control mapped by this item.
Declaration
Objective-C
@property (nonatomic) NSInteger channel;
Swift
var channel: Int { get set }
-
The MIDI command type of commands sent by the control mapped by this item.
Declaration
Objective-C
@property (nonatomic) MIKMIDICommandType commandType;
Swift
var commandType: MIKMIDICommandType { get set }
-
The control number of the control mapped by this item. This is either the note number (for Note On/Off commands) or controller number (for control change commands).
Declaration
Objective-C
@property (nonatomic) NSUInteger controlNumber;
Swift
var controlNumber: UInt { get set }
-
Optional additional key value pairs, which will be saved as attributes in this item’s XML representation. Keys and values must be NSStrings.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSDictionary *additionalAttributes;
Swift
var additionalAttributes: [AnyHashable : Any]? { get set }
-
The MIDI Mapping the receiver belongs to. May be nil if the mappping item hasn’t been added to a mapping yet, or its mapping has been deallocated.
Declaration
Objective-C
@property (nonatomic, weak, readonly, nullable) MIKMIDIMapping *mapping;
Swift
weak var mapping: MIKMIDIMapping? { get }