Skip to content

Commit

Permalink
Made MIKMIDIGetCurrentTimeStamp() a real function so it bridges into …
Browse files Browse the repository at this point in the history
…Swift.
  • Loading branch information
Andrew Madsen committed Mar 11, 2016
1 parent bb860d4 commit 658cb63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/MIKMIDIUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NSInteger MIKMIDIStandardLengthOfMessageForCommandType(MIKMIDICommandType comman
#define MIKMIDI_RAISE_MUTATION_ATTEMPT_EXCEPTION ([NSException raise:NSInternalInconsistencyException format:@"Attempt to mutate immutable %@", NSStringFromClass([self class])])

// A prettier way to get the mac_absolute_time() when working with MIDITimeStamps.
#define MIKMIDIGetCurrentTimeStamp() (mach_absolute_time())
MIDITimeStamp MIKMIDIGetCurrentTimeStamp();

/**
* Returns whether a given MIDI note number corresponds to a "black key" on a piano.
Expand Down
5 changes: 5 additions & 0 deletions Source/MIKMIDIUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ NSInteger MIKMIDIStandardLengthOfMessageForCommandType(MIKMIDICommandType comman
return result;
}

MIDITimeStamp MIKMIDIGetCurrentTimeStamp()
{
return mach_absolute_time();
}

#pragma mark - Note Utilities

BOOL MIKMIDINoteIsBlackKey(NSInteger noteNumber)
Expand Down

0 comments on commit 658cb63

Please sign in to comment.