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
Ios/midi io #1057
base: master
Are you sure you want to change the base?
Ios/midi io #1057
Conversation
IPlug/AUv3/iOSApp/IPlugIOSMIDI.mm
Outdated
//static | ||
void IPlugIOSMIDI::GetMidiPort(WDL_String& name, ERoute route) | ||
{ | ||
NSDictionary* dic = @{@"name": [NSValue valueWithPointer:&name], @"direction": @(route == iplug::kInput ? "source" : "destination")}; |
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.
Storing a pointer to the WDL_String here and setting the value in the notification handler feels wrong here... trying to think of other options @AlexHarker
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.
Yes - I can see why that's not ideal, but we are picking it up at the other end and the idea was to be able to get the value out here - I wouldn't want to pass a pointer to an plugin-developer in this way, but here the framework is using the notification system to pass around data. As far as I am aware (and I am pretty sure I would have tested before using this approach) the notification system is immediate and synchronous, so it should be safe - it's just that the notification system is the best way to communicate between app and plugin (given that the framework has no notion of the wrapping app). This was based on the BT Midi notification stuff - if there's a better way or a way that involves putting a hook in the plugin base etc. then I'd be ok with that.
Here are some instructions for a good PR
If you follow these rules, it is more likely we will consider your PR, but please don't be upset if we decide we don't want to merge your work.
thanks, we like PRs!
oli & alex