-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IO: Fixed crash when calling MIDIPacketNext; refactored MIDIPacketData
(cherry picked from commit feb7417)
- Loading branch information
Showing
8 changed files
with
136 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// CoreMIDI.h | ||
// MIDIKit | ||
// | ||
// Created by Steffan Andrews on 2021-04-13. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <CoreMIDI/CoreMIDI.h> | ||
|
||
extern void CPacketListIterate(const MIDIPacketList *midiPacketList, | ||
void (NS_NOESCAPE ^closure)(const MIDIPacket *midiPacket)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// CoreMIDI.m | ||
// MIDIKit | ||
// | ||
// Created by Steffan Andrews on 2021-04-13. | ||
// | ||
|
||
#include "CoreMIDI.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/// C method to iterate on `MIDIPacket`s within a `MIDIPacketList` | ||
void CPacketListIterate(const MIDIPacketList *midiPacketList, | ||
void (NS_NOESCAPE ^closure)(const MIDIPacket *midiPacket)) | ||
{ | ||
|
||
if (midiPacketList->numPackets == 0) { | ||
return; | ||
} | ||
|
||
const MIDIPacket *midiPacket = &midiPacketList->packet[0]; | ||
|
||
for (UInt32 idx = 0; idx < midiPacketList->numPackets; idx++) { | ||
closure(midiPacket); | ||
midiPacket = MIDIPacketNext(midiPacket); | ||
} | ||
|
||
} | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.