Inherits from NSObject
Declared in MIKMIDIObject.h

Overview

MIKMIDIObject is the base class for all of MIKMIDI’s Objective-C wrapper classes for CoreMIDI classes. It corresponds to MIDIObject in CoreMIDI.

MIKMIDIObject is essentially an “abstract” base class, although it does implement several methods common to all MIDI objects.

These methods can be called and/or overridden by subclasses of MIKMIDIObject, but are not otherwise part of the public interface to MIKMIDIObject. They should not be called directly except by subclasses of MIKMIDIObject.

Tasks

Other Methods

  • + MIDIObjectWithObjectRef:

    Convenience method for creating a new MIKMIDIObject instance. Returns an instance of a concrete subclass of MIKMIDIObject (e.g. MIKMIDIDevice, MIKMIDIEntity, MIKMIDISource/DestinationEndpoint) depending on the type of the object passed into it.

  • – initWithObjectRef:

    Creates and initializes an MIKMIDIObject instance. Returns an instance of a concrete subclass of MIKMIDIObject (e.g. MIKMIDIDevice, MIKMIDIEntity, MIKMIDISource/DestinationEndpoint) depending on the type of the object passed into it.

  • – propertiesDictionary

    Used to get a dictionary containing key/value pairs corresponding to the properties returned by CoreMIDI’s MIDIObjectGetProperties() function.

  •   objectRef

    The CoreMIDI MIDIObjectRef which the receiver wraps.

    property
  •   uniqueID

    The (CoreMIDI-supplied) unique ID for the receiver.

    property
  •   online

    Whether the receiver is online (available for use) or not.

    property
  •   name

    The name of the receiver. Devices, entities, and endpoints may all have names.

    property
  •   displayName

    The Apple-recommended user-visible name of the receiver. May be identical to the value returned by name.

    property
  •   isVirtual

    Indicates whether the object is “virtual”. This has slightly different meanings depending on the type of MIDI object.

    property

Extension Methods

Properties

displayName

@property (nonatomic, strong, readonly) NSString *displayName
Discussion

The Apple-recommended user-visible name of the receiver. May be identical to the value returned by name.

Declared In

MIKMIDIObject.h

isVirtual

@property (nonatomic, readonly) BOOL isVirtual
Discussion

Indicates whether the object is “virtual”. This has slightly different meanings depending on the type of MIDI object.

For MIKMIDIDevices, virtual means that the device does not represent a MIDIDeviceRef. Virtual devices can be used to wrap virtual, deviceless endpoints created e.g. by other software, some Native Instruments controllers, etc.

For MIKMIDIEntitys, virtual means that the entity is part of a virtual device and its endpoints are virtual endpoints.

For MIKMIDIEndpoints, virtual means that the endpoint is a virtual endpoint, rather than an endpoint of a (non-virtual) MIDI device.

@seealso [MIKMIDIDeviceManager virtualSources] @seealso [MIKMIDIDeviceManager virtualDestinations]

Declared In

MIKMIDIObject.h

name

@property (nonatomic, strong) NSString *name
Discussion

The name of the receiver. Devices, entities, and endpoints may all have names.

Declared In

MIKMIDIObject.h

objectRef

@property (nonatomic, readonly) MIDIObjectRef objectRef
Discussion

The CoreMIDI MIDIObjectRef which the receiver wraps.

Declared In

MIKMIDIObject.h

online

@property (nonatomic, readonly, getter=isOnline) BOOL online
Discussion

Whether the receiver is online (available for use) or not.

Declared In

MIKMIDIObject.h

uniqueID

@property (nonatomic, readonly) MIDIUniqueID uniqueID
Discussion

The (CoreMIDI-supplied) unique ID for the receiver.

Declared In

MIKMIDIObject.h

Class Methods

MIDIObjectWithObjectRef:

+ (instancetype)MIDIObjectWithObjectRef:(MIDIObjectRef)objectRef
Discussion

Convenience method for creating a new MIKMIDIObject instance. Returns an instance of a concrete subclass of MIKMIDIObject (e.g. MIKMIDIDevice, MIKMIDIEntity, MIKMIDISource/DestinationEndpoint) depending on the type of the object passed into it.

Parameters

objectRef

A CoreMIDI MIDIObjectRef.

Return Value

An instance of the appropriate subclass of MIKMIDIObject.

Declared In

MIKMIDIObject.h

canInitWithObjectRef:

+ (BOOL)canInitWithObjectRef:(MIDIObjectRef)objectRef
Discussion

Whether the receiver can be initialized with the passed in objectRef, which may be NULL (e.g. for purely virtual objects).

MIKMIDIObject’s base implementation of this method checks the object’s type and returns YES if it is contained in the array returned by representedMIDIObjectTypes. Therefore, unless special behavior is required (e.g. supporting virtual objects where the objectRef is NULL), this does not typically need to be overriden.

Parameters

objectRef

A CoreMIDI MIDIObjectRef.

Return Value

YES, if the class can be instantiated using the passed in object, NO otherwise.

Declared In

MIKMIDIObject_SubclassMethods.h

registerSubclass:

+ (void)registerSubclass:(Class)subclass
Discussion

Registers a subclass of MIKMIDIObject. Registered subclasses will be instantiated and returned by [MIKMIDIObject initWithObjectRef:] and [MIKMIDIObject MIDIObjectWithObjectRef:] for the object type(s) they support.

Typically this method should be called in the subclass’s +load method.

Note: If two subclasses represent the same object type, as determined by calling representedMIDIObjectTypes, which one is used is undefined.

Parameters

subclass

A subclass of MIKMIDIObject.

Declared In

MIKMIDIObject_SubclassMethods.h

representedMIDIObjectTypes

+ (NSArray *)representedMIDIObjectTypes
Discussion

The MIDIObjectTypes the receiver can represent. MIKMIDIObject uses this method to determine which subclass to use to represent a particular MIDI object type.

Return Value

An NSArray containing NSNumber representations of MIDIObjectType values.

Declared In

MIKMIDIObject_SubclassMethods.h

Instance Methods

initWithObjectRef:

- (id)initWithObjectRef:(MIDIObjectRef)objectRef
Discussion

Creates and initializes an MIKMIDIObject instance. Returns an instance of a concrete subclass of MIKMIDIObject (e.g. MIKMIDIDevice, MIKMIDIEntity, MIKMIDISource/DestinationEndpoint) depending on the type of the object passed into it.

Parameters

objectRef

A CoreMIDI MIDIObjectRef.

Return Value

An instance of the appropriate subclass of MIKMIDIObject.

Declared In

MIKMIDIObject.h

propertiesDictionary

- (NSDictionary *)propertiesDictionary
Discussion

Used to get a dictionary containing key/value pairs corresponding to the properties returned by CoreMIDI’s MIDIObjectGetProperties() function.

For a list of possible keys, see the “Property name constants” section of CoreMIDI/MIDIServices.h.

Return Value

An NSDictionary containing various properties of the receiver. See

Declared In

MIKMIDIObject.h