-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CoreMIDI MIDI Driver #17569
CoreMIDI MIDI Driver #17569
Conversation
Signed-off-by: Joseph Mattiello <git@joemattiello.com> CoreMIDI install into build Signed-off-by: Joseph Mattiello <git@joemattiello.com>
5377906
to
6350b3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will be set HAVE_COREMIDI
?
size_t length = packet->length; | ||
const MIDITimeStamp timestamp = packet->timeStamp; | ||
|
||
while (length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take care of it later
coremidi_queue_t input_queue; ///< Queue for incoming MIDI events | ||
} coremidi_t; | ||
|
||
/// Write to the queue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ItemCount count = MIDIGetNumberOfDestinations(); | ||
union string_list_elem_attr attr = {0}; | ||
|
||
for (ItemCount i = 0; i < count; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incompatible with c89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... maybe but this code only ever gets built with Xcode and Apple clang, which defaults to gnu99, though on macOS we change that to c99. There's a ton of other places throughout the Apple-only code that does not follow c89.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix it up later, we can still merge it as is.
// Create a MIDIPacketList with sufficient buffer size | ||
char packetListBuffer[sizeof(MIDIPacketList) + sizeof(MIDIPacket) + event->data_size]; | ||
MIDIPacketList *packetList = (MIDIPacketList *)packetListBuffer; | ||
MIDIPacket *packet = MIDIPacketListInit(packetList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an deprecated API? Maybe you can take care of the version restrictions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated but not removed, and we support versions prior to when the new API was added. Again, there are a bunch of places where we use "deprecated" APIs that still work on the newer versions because we want to maintain compatibility with older versions, so many so that I've even turned off the deprecation warnings during the build.
Probably you can use coreaudio implementation as a clue: grep -rn COREAUDIO --exclude-dir=intl/ ./ intl/msg_hash_us.h Something like |
Yeah it needs to get set in BaseConfig.xcconfig. The libraries and frameworks aren't typically set from there though (though maybe they should be), they're set inside the Xcode project files. I'll take care of all that. |
Thanks for taking care of this for me! And yes, I used the "deprecated" api's since I know RA likes to support older OSes. I believe the deprecation was only as recent as ios14. Thanks again for the merge and fixing it up for me, cheers, |
Guidelines
Description
Adds a CoreMIDI driver in raw C.
I wasn't sure how to properly impliment it into the build, since I use my own frontend, but I tried my best to figure it out. Only issue was if I should include it in
configuration.c
et al;Related Issues
#12146
Related Pull Requests
[Any other PRs from related repositories that might be needed for this pull request to work]
Reviewers
[If possible @mention all the people that should review your pull request]