Skip to content

Commit

Permalink
Merge branch '1.1' into Issue106
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Madsen committed Nov 6, 2015
2 parents ce9de64 + 6f5a524 commit 156f10d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
12 changes: 8 additions & 4 deletions Source/MIKMIDIDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
@class MIKMIDIEntity;
@class MIKMIDIEndpoint;

NS_ASSUME_NONNULL_BEGIN

/**
* MIKMIDIDevice represents a MIDI device such as a DJ controller, MIDI piano keyboard, etc.
*
Expand Down Expand Up @@ -42,15 +44,15 @@
* Connecting to a Device
* ----------------------
*
* To connect a device and start receiving MIDI messages from it, you must first get the source endpoints
* To connect a device and start receiving MIDI messages from it, you must first get the source endpoints
* you want to connect to. Often there will be only one. You can retrieve all of a devices source endpoints
* using the following:
*
* NSArray *sources = [self.device.entities valueForKeyPath:@"@unionOfArrays.sources"];
* MIKMIDISourceEndpoint = [source firstObject]; // Or whichever source you want, but often there's only one.
*
* Next, connect to that source using MIKMIDIDeviceManager:
*
*
* MIKMIDIDeviceManager *manager = [MIKMIDIDeviceManager sharedDeviceManager];
* NSError *error = nil;
* BOOL success = [manager connectInput:source error:&error eventHandler:^(MIKMIDISourceEndpoint *source, NSArray *commands) {
Expand Down Expand Up @@ -113,12 +115,12 @@
/**
* The manufacturer of the MIDI device.
*/
@property (nonatomic, strong, readonly) NSString *manufacturer;
@property (nonatomic, strong, readonly, nullable) NSString *manufacturer;

/**
* The model number of the MIDI device.
*/
@property (nonatomic, strong, readonly) NSString *model;
@property (nonatomic, strong, readonly, nullable) NSString *model;

/**
* An NSArray containing instances of MIKMIDIEntity, representing the entities of the
Expand All @@ -128,3 +130,5 @@
@property (nonatomic, strong, readonly) MIKArrayOf(MIKMIDIEntity *) *entities;

@end

NS_ASSUME_NONNULL_END
7 changes: 5 additions & 2 deletions Source/MIKMIDIUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
#import <CoreMIDI/CoreMIDI.h>
#import "MIKMIDIMappableResponder.h"
#import "MIKMIDICommand.h"
#import "MIKMIDICompilerCompatibility.h"

NSString *MIKStringPropertyFromMIDIObject(MIDIObjectRef object, CFStringRef propertyID, NSError *__autoreleasing*error);
NS_ASSUME_NONNULL_BEGIN

NSString * _Nullable MIKStringPropertyFromMIDIObject(MIDIObjectRef object, CFStringRef propertyID, NSError *__autoreleasing*error);
BOOL MIKSetStringPropertyOnMIDIObject(MIDIObjectRef object, CFStringRef propertyID, NSString *string, NSError *__autoreleasing*error);

SInt32 MIKIntegerPropertyFromMIDIObject(MIDIObjectRef object, CFStringRef propertyID, NSError *__autoreleasing*error);
Expand Down Expand Up @@ -57,4 +60,4 @@ NSString *MIKMIDINoteLetterForMIDINoteNumber(UInt8 noteNumber);
*/
NSString *MIKMIDINoteLetterAndOctaveForMIDINote(UInt8 noteNumber);


NS_ASSUME_NONNULL_END

0 comments on commit 156f10d

Please sign in to comment.