- Inherits from:
- NSObject
- Conforms to:
- NSCoding
- NSObject (NSObject)
- Declared in:
- PYMIDI/PYMIDIEndpoint.h
This is an abstract class which provides a common interface for the concrete classes PYMIDIRealSource, PYMIDIRealDestination, PYMIDIVirtualSource, and PYMIDIVirtualDestination.
Methods are provided for querying and setting the status of the endpoint as well as sending and receiving MIDI data.
Querying and setting endpoint propertiesEndpoint status
- - displayName
- - compareByDisplayName:
- - name
- - setName:
- - uniqueID
- - setUniqueID:
- - midiEndpointRef
- - isIACBus
Sending MIDI data
- - isOnline
- - isOffline
- - isInUse
- - isOnlineOrInUse
Receiving MIDI data
- - addSender
- - processMIDIPacketList:sender:
- - removeSender:
Archiving endpoints
- - addReceiver
- - removeReceiver:
- - descriptor
- (void)addReceiver:(id)receiver
Adds the given object as a receiver for MIDI data from this endpoint. The receiver is expected to have a method of the form:
- (void)processMIDIPacketList:(MIDIPacketList*)myPacketList sender:(id)sender
This method should only be called on endpoints that supply MIDI data, i.e. real sources and virtual destinations.
Note that eceivers added with this method are not retained by the endpoint.
See Also: - removeReceiver:, - isInUse
- (void)addSender:(id)sender
Adds the given object as a sender of MIDI data to this endpoint. The sender can then call the processMIDIPacketList:sender: method of the endpoint to transmit data.
This method should only be called on endpoints that send MIDI data, i.e. real destinations and virtual sources.
Note that senders added with this method are not retained by the endpoint.
See Also: - processMIDIPacketList:sender:, - removeSender:, - isInUse
- (NSComparisonResult)compareByDisplayName:(PYMIDIEndpoint*)endpoint
Compares this endpoint's display name with that of the passed in endpoint and returns the appropriate result.
See Also: - displayName
- (PYMIDIEndpointDescriptor*)descriptor
Returns a PYMIDIEndpointDescriptor that uniquely identifies this endpoint.
- (NSString*)displayName
Returns the name of the endpoint as it should be displayed to the user. In particular, this recognises external devices configured in Audio MIDI Setup and displays their names as appropriate.
The string "(offline)" will be appended to the display name of an endpoint with a device that is currently disconnected.
See Also: - name, - setName:, - compareByDisplayName:
- (BOOL)isInUse
Returns YES if there are any senders or receivers registered on this endpoint.
See Also: - addReceiver:, - addSender:, - removeReceiver:, - removeSender:
- (BOOL)isIACBus
Returns YES if the endpoint is part of an IAC Bus.
- (BOOL)isInUse
Returns YES if the endpoint is being used by your app; that is, if their are any registered senders or receivers on this endpoint.
- (BOOL)isOffline
Returns YES if the device with which this endpoint is associated is currently not connected.
This is equivalent to ![endpoint isOnline].
See Also: - isOnline
- (BOOL)isOnline
Returns YES if the device with which this endpoint is associated is currently connected.
See Also: - isOffline
- (BOOL)isOnlineOrInUse
Returns YES if the endpoint is online or is in use. This is
equivalent to [endpoint isOnline] || [endpoint isInUse].
See Also: - isOnline, - isInUse
- (MIDIEndpointRef)midiEndpointRef
Returns the underlying CoreMIDI MIDIEndpointRef for this endpoint if there is one, nil otherwise.
- (NSString*)name
Returns the name of the endpoint, which usually consists of the name of the MIDI device followed by a port description.
For a name to display to the user, use the displayName method.
Note that this is not the same as the kMIDIPropertyName of the underlying CoreMIDI endpoint, but is a more useful value by which to reference the endpoint.
See Also: - displayName, - setName:
- (void)processMIDIPacketList:(const MIDIPacketList*)packetList
sender:(id)sender
Attempts to send the given MIDI data via this endpoint.
Note that you should call addSender: to register yourself as a sender before calling this method.
See Also: - addSender:
- (void)removeReceiver:(id)receiver
Removes the given receiver from the endpoint.
See Also: - addReceiver:
- (void)removeSender:(id)sender
Removes the given sender from the endpoint.
See Also: - processMIDIPacketList:sender:, - addSender:
- (BOOL)setName:(NSString*)name
Sets the name of the given endpoint. This should only be used on virtual endpoints.
See Also: - name
- (BOOL)setUniqueID:(SInt32)uniqueID
Sets the CoreMIDI unique ID of the endpoint. Strictly speaking this shouldn't be possible, but older versions of OS X allow it.
See Also: - uniqueID
- (SInt32)uniqueID
Returns the CoreMIDI unique ID of this endpoint.
See Also: - setUniqueID: