Skip to content
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

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Ios/midi io #1057

wants to merge 13 commits into from

Conversation

olilarkin
Copy link
Member

Here are some instructions for a good PR

  • create an issue first to outline the problem, to reference in this PR
  • clearly describe the problem that the PR fixes
  • each PR should address one thing. It can include multiple commits, but you should try and tidy up work done into logical units if possible.
  • pay attention to iplug2 coding style
  • If it applies to an option e.g. IGRAPHICS_NANOVG or VST3 plug-ins, try to provide fixes for all options (e.g. all graphics backends or all plug-in formats)

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

//static
void IPlugIOSMIDI::GetMidiPort(WDL_String& name, ERoute route)
{
NSDictionary* dic = @{@"name": [NSValue valueWithPointer:&name], @"direction": @(route == iplug::kInput ? "source" : "destination")};
Copy link
Member Author

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

Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants