forked from mixedinkey-opensource/MIKMIDI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MIKMIDIClientDestinationEndpoint.h
55 lines (46 loc) · 2.31 KB
/
MIKMIDIClientDestinationEndpoint.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// MIKMIDIClientDestinationEndpoint.h
// Pods
//
// Created by Andrew Madsen on 9/26/14.
//
//
#import "MIKMIDIDestinationEndpoint.h"
#import "MIKMIDICompilerCompatibility.h"
@class MIKMIDIClientDestinationEndpoint;
@class MIKMIDICommand;
NS_ASSUME_NONNULL_BEGIN
typedef void(^MIKMIDIClientDestinationEndpointEventHandler)(MIKMIDIClientDestinationEndpoint *destination, MIKArrayOf(MIKMIDICommand *) *commands);
typedef void(^MIKMIDIClientDestinationEndpointSingleEventHandler)(MIKMIDIClientDestinationEndpoint *destination, MIKMIDICommand *commands);
/**
* MIKMIDIClientDestinationEndpoint represents a virtual endpoint created by your application to receive MIDI
* from other applications on the system.
*
* Instances of this class will be visible and can be connected to by other applications.
*/
@interface MIKMIDIClientDestinationEndpoint : MIKMIDIDestinationEndpoint
/**
* Initializes a new virtual destination endpoint.
*
* This is essentially equivalent to creating a Core MIDI destination endpoint
* using MIDIDestinationCreate(). Destination endpoints created using this
* method can be used by your application to *receive* MIDI rather than send
* it. They can be seen and connected to by other applications on the system.
*
* @note On iOS, in order to create MIKMIDIClientDestinationEndpoint instances,
* your app must include the 'audio' key in its UIBackgroundModes in its Info.plist.
* Please see https://github.com/mixedinkey-opensource/MIKMIDI/wiki/Adding-Audio-to-UIBackgroundModes .
*
* @param name A name for the new virtual endpoint.
* @param handler A block to be called when the endpoint receives MIDI messages.
*
* @return An instance of MIKMIDIClientDestinationEndpoint, or nil if an error occurs.
*/
- (nullable instancetype)initWithName:(NSString *)name receivedMessagesHandler:(nullable MIKMIDIClientDestinationEndpointEventHandler)handler receivedSingleMessageHandler:(nullable MIKMIDIClientDestinationEndpointSingleEventHandler)singleHandler;
/**
* A block to be called when the receiver receives new incoming MIDI messages.
*/
@property (nonatomic, strong, nullable) MIKMIDIClientDestinationEndpointEventHandler receivedMessagesHandler;
@property (nonatomic, strong, nullable) MIKMIDIClientDestinationEndpointSingleEventHandler receivedSingleMessagesHandler;
@end
NS_ASSUME_NONNULL_END