-
Notifications
You must be signed in to change notification settings - Fork 21
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
Allow plugins to request custom extensions #136
Allow plugins to request custom extensions #136
Conversation
I wonder if we should do something like make the default version of extensionget something like { So you at least get that clearly in debug? |
Yeah, I had thought about that too... my concern is that plugins will probably want to make decisions in their constructor based on which extensions are or aren't available. Like the other logical spots to check for extension availability would be |
Ahh clap allows it in the constructor and its just we can't thread it? sorry I had mis-understood. Then yes we can do some finagling since we know there's only one construction path at a time. Set a guard where we create the audio processor with the current host available and reset it afterwards or something. So the construct looks like
type thing then that's how you are thinking? |
Yeah, that's about what I was thinking, although your little snippet is a lot cleaner than what I had going on :). I'll re-work it later today. |
@baconpaul this is ready for a real review now :) |
@jatinchowdhury18 Thanks for making this (I'm the original requester)! I can't build your PR to check for myself atm but looking at the code I have a thought: Wouldn't it make more sense to do this check for the master track (using GetMasterTrack())? |
@nofishonfriday yes, that's a good call! I hadn't though about what would happen if the user loaded the plugin on the master track. Update: unfortunately, Reaper won't let us change the master track colour, so I'll keep using track 0 for that part. I just added a check so that we won't crash if track 0 doesn't exist yet. |
The CJE changes look great to me. Happy for you to merge! |
@baconpaul I still need to clean up the example code, but I wanted to ask about the pattern I used for making the
extensionGet
function pointer available to the plugin. The "problem" with the function pointer pattern that we've used previously is that the pointer is not yet set when the plugin constructor is called, so the plugin can't query for extensions until sometime after the constructor has been called.So I tried to do something similar to what was done for the
is_clap
field inclap_properties
. I'm not sure if that's the right pattern to use here, or what the potential issues are with that approach? I can't think of anything better at the moment, but if you've got any ideas, that would be great too!