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

CplugHostContext changes #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Photosounder
Copy link

@Photosounder Photosounder commented Feb 29, 2024

I took the liberty of doing some of the changes we discussed. This includes using CplugHostContext everywhere instead of AUv2Plugin, CLAPPlugin and so on, removing CPLUG_NUM_PARAMS and calling cplug_getParamCount() instead, adding the host context pointer to cplug_createPlugin(). One bit of awkwardness is that I had to declare cplug_createPlugin() in cplug.h as taking a void* argument instead of CplugHostContext* due to CplugHostContext being declared later.

That takes care of the tedious part that had to be done before you can implement propertyChanged().

I also changed cplug_log(), now it's defined by a macro, the idea is that if you don't define it it defaults to a fprintf(stderr, ...), but if you do define it prior to #include <cplug.h> in your plugin then you can define it to a function in your plugin code much like the original cplug_log() function which can write to a file, for instance by doing #define cplug_log myplugin_log. Arguably it could be renamed to CPLUG_LOG() now that it's a macro, but I leave this choice up to you, I myself occasionally keep function alias macros as small caps because they call only functions.

@Tremus
Copy link
Owner

Tremus commented Mar 3, 2024

Good job man. I'm a bit busy to test this right now but I will get around to it and very likely merge this. Thanks for your help!

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